YuDash JSON Configuration

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:

   "dotFourSettings": {
        "modBus": 1,
        "loopDelay": "15",
        "cloudServer": 10,
        "displayName": "Thingsboard_demo",
        "dpPerPacket": "16"
    },

In a simple manner, above settings signify that

  1. modBus : Modbus/RS485 is enabled and we need to read a modbus instrument as per settings in a block for modbus/RS485 protocol.

  2. loopDelay: YuDash IoT device will have a loop cycle of 15 seconds.

  3. cloudServer: data has to sent on a MQTT (10) broker as per provided MQTT settings.

  4. displayName: YuDash IoT on-device display with show "Thingsboard_demo".

  5. 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":{
      "modBus":1,
      "loopDelay":"15",
      "cloudServer":10,
      "displayName":"Thingsboard_demo",
      "dpPerPacket":"16",
      "debugFlag":0,
      "anaToDig":0,
      "useDefaultCloud":0,
      "snmp":0,
      "modBusTcp":0,
      "ethernet":0,
      "rms":0,
      "rmsStoreData":0,
      "rtc":0,
      "sdCard":0,
      "nfh":0,
      "dataScale":0,
      "nwFallback":"0",
      "modBus2":0,
      "tcpParse":0,
      "sensor":0,
      "modBusServer":0
   },

dotFourSettings parameters for Feature Enable/Disable

0 is disable (typically default) and 1 is enable.

JSON keyDescription

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