JSON

Target Category: Arduino, Delfino, F280x, F281X, Generic MCU, Linux AMD64 and Raspberry Pi, Piccolo, STM32

Target Sub-Category: IoT

Blocks Sub-Category: Extensions > IoT

Description: The JSON block provides an encoding format for translating data into text strings that can be sent and received over the internet.

JSON is used in conjunction with the MQTT blocks to create JSON-formatted text. By using MQTT to send JSON-formatted text to <tbs>  mqttbroker.altairsmartcore.com, you can take advantage of Altair IoT Studio’s ability to trigger actions and activate rules that look at the data within the JSON data packet. Output from the JSON block is in the following format:

{“protocol”: “v2”, “checksum”: “”, “device”: “devicename@username.username”, “at”: “now”,“data”: {“Key”: Value}}

A screenshot of a computer error

Description automatically generated 

JSON Syntax Check: Validates the format of the JSON text string.

Key/Value Pairs: Indicates the number of Key/Value input pin pairs on the JSON block. The number you specify is reflected under the Key and Value parameters. Also, when you exit the dialog, the input pins on the block are updated accordingly. You cannot use the Add Connector and Remove Connector commands on JSON blocks.

Packet Byte Size: Specifies the maximum buffer size of the data string. Larger strings are truncated to the maximum buffer size.

Examples

See Examples > Blocks > Extensions > IoT > JSON.