Add Senzemo vendor with 9 Senstick devices - #40
Merged
brocaar merged 11 commits intoSep 15, 2026
Merged
Conversation
Senzemo (Sensedge d.o.o.) LoRaWAN sensors. All Senstick-family devices are OTAA Class-A, LoRaWAN 1.0.3 / RP001-1.0.3-RevA, so a single set of regional profiles is shared across the whole product line. Senzemo is not a LoRa Alliance member, so vendor_id is 0.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved codec defects remain in smc33.js and kou20.js, including a runtime-blocking configuration decode issue.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Senzemo as a vendor with nine Senstick/Senspuck devices, regional profiles, codecs, and test fixtures.
Changes:
- Registers the vendor and device metadata.
- Adds EU868, US915, AU915, and AS923 profiles.
- Adds nine codecs with encode/decode fixtures.
File summaries
| File | Reviewed changes |
|---|---|
vendors/senzemo/vendor.toml |
Registers Senzemo and its devices. |
vendors/senzemo/profiles/US915-1_0_3.toml |
Adds the US915 profile. |
vendors/senzemo/profiles/EU868-1_0_3.toml |
Adds the EU868 profile. |
vendors/senzemo/profiles/AU915-1_0_3.toml |
Adds the AU915 profile. |
vendors/senzemo/profiles/AS923-1_0_3.toml |
Adds the AS923 profile. |
vendors/senzemo/devices/sto10.toml |
Defines the STO10 device. |
vendors/senzemo/devices/stb10.toml |
Defines the STB10 device. |
vendors/senzemo/devices/ssm40.toml |
Defines the SSM40 device. |
vendors/senzemo/devices/spu30.toml |
Defines the SPU30 device. |
vendors/senzemo/devices/smc40.toml |
Defines the SMC40 device. |
vendors/senzemo/devices/smc33.toml |
Defines the SMC33 device. |
vendors/senzemo/devices/smc30.toml |
Defines the SMC30 device. |
vendors/senzemo/devices/sam20.toml |
Defines the SAM20 device. |
vendors/senzemo/devices/kou20.toml |
Defines the KOU20 device. |
vendors/senzemo/codecs/test_encode_sto10.json |
Adds STO10 encode fixtures. |
vendors/senzemo/codecs/test_encode_stb10.json |
Adds STB10 encode fixtures. |
vendors/senzemo/codecs/test_encode_ssm40.json |
Adds SSM40 encode fixtures. |
vendors/senzemo/codecs/test_encode_spu30.json |
Adds SPU30 encode fixtures. |
vendors/senzemo/codecs/test_encode_smc40.json |
Adds SMC40 encode fixtures. |
vendors/senzemo/codecs/test_encode_smc33.json |
Adds SMC33 encode fixtures. |
vendors/senzemo/codecs/test_encode_smc30.json |
Adds SMC30 encode fixtures. |
vendors/senzemo/codecs/test_encode_sam20.json |
Adds SAM20 encode fixtures. |
vendors/senzemo/codecs/test_encode_kou20.json |
Adds KOU20 encode fixtures. |
vendors/senzemo/codecs/test_decode_sto10.json |
Adds STO10 decode fixtures. |
vendors/senzemo/codecs/test_decode_stb10.json |
Adds STB10 decode fixtures. |
vendors/senzemo/codecs/test_decode_ssm40.json |
Adds SSM40 decode fixtures. |
vendors/senzemo/codecs/test_decode_spu30.json |
Adds SPU30 decode fixtures. |
vendors/senzemo/codecs/test_decode_smc40.json |
Adds SMC40 decode fixtures. |
vendors/senzemo/codecs/test_decode_smc33.json |
Adds SMC33 decode fixtures. |
vendors/senzemo/codecs/test_decode_smc30.json |
Adds SMC30 decode fixtures. |
vendors/senzemo/codecs/test_decode_sam20.json |
Adds SAM20 decode fixtures. |
vendors/senzemo/codecs/test_decode_kou20.json |
Adds KOU20 decode fixtures. |
vendors/senzemo/codecs/sto10.js |
Adds the STO10 codec. |
vendors/senzemo/codecs/stb10.js |
Adds the STB10 codec. |
vendors/senzemo/codecs/ssm40.js |
Adds the SSM40 codec. |
vendors/senzemo/codecs/spu30.js |
Adds the SPU30 codec. |
vendors/senzemo/codecs/smc40.js |
Adds the SMC40 codec. |
vendors/senzemo/codecs/smc33.js |
Adds the SMC33 codec; unresolved runtime, mask, and timestamp issues remain. |
vendors/senzemo/codecs/smc30.js |
Adds the SMC30 codec. |
vendors/senzemo/codecs/sam20.js |
Adds the SAM20 codec. |
vendors/senzemo/codecs/kou20.js |
Adds the KOU20 codec; its configuration length check needs correction. |
Review details
Suppressed comments (4)
vendors/senzemo/codecs/kou20.js:78
- This branch checks for a 10-byte configuration packet but only parses bytes 0 through 8; the extra byte is silently discarded. The other Senstick configuration decoders use the same nine fields with a 9-byte check, so a normal 9-byte KOU20 config frame will never decode. Align the length check with the parsed fields (or explicitly parse the tenth field) and add a config fixture.
if (bytes.length == 10)
vendors/senzemo/codecs/smc33.js:157
DataRatePlusADRuses bit 7 for ADR and bits 0–6 for the data rate, so0x0Fdrops valid rate bits 4–6. A configuration byte with any of those bits set will therefore be decoded with an incorrectDataRate; use the full lower-seven-bit mask (0x7F), consistent with the other Senstick codecs.
DataRate = (DataRatePlusADR & 0x0F);
vendors/senzemo/codecs/smc33.js:104
- The 4-byte Unix timestamp is unsigned, but
bytes[8] << 24creates a signed 32-bit value in JavaScript. Once the high bit is set (for timestamps after 2038-01-19), valid timestamps decode as negative; assemble this value and coerce it with>>> 0(and apply the same correction to the 13-byte branch).
Unixtime = (bytes[8] << 24) + (bytes[9] << 16) + (bytes[10] << 8) + bytes[11];
vendors/senzemo/codecs/smc33.js:126
- As in the 12-byte branch, the high-byte shift makes this 32-bit Unix timestamp signed. Valid timestamps with bit 31 set will be reported as negative instead of their unsigned epoch value; coerce the assembled value with
>>> 0.
Unixtime = (bytes[9] << 24) + (bytes[10] << 16) + (bytes[11] << 8) + bytes[12];
- Files reviewed: 41/41 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ChirpStack evaluates codecs as ES modules, which are always strict. The SMC33 decoder assigns ADRon and DataRate without declaring them, so every fPort 3 config packet threw a ReferenceError. Declare both in the adapter, matching the existing Fcnt_ret declaration for STB10. SMC33 also assembles its 32-bit Unixtime with << 24, which yields a signed value, so timestamps from 2038 onwards decoded as negative. Normalise it to unsigned. No fixture exercised a config packet, which is how this went unnoticed. Add an fPort 3 config fixture for every codec with a config branch, plus 12- and 13-byte SMC33 timestamp fixtures including one past 2038.
Contributor
|
Thanks @aljaz77 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Senzemo Senstick SAM20 connector and fixes payload decoding for all Senstick connectors under
decoders/connector/senzemo/, so they now decode on every network listed in theirpayload-config.jsonc(previously thefPort/FPortport names, base64data/dataFrameand TTN'sfrm_payloadwere missed). It also keepsdescription.mdshort, with the longer text ininstall_text, and addresses the Copilot review comments.Test plan
pnpm run check(orpnpm run linter+pnpm test)pnpm testpnpm start validatorpnpm start generate(maintainers only, when cutting a release)New or updated decoder
decoders/network/ordecoders/connector/follows README layoutnetwork.jsoncorconnector.jsoncvalidates againstschema/manifest.jsoncpresentdescription,install_text, anddevice_annotationare objective (no subjective marketing, no off-platform links)Review context
decoders/connector/senzemo/09331a3f26b3062fon fPort 2 for SAM20; seepayload.test.tsin each device'sv1.0.0/folder