Digital IO Server is a simple SCPI server for Arduino Uno based devices that allows to control digital input and output pins over Ethernet. It uses the Vrekrer SCPI parser library to parse SCPI commands.
It is designed to be used with the Keyestudio 5500 board or Arduino Uno with Ethernet shield.
- control and query of digital inputs and outputs via Ethernet
- Configuration of networks settings (IP, gateway, subnet, port) via SCPI command
- Error handling and return via SCPI
- Non-volatile storage of network settings in EEPROM
- GPIO reset and device reboot via SCPI command
- Arduino Uno with Ethernet Shield (W5100/W5200/W5500)
- Keyestudio 5500 board
Digital inputs:
DIn0 = Pin 14
DIn1 = Pin 15
DIn2 = Pin 16
DIn3 = Pin 17
DIn4 = Pin 18
DIn5 = Pin 19
Digital outputs:
DOut0 = Pin 0
DOut1 = Pin 1
DOut2 = Pin 2
DOut3 = Pin 3
DOut4 = Pin 4
DOut5 = Pin 5
DOut6 = Pin 6
DOut7 = Pin 7
Command | Description |
---|---|
*IDN? |
Query device identification string |
*RST |
Resets and initializes all digital IOs |
SYSTem:ERRor? |
Queries and returns last device error |
SYSTem:REBoot |
Reboots the device |
SYSTem:LAN:CONFig? |
Queries and return actual netwirk configuration |
SYSTem:LAN:CONFig |
Set network configuration (IP, gateway, subnet, port) |
DigitalIn#? |
Queries and returns status of digital input pin |
DigitalOut# |
Set digital output pin |
DigitalOut#? |
Queries and returns status of digital output pin |
Examples:
DigitalIn0?
– Request status from digital input 0, pin 14DigitalOut3 HIGH
– Set digital output DOut3 to HIGH, pin 3SYSTem:LAN:CONFig 192.168.1.100,192.168.1.1,255.255.255.0,5025
– Set network configuration
DigitalIn<index>?
Queries the logic state of DigitalIn[index] pin
Return values are "HIGH" or "LOW"
Examples:
DigitalIn0? (Queries the state of digital input 0 pin)
DigitalIn5? (Queries the state of digital input 5 pin)
DigitalOut<index>?
Queries the logic state of DigitalOut[index] pin
Return values are "HIGH" or "LOW"
Examples:
DigitalOut4? (Queries the state of digital output 4 pin)
DigitalOut6? (This does nothing as digital output 6 does not exists)
DigitalOut<index> state
Sets the logic state of DigitalOut[index] pin
Valid states are : "HIGH", "LOW", "ON", "OFF", "1" and "0"
and any lowercase/uppercase combinations
Examples:
DigitalOut4 HIGH (Sets digital output 4 pin to HIGH)
DigitalOut2 Off (Sets digital output 2 pin to LOW)
DigitalOut0 1 (Sets digital output 0 pin to HIGH)
- 0: SCPI_Parser::ErrorCode::NoError
- 1: SCPI_Parser::ErrorCode::UnknownCommand
- 2: SCPI_Parser::ErrorCode::Timeout
- 3: SCPI_Parser::ErrorCode::BufferOverflow
- 4: SCPI_Parser::ErrorCode::InvalidParameter
The digital IO server can be controlled under Linux using netcat (nc).
Example:
~$ echo "SYST:LAN:CONF?" | nc 192.168.178.232 5025
192.168.178.232,192.168.178.1,255.255.255.0,5025
~$ echo "DigitalOut0?" | nc 192.168.178.232 5025
HIGH