This is the default firmware for the Andino X1 board. It can count impulses from the digital inputs, display the input states, switch or pulse relays and read temperature data from DS18B20 temperature sensors. Count stops are cyclically sent to the Raspberry. The digital inputs are additionally de-bounced.

This firmware and its correct configuration is also a prerequisite for using the Andino X1 Node-Red node to integrate digital inputs, temperature data and relay control into Node-Red flows.

The Communication runs with 38400 Baud.


x1_expansion

The firmware of the Andino X1 already comes pre-installed with every sold board. However, if you want to update the firmware at a later date, you can also flash the firmware yourself.

To install the firmware, first install and configure the Arduino IDE on your PC as described here. Afterwards, download the INO-File of the most recent version from GitHub (see download section at the bottom) and open it in the IDE. When prompted, accept to create a folder with the same name as the INO file. This Sample also needs the TimerOne, OneWire and DallasTemperature libraries. To install those, click Tools, then Manage Libraries. Here, search for TimerOne and hit install on the library with the same name. Repeat the same process for the other two libraries. After checking that the firmware compiles correctly by clicking Verify (the checkmark button) in the top bar, the firmware can be uploaded by hitting Upload (the arrow to the right).

For the hardware installation instructions of the DS18B20 sensors (if you choose to use them), please refer to this hardware installation guide.

It is now recommended not to interface with the Andino X1 firmware directly, but rather use the Andinopy TCP functionality. This allows for more flexibility and ensures the same commands are working on all Andino products.

All commands or messages are sent and received via /dev/ttyS0. Every command has to be terminated by CR or LF. Message ends with CR and LF.

Command Arguments Action Example
RESET none Restart the Controller RESET
INFO none Prints the current settings INFO
HARD 0=noShield, 1=1DI2DO, 2=3DI, 3=5DI, 4=DS18B20 Set the Hardware configuration HARD 4
POLL Cycle in ms Sets the sampling cycle of the digital inputs [in ms] POLL 1000
SKIP Number of polls Skip n Scans after pulse reconized 0
EDGE HL(0) LH(1) Count on edge HL or LH EDGE
SEND Cycle in ms The counter will send all nnn milliseconds SEND 5000
SENDT Cycle in ms The counter will poll and send the busses every nnnn milliseconds SENDT 8000
CHNG Send on Change Send if any Pin changes. Carefull if many changes CHNG 1
CNTR Send Counter Send counter+states(1) or only states(0) (default 1) CNTR 0
DEBO Number of polls Sets the debounce count. The signal has to be stable for nn polls DEBO 100
POWR state (0 or 1) Power-Out Relay is switched on or off REL1 1
REL? on-off (0 or 1) Send the current state of the Relays
REL1 state (0 or 1) Relay 1 is switched on or off REL1 1
REL2 state (0 or 1) Relay 2 is switched on or off REL2 1
REL3 state (0 or 1) Relay 3 is switched on or off REL3 1
REL4 state (0 or 1) Relay 4 is switched on or off REL4 1
RPU1 pulse in sec Pulse the Relay 1 for nns seconds RPU1 2
RPU2 pulse in sec Pulse the Relay 2 for nns seconds RPU2 2
TBUS 1=one bus, 2=2 busses Sets the number of temperature sensor busses to 1 or 2 TBUS 2
ADDRT 1=bus1, 2=bus2 displays the addresses of all sensors connected to the specified bus ADDRT 1

:Message-ID{counter1,counter2,..}{state1,state2}

The Message starts with a ':'. After that follows a Message-ID. This is a modulo HEX Counter from 0..FFFF.
Then within a '{' '}' the counter follows. The number of counter depends on the Hardware shields.
The Counter are HEX encoded and runs from 0 to FFFF (modulo).
Then again within a '{' '}' the current state of the inputs follows. 0-off, 1-on.
If the Setting REL? = 1 then a third '{' '}' follows with the current state of the relays
The number depends on the Hardware shields. The Message ends with a CR / LF [0x0d + 0x0a]

Example:

:0040{0002,0000,000B}{0,0,0}  
:0041{0002,0000,000B}{0,0,0}  
:0042{0004,0000,000C}{0,0,0}  
:0043{0004,0000,000C}{0,0,0}  
:0044{0008,0000,000F}{0,0,1}  

or if REL? 1:

:0045{0008,0000,000F}{0,0,1}{0,1} 
:0046{000A,0000,0000}{0,0,1}{0,1}  
:0047{000C,0000,0000}{1,0,0}{0,1}   
:0048{0010,0000,0000}{0,0,0}{0,1}  

!Message-ID{Bus-Nr}{TemperatureSensor1,TemperatureSensor2,...}

Temperature sensor messages always start with an exclamation mark ( ! ), followed by the message ID. Like for the input messages, this ID is displayed in HEX format and iterated with every received message. This is then followed by the bus number in { }. After that, the temperatures are displayed in the next section. They are displayed in °C, with two decimal places and delimited by a comma.

Example:

!008D{1}{22.00,21.25}
!008E{1}{22.31,21.56}
!008F{1}{22.56,21.88}
!0090{1}{22.88,22.25}
!0091{1}{23.13,22.56}
!0092{1}{23.56,23.00}
!0093{1}{24.00,23.50}

or if TBUS 2:

!0173{1}{21.81,21.19}
!0173{2}{20.75}
!0174{1}{22.13,21.63}
!0174{2}{20.75}
!0175{1}{22.44,22.13}
!0175{2}{21.25}
!0176{1}{22.88,22.69}
!0176{2}{23.00}
!0177{1}{23.25,23.19}
!0177{2}{23.50}
!0178{1}{23.63,23.69}

?{1}{0*28-78-8D-51-1D-19-01-05}{1*28-49-2C-70-53-59-11-C6}

The temperature sensor addresses connected to a certain bus are displayed in {}. First, the index of the sensor is noted, followed by a * and the address in HEX format afterwards.

Latest Version: Version007.ino (210107)

For older versions and changelog, visit our GitHub repository.