Migration Guide
This guide walks you through upgrading the prebuilt JavaScript parsers that are typically embedded in LoRaWAN network servers. The focus is on the practical steps required when moving from the legacy 2.x.x bundles to the modular 4.x.x architecture, plus the smaller hop from 3.x.x to 4.x.x.
Before you start
- Download the latest parser bundle from the releases page or regenerate it via the WIKA IIoT Toolbox.
- Keep the previous parser file handy so you can copy measuring ranges and verify behavior during testing.
- Review the device-specific documentation to confirm the channel names and default measuring ranges that the
adjustMeasuringRangehelper expects.
Note: The prebuilt
4.x.xscripts still expose their helpers globally (for exampledecodeUplink,decodeHexUplink,adjustMeasuringRange). You no longer edit global measurement range variables directly; instead you call the provided adjustment helpers before decoding data.
Migrating from 2.x.x to 4.x.x
Legacy parsers rely on top-level variables (for example PRESSURE_RANGE_START, DEVICE_TEMPERATURE_RANGE_END) that you edit directly in the script. The 4.x.x parsers removes those globals. Instead, you apply measuring ranges by calling the global adjustMeasuringRange helper for each channel before decoding any messages.
Download the new script. Keep the legacy file alongside it so you can reference the configured ranges, but deploy only the freshly generated
index.jsto your network server.Reapply your configuration in the new file. Instead of editing global variables, add calls to
adjustMeasuringRangenear the bottom of the new script (for example right before the export section). Do this once so every subsequent decode runs with the correct spans.javascriptadjustMeasuringRange('pressure', { start: -1, end: 20 }) adjustMeasuringRange('device temperature', { start: -40, end: 125 })Channel names are case-sensitive and documented in the devices section.
Update helper usage.
- Continue calling the global
decodeUplink(input)helper; no wrapper is required. - If you used
decodeHexString, switch todecodeHexUplink({ bytes: '010203', fPort: 10 }). - The legacy
decodeBase64Stringhelper is not shipped with the modular parser. If you still receive Base64 payloads, convert them to byte arrays or hex strings before callingdecodeUplink.
- Continue calling the global
Validate your integration. Run a few known uplinks through the new parser to ensure the decoded values match expectations. Pay special attention to alarms and warning messages, as the new architecture surfaces richer validation feedback.
Retire the legacy script. Once verification looks good, archive the old file and roll out the new parser wherever you previously deployed the
2.x.xversion.
Migrating from 3.x.x to 4.x.x
Only NETRIS2 currently ships a 3.x.x parser. The upgrade is straightforward because channel scaling already relied on internal validation.
Download the new script. Deploy the
4.x.xbundle and keep the3.x.xfile only as a reference while you verify behavior.Test alarms and configuration flows. As the
NETRIS2only supports 4-20 mA, there is no need to adjust the measuring ranges. The4.x.xarchitecture performs stricter validation and surfaces more granular error messages. Re-run your acceptance tests to confirm alarms, configuration status messages, and downlink acknowledgements behave as expected.
Troubleshooting tips
- If
adjustMeasuringRangethrows an “unknown channel” error, check the device documentation for the exact channel labels and ensure they match your case and spacing.
NPM package users
There are no 2.x.x parsers provided in the npm package. The migration from 3.x.x to 4.x.x is identical to the steps outlined above, except you import the parser from the package instead of using a prebuilt script. The package is shipped with typed definitions, so you get compile-time validation when calling the helpers. Take a look at the type issues provided there if you run into problems.
