An open API service indexing awesome lists of open source software.

https://github.com/mictronics/digital-io-server

Digital IO Server is a simple SCPI server for Arduino boards that allows to control digital input and output pins over Ethernet. Works with boards like Keyestudio 5500 or Arduino Uno with Ethernet shield.
https://github.com/mictronics/digital-io-server

5500 arduino ethernet keyestudio scpi server uno

Last synced: 3 months ago
JSON representation

Digital IO Server is a simple SCPI server for Arduino boards that allows to control digital input and output pins over Ethernet. Works with boards like Keyestudio 5500 or Arduino Uno with Ethernet shield.

Awesome Lists containing this project

README

          

# Digital IO Server

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](https://www.keyestudio.com/keyestudio-w5500-ethernet-development-board-for-arduino-diy-project-without-poe-p0368.html) board or [Arduino Uno](https://docs.arduino.cc/hardware/uno-rev3-smd/) with [Ethernet shield](https://docs.arduino.cc/hardware/ethernet-shield-rev2/).

## Features

- 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

## Hardware

- Arduino Uno with Ethernet Shield (W5100/W5200/W5500)
- Keyestudio 5500 board

## Pin assignment

**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

## SCPI commands

| 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 14
- `DigitalOut3 HIGH` – Set digital output DOut3 to HIGH, pin 3
- `SYSTem:LAN:CONFig 192.168.1.100,192.168.1.1,255.255.255.0,5025` – Set network configuration

```
DigitalIn?
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?
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 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)
```

## Error codes

- 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

## Linux usage

The digital IO server can be controlled under Linux using netcat (nc).

Example:

```bash
~$ 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
```