Nodes Communication Protocol

Operations

Operation Description
IDENTIFICATION The CONTROLLER sends an auto-identification command to all remote nodes. Remote nodes reply each with its own ID after a waiting time in seconds, from the command receipt, equal to double of its own ID number
CONFIGURATION The CONTROLLER sends a configuration message to each individual node about configurable items either global to the system or specific to the node. Remote nodes acknowledge the config message with an ACK response
QUERY The CONTROLLER queries a single remote node for all available measures. The remote node replies with a sequence of values
ERROR The remote nodes indicates an error to the CONTROLLER

Message Format

General Format

<MESSAGE_START><SENDER><DEST><MESSAGE_TYPE>[<DATA>]<MESSAGE_END>

The <DATA> section is optional.

Format Specification

Field Description
SENDER Fixed length 3 decimal digits: CTRL = 001; NODES = ID
DEST Fixed length 3 decimal digits: CTRL = 001; NODES = ID; Broadcast=000
MESSAGE TYPE Fixed length 6 characters
IDENTIFICATION = "IDNREQ"
IDENTIFICATION REPLY = "IDRESP"
CONFIGURATION = "CONFIG"
CONFIGURATION ACKNOWLEDGE = "CFGACK"
QUERY MEASURES = "QRYMSR"
REPLY TO QUERY MEASURES = "QRYRES"
ERRORE INDICATION = "SERROR"
DATA: MEASURES SEQUENCE <SOURCE ID><RAW VALUE><SEPARATOR>
SOURCE ID Fixed length 2 decimal digits: from 00 to 03 : analog sensors values; From 04 to 11 : digital sensors values; 20 : local battery voltage level
RAW VALUE Variable length: actual integer value read from the digital sensor or from the A/D conversion of the correspondent analog sensor.
Includes also the voltage level read from the local battery.
DATA: CONFIGURATION ITEMS <CFG ITEM ID><SETTING><SEPARATOR>
CFG ITEM ID Fixed length 2 characters:
TG : Time granularity in minutes
SEPARATOR ':' between ID-VALUE pairs
START and END MESSAGE '#'

Note: Data transfer uses '''128 chars ASCII table''' (1 byte per character).

Messages

Message Direction Example
IDNREQ CTRL -> Broadcast #001000IDNREQ#
IDRESP NODE -> CTRL #002001IDRESP#
CONFIG CTRL -> NODE #001002CONFIGTG5#
CFGACK NODE -> CTRL #002001CFGACK#
QRYMSR CTRL -> NODE #001002QRYMSR#
QRYRES NODE -> CTRL #002001QRYRES0421:0555:20654#
SERROR NODE -> CTRL #002001SERROR01#

Copy-left owner: Alberto Trentadue - 2016

"ClEnSensors" is Free Software Licensed GPLv3


Pages

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License