How to mirror the blue LED light on the onion omega 2s+ pro board to a GPIO controlled LED light
-
Hello,
I am trying to mirror the blue wifi LED light on the onion omega 2s+ pro board to a GPIO number to create a duplicate wifi indicator LED. Ultimately, I am trying to light the Blue LED that is wired to the GPIO when wifi is connected.
I tried using GPIO44 in a python script but was not successful.
Thank you!
-
@Antony Take a look at /etc/hotplug.d/00-netstate, you can use hotplug to execute commands on state change for the wwan interface. Below is a sample of a script I used to update the listen iterface for nginx web server, when the wwan interface connected to wifi, you could update it for the action ifdown:
echo "Starting interace hotplug ${DEVICE} Action: ${ACTION} Interface: ${INTERFACE}" >> /tmp/cblog
if [ "$ACTION" = "ifup" -a "$INTERFACE" = "wwan" ]; then
echo "IFUP ${DEVICE}" >> /tmp/cblog
echo "Run ip setup script for device: ${DEVICE}" >> /tmp/cblog
echo "listen $(ip -o -4 a s apcli0 | awk '{ print $4 }' | cut -d/ -f1):80;" > /etc/nginx/listen_ip
fi