Protocol Specifications
A lot of the projects created here need to communicate with each other, or with other devices.
In order to do this I wanted to implement a standardised communications protocol. Hence any item that is designed here at re-innovation can interface with other items seamlessly.
I decided to base my communications protocol on the Lightweight Logical Automation Protocol (LLAP) from OpenMicros. This was an open format which is simple, easy to implement and human-readable.
NOTE: This page has been retired! More up to date information is available here: https://www.re-innovation.co.uk/docs/led-matrix-library/
The protocol used here is based upon the Lightweight Logical Automation Protocol (LLAP) from OpenMicros.
This is a 12 character message which includes a start character, a device ID and the data in the format:
<start> <ID> <Data>
The start character is ‘a’, the device ID can be any two alphanumeric chars and the message must be contained within 9 chars.
Additional parameters
In addition to the LLAP list already created, I needed to add a number of bespoke messages, which are listed and explained here. I am trying to ensure that all devices created here ustilise this protocol, then I can work to this standard and ensure that all the devices can ‘speak’ to each other.
Note: In these examples I am using “XX” to signify the device ID and “DDD” to signify any data.
Power
“aXXPDDDD—-“
This is a power output in the range 0000W to 9999W.
Voltage
“aXXVDDD—–“
This is the voltage in 100’s of milliVolts. For example: 0.6V Data = 006 and 24.7V Data= 24. Voltage can be in the range of 0-99.9V
Current
“aXXIDDDD—-“
This is the voltage and current output (V is 00.0 to 99.9V DC) (I is 00.00A to 99.99A). This will be an output approximately every second.
Energy
“aXXEDDDDDD–“
This is the Energy from 0000.00Wh to 9999.99Wh (10kWh – is this enough?)
Max power and average power are done by the receiving device. This will be an output approximately every second.
Time
T??????E
This will change the time to HHMMSS
Date
D??????E
This will change the date to DDMMYY
Sample period
S?????E
This will change the sample period to ????? seconds. Set to 00001 for 1 second data, set to 03600 for 1 hour data.
The minimum is 1 second data. The maximum is 99999 seconds
Device ID
Each device has an ID number which can be changed. This means more than one pedalog device can be used on a system.
“aXXCHIDXXE–“
Where the last two values (XX) are the new device ID (from AA to ZZ).
Current Shunt Value
There is a current shunt in the device. This is a very low value resistance which has a voltage drop which is proportional to the current flowing. This is measured on the high side.
The equation for converting from the mOhm value to the current is:
****TO DO****
To change this we use the command:
“aXXISHDDDDE-“
Where the value DDDDD is the resistance in tenths of a milliOhms (eg 50 = 5milliohm)
To read the value from the device we can ask the command:
“aXXISH?—–“
Voltage Set-Point
The voltage regulation set-point controls when the shunt load will switch on. The device will try (as much as possible) to maintain the voltage at this point. Proportional –Integral (PI) control is used to do this.
“aXXVSPDDDE—“
This sends the command to device DD. The set-point (VSP) is DD.D volts. This is a value from 00.0V to 40.0V (maximum input voltage is 40V DC).
To ask the set-point we can send:
“aXXVSP?—–“
***Note: Problems with using this on a XRF? Will the two conflict?***
Data reference
You can adjust the parameters of the device using serial commands. These parameters are stored in EEPROM.
These are:
R??E
This will change the reference number to ??
Known issues
This is quite a difficult task to achieve without some problems.