Javascript payload formatters allow you to write your own functions to encode or decode messages. Javascript functions are executed using an JavaScript ECMAScript 5.1 engine.
Payload formatters use ECMAScript 5 (2009), which has some distinct differences compared to newer, commonly used ECMAScript revisions. See here for a quick comparison. Notably, let
, const
, and arrow functions are not supported by ES5.
The payload formatters should be simple and lightweight.
There are three different types of Qubitro JavaScript payload formatters:
The payload formatters should be simple and lightweight.
Read the documentations to further learn about these formatters and find associated examples.
If you have further questions or suggestions, feel free to join -> Qubitro Community Discord via this invitation link.
The encodeDownlink()
function is called when a downlink message, with a payload in JSON format, is scheduled to be sent to the end device. The encodeDownlink()
function encodes the JSON object of the downlink message to binary payload that gets transmitted to the end device.
Downlink Encoder feature will be available soon in Qubitro Portal.
If you have further questions or suggestions, feel free to join -> Qubitro Community Discord via this invitation link.
The Javascript decodeUplink()
function is called when a data uplink message is received from a device. This function decodes the binary payload received from the end device to a human-readable JSON object that gets send upstream to the application.
The returned value must be a JSON object with the 'data' key and the function name must be 'decodeUplink' with a single parameter.
You only need these two requirements to make possible proper no-code integration. You can automatically synchronize the sensor values and other platform-specific information to visualize on .
An example function:
If you have further questions or suggestions, feel free to join -> Qubitro Community Discord via this .
The decodeDownlink()
function is called to decode a downlink message to JSON format, if it was scheduled with payload as bytes, or if it was scheduled with human-readable JSON payload but also was encoded with the encodeDownlink()
function.
Downlink messages sent upstream as part of events or downlink queue operations are therefore decoded, just like uplink messages (see Uplink Decoder).
Downlink Decoder feature will be available soon in Qubitro Portal.
If you have further questions or suggestions, feel free to join -> Qubitro Community Discord via this invitation link.
You can find some examples for utilizing features and working with data.
Once the payload formatter is set up correctly, it is possible to utilize all Qubitro features, including visualizing data and building custom applications with Qubitro APIs and make your life much more easier.
You can easily visualize your data with our widgets from the Monitoring section on the left side of our portal or under the Analytics tab in your project. Multiple charts are also can be added under a specific device.
Also, you can quickly filter your data by clicking the calendar under Data or Analytics.
It is possible to utilize Qubitro APIs for various scenarios. Visit API documentation below to learn more.
If you have further questions or suggestions, feel free to join -> Qubitro Community Discord via this invitation link.