Accessing the System
20NM50-00 E2
2016-05-17
Page 44
Figure 24.
LuCI configuration to blink the fault LED
3.4.3
Discrete I/O
The NM50 provides one Discrete Input and one Discrete Output at the X10 connector.
The Discrete I/O can be controlled from the CLI.
»
Get state of Discrete Input:
»
Switch Discrete Output:
root@OpenWrt:/#
echo
504
>
/sys/class/gpio/export
root@OpenWrt:/#
cat
/sys/class/gpio/gpio504/value
returns 0 if IN_P=High
returns 1 if IN_P=GND
root@OpenWrt:/#
echo
508
>
/sys/class/gpio/export
root@OpenWrt:/#
echo
out
>
/sys/class/gpio/gpio508/direction
root@OpenWrt:/#
echo
0
>
/sys/class/gpio/gpio508/value
root@OpenWrt:/#
echo
1
>
/sys/class/gpio/gpio508/value
echo 0: connect OUT_P to OUT_N
echo 1: disconnect OUT_P from OUT_N