{"id":21565168,"url":"https://github.com/seeed-solution/sensecap-decoder","last_synced_at":"2025-04-10T13:08:05.802Z","repository":{"id":173232173,"uuid":"632291944","full_name":"Seeed-Solution/SenseCAP-Decoder","owner":"Seeed-Solution","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-08T01:04:22.000Z","size":138,"stargazers_count":23,"open_issues_count":9,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T02:22:02.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seeed-Solution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-25T05:39:46.000Z","updated_at":"2025-04-08T01:04:25.000Z","dependencies_parsed_at":"2023-12-25T07:26:59.884Z","dependency_job_id":"5dcd9786-6654-4ecd-ade1-fc7133eaf3f8","html_url":"https://github.com/Seeed-Solution/SenseCAP-Decoder","commit_stats":null,"previous_names":["seeed-solution/sensecap-decoder"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Solution%2FSenseCAP-Decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Solution%2FSenseCAP-Decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Solution%2FSenseCAP-Decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Solution%2FSenseCAP-Decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seeed-Solution","download_url":"https://codeload.github.com/Seeed-Solution/SenseCAP-Decoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248224241,"owners_count":21068072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T10:18:39.894Z","updated_at":"2025-04-10T13:08:05.783Z","avatar_url":"https://github.com/Seeed-Solution.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SenseCAP-Decoder\n\nTTN payload decoding script for SenseCAP LoRaWAN messages\nThis script is used for decoding the LoRaWAN messages sent from the SenseCAP nodes. After decoding, users' applications will get more friendly and readable messages from TTN data API.\n\n## How to Use\n\n#### 1. Prerequisites\n\nWe assume that you already setup your gateway and SenseCAP nodes correctly, and the SenseCAP nodes can send messages to your TTN application. You can already observe the data transmisstion through TTN console.\n\n![image](https://user-images.githubusercontent.com/5130185/76604764-48b49180-654a-11ea-992b-761bf8179590.png)\n\n#### 2. Configure the Payload Decoder\n\n- Please navigate to the `Payload Formats` tab of your application to which your SenseCAP nodes send data.\n- Select `Custom` for `Payload Format`\n- Copy and paste the whole contents of `decoder.js` to the `decoder` textarea.\n  \u003e If you are using the latest version of TTN v3, you may encounter an error that exceeds the character limit. In this case, you will need to use `decoder_new-v3-uglifyjs.js` instead.\n- Click `save payload functions`\n\n![image](https://user-images.githubusercontent.com/5130185/76605545-954c9c80-654b-11ea-984e-272c58492e85.png)\n\n\n#### 3. Check the Decoded Messages\n\nYou may test the decoding script with sample payload first. To do this,  just copy `01 01 10 98 53 00 00 01 02 10 A8 7A 00 00 AF 51` into the `Payload` text input, and click `Test` button. If succeeded, you will see a successfully parsed JSON structure below.\n\n![image](https://user-images.githubusercontent.com/5130185/76605914-43584680-654c-11ea-9074-6e78d93059a7.png)\n\nThen let's check out the magic of the script. We navigate to the `Data` tab, and you can expand any uploaded message to check the `Fields` in the payload. These fields are just populated by the script.\n\n![image](https://user-images.githubusercontent.com/5130185/76606268-ec9f3c80-654c-11ea-90e0-332f186475f3.png)\n\nIf you're subscribing the messages with TTN's MQTT Data API, you will also get parsed JSON payload fields.\n\n```\nClient mosq-TCSlhYcKaRCn3cIePE received PUBLISH (d0, q0, r0, m0, 'lorawan868/devices/2cf7f12010700041/up', ... (719 bytes))\nlorawan868/devices/2cf7f12010700041/up {\"app_id\":\"lorawan868\",\"dev_id\":\"2cf7f12010700041\",\"hardware_serial\":\"2CF7F12010700041\",\"port\":2,\"counter\":1119,\"confirmed\":true,\"payload_raw\":\"AQEQYG0AAAECEOj9AACWSA==\",\"payload_fields\":{\"err\":0,\"messages\":[{\"measurementId\":4097,\"measurementValue\":28,\"type\":\"report_telemetry\"},{\"measurementId\":4098,\"measurementValue\":65,\"type\":\"report_telemetry\"}],\"payload\":\"010110606D0000010210E8FD00009648\",\"valid\":true},\"metadata\":{\"time\":\"2020-03-13T09:09:45.834032725Z\",\"frequency\":867.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":66816000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-2cf7f11014300001\",\"timestamp\":1779605971,\"time\":\"2020-03-13T09:09:45.672666033Z\",\"channel\":4,\"rssi\":-66,\"snr\":8.8,\"rf_chain\":0}]}}\n```\n\n## Reference\n\nHow many message types and what's the structure of each message type?\n\nWe will document the latest message types in the comment header of the script. Please check out [here](https://github.com/Seeed-Solution/TTN-Payload-Decoder/blob/master/decoder.js#L1).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeed-solution%2Fsensecap-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseeed-solution%2Fsensecap-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeed-solution%2Fsensecap-decoder/lists"}