set gpio
Purpose
Configure General Purpose I/O (GPIO) pins and displays current GPIO pin settings. In normal operation, the GPIO pins are used for the serial CTS, DCD, DSR, DTR, and RTS pins. set gpio allows you to use these GPIO pins for different purposes.
Default serial signal settings for GPIO pins
The default serial signal settings for the GPIO pins on a Digi device are as follows. Depending on the device, there are five or nine GPIO pins.
Pin Number |
Default Serial Signal |
Signal Direction |
GPIO 1 |
DCD |
Input |
GPIO 2 |
CTS |
Input |
GPIO 3 |
DSR |
Input |
GPIO 4 |
RTS |
Output |
GPIO 5 |
DTR |
Output |
GPIO 6 |
TXD |
Output |
GPIO 7 |
RXD |
Input |
GPIO 8 |
TXD for port 2 |
Output |
GPIO 9 |
RXD for port 2 |
Input |
Required permissions
For Digi products with two or more users, permissions must be set to set permissions s-gpio=read to display GPIO pin settings, and set permissions s‑ethernet=rw to display and configure GPIO pins. See set permissions for details on setting user permissions for commands.
Syntax
Configure GPIO pins
set gpio range={1-n} mode={serial|input|output}
Display current GPIO pin settings
set gpio [range={1-n}]
Options
range={1-n}
Used to specify the index of the GPIO pin to manipulate, where n is the maximum number of GPIO pins on the device.
mode={serial|input|output}
The mode of operation of the GPIO serial pin.
serial
input
Allows input of GPIO signals. This is used in conjunction with alarms to trigger emails or SNMP traps indicating a particular signal change.
output
Allows output of GPIO signals. Currently, output of GPIO signals is not supported in the command-line interface. The web interface can be used to toggle the output of GPIO signals between high and low.
The default is serial for all GPIO pins.
Examples
Changing the operation of the GPIO signal pins
The following command changes GPIO pins 1-5 to allow input of GPIO signals.
#> set gpio range=1-5 mode=input
See also
- display gpio
- revert. The revert gpio command reverts the settings configured by this command.
- send for details on setting up alarms that issue email messages or SNMP traps when GPIO pins change.
- set alarm to set alarms based on GPIO pin state changes.
- show: The show gpio command shows the current GPIO pin settings in a Digi device.