JSON Configuration API
YuDash IoT devices have simple, yet innovative JSON based configuration mechanism. Effectively, all settings in configuration UI can also be done by simple editing of .json files.
Basic understanding of JSON syntax and format is required. JSON is primarily an hierarchical, key-value pair structure.
While making any changes, please validate the syntax before saving the file. jsonlint is a cool online JSON validator
YuDash Configuration JSON: lynx.json
This is main configuration file to control all functionality of IoT device. The file is typically internally stored lynx.json (for all devices) and downloaded to laptop with same name.
It contains various JSON blocks which are parsed by YuDash IoT devices. Each block has a unique key (name) under which all relevant information will contain.
dotFourSettings is primary block which controls most of top level functionality.
In most of cases, presence of a given configuration settings does not enable a given feature. It has to be enabled (or disabled) using a flag in dotFourSettings (or applicable) block..
The network settings (WiFi/4G/Ethernet) is not part of lynx.json. It has to be configured from YuDash configuration UI only.
dotFourSettings
This is primary block of YuDash IoT devices which defines the feature (enable/disable) or configuration (enable/disable, numerical value). Minimal dotFourSettings example:
In a simple manner, above settings signify that
modBus : Modbus/RS485 is enabled and we need to read a modbus instrument as per settings in a block for modbus/RS485 protocol.
loopDelay: YuDash IoT device will have a loop cycle of 15 seconds.
cloudServer: data has to sent on a MQTT (10) broker as per provided MQTT settings.
displayName: YuDash IoT on-device display with show "Thingsboard_demo".
dpPerPacket: is a configurable parameter which is set to 16.
Most of the parameters are optional in nature with a default value. During downloading of a configuration from YuDash IoT device, the configuration engine auto-generates default values in json. For example, above file will be converted to below when downloaded from YuDash IoT device:
dotFourSettings parameters for Feature Enable/Disable
0 is disable (typically default) and 1 is enable.
modBus
Read Modbus RS485 instruments. Blocks of modBusSettings and modBusSlaves defines protocol settings.
analToDig
Analog to Digital converter
snmp
Read SNMP data.
modBusTcp
Read Modbus TCP.
rtc
Run Inbuilt RTC
sdCard
Enable SD card.
nfh
Enable Network Failure Handler
debugFlag
Enable internal debug messaging of device. Enabling this flag slows down the IoT device. Keep it 0 for production runs.
useDefaultCloud
Use default cloud settings provided by YuDash. This is applicable for devices bundled with YuDash cloud features.
modBus2
Read 2nd channel of Modbus RS485. This is applicable for custom devices where dual channel RS485 is supported.
Last updated