How to manage IOs from CLI

You are here:
Estimated reading time: < 1 min

It is possible to manage the digital inputs/outputs of an E220 router from the CLI (Command Line Interface). Execute following steps to control the IOs of the router.

Enable Events service

Go to Services > Events and enable the service. Click Save & Apply after that to apply the new settings.

Read digital input status

Get SSH access to your unit and execute following command:

cat /sys/class/gpio/gpio<index>/value

<index> may be:

  • 30 for DI1
  • 31 for DI2

The value returned by the router may be:

  • 0 if DI is low
  • 1 if DI is high

Set digital output status

Execute following command to actuate on a digital output:

echo <value> > /sys/class/gpio/gpio<index>/value

<index> may be:

  • 32 for DO1
  • 62 for DO2

<value> can be:

  • 0 to open the DO
  • 1 to close the DO
Was this article helpful?
Dislike 0 2 of 2 found this article helpful.
Views: 198
Back to Top