Netgate SG-3100 LEDs
-
@stephenw10
I've been trying to get this to work, but I must be missing something.Used Command Prompt in the GUI.
gpioctl 2 duty 000
Set the blue flashing diamond led to zero brightness, which worked.
gpioctl 1 duty 050
Set the green diamond led to 50%, still flashing though.
Ran the command posted to switch led 1 to pwm-
sysctl dev.gpio.0.led.1.pwm=1dev.gpio.0.led.1.pwm: 0 -> 1
This isn't working though. LED 1 continues to flash. What did I get wrong here?
-
ThinkI found one mistake. Ran this command instead-
sysctl dev.gpio.0.led.1.pwm=1
Still didn't work though.
Here is the output from sysctl dev.gpio.0
dev.gpio.0.led.2.T2: 0 dev.gpio.0.led.2.DT: 0 dev.gpio.0.led.2.T1-T3: 520 dev.gpio.0.led.2.pwm: 0 dev.gpio.0.led.1.T2: 0 dev.gpio.0.led.1.DT: 0 dev.gpio.0.led.1.T1-T3: 520 dev.gpio.0.led.1.pwm: 1 dev.gpio.0.led.0.T2: 520 dev.gpio.0.led.0.DT: 0 dev.gpio.0.led.0.T1-T3: 1040 dev.gpio.0.led.0.pwm: 0 dev.gpio.0.pin.8.T4: 0 dev.gpio.0.pin.8.T0: 0 dev.gpio.0.pin.7.T4: 0 dev.gpio.0.pin.7.T0: 0 dev.gpio.0.pin.6.T4: 0 dev.gpio.0.pin.6.T0: 0 dev.gpio.0.pin.5.T4: 0 dev.gpio.0.pin.5.T0: 0 dev.gpio.0.pin.4.T4: 0 dev.gpio.0.pin.4.T0: 0 dev.gpio.0.pin.3.T4: 0 dev.gpio.0.pin.3.T0: 0 dev.gpio.0.pin.2.T4: 3640 dev.gpio.0.pin.2.T0: 0 dev.gpio.0.pin.1.T4: 0 dev.gpio.0.pin.1.T0: 0 dev.gpio.0.pin.0.T4: 0 dev.gpio.0.pin.0.T0: 0 dev.gpio.0.%parent: iicbus0 dev.gpio.0.%pnpinfo: name=is31fl3199 compat=issi,is31fl3199 dev.gpio.0.%location: addr=0xce dev.gpio.0.%driver: gpio dev.gpio.0.%desc: ISSI IS31FL3199 9 channel light effect LED driver
-
This thread on reddit has some useful information on the topic: https://www.reddit.com/r/PFSENSE/comments/8v1owa/need_help_configuring_internal_switch_vlan_and/
-
I notice that every once in a while (not sure the cause), the middle LED will go off (dark) on its own....
Is only the right-most LED being used by the pfSense hardware/software? Or which LEDs are OK for me to write a custom PHP script against?
-
@msf2000
All the LED’s will flash in sequence during boot. After the boot process is complete the right LED will pulse blue. If an update is available to the pfSense software the center LED will light up orange.
https://forum.netgate.com/topic/122407/netgate-sg-3100-leds/4If you do write a script, perhaps you would consider sharing it?
-
Sure. No promises that it actually works though. :)
-
Because my SG-3100 is out in the open the flashing blue LED is distracting, so I simply entered a cron entry to turn the LED off after 20 minutes post-startup.
*/20 * * * * root /usr/sbin/gpioctl 2 duty 0
-
I just set up my new SG-3100 and all seems to be working fine. The right side diamond LED slowly flashes. However when I go to Diagnostics - Halt System and the system shuts down, I lose my connection as expected but the LED continues to slow-blink. I was expecting it to shut off. Is this normal?
-
@tjsober said in Netgate SG-3100 LEDs:
I just set up my new SG-3100 and all seems to be working fine. The right side diamond LED slowly flashes. However when I go to Diagnostics - Halt System and the system shuts down, I lose my connection as expected but the LED continues to slow-blink. I was expecting it to shut off. Is this normal?
There is an issue we're addressing on 2.4.4 where the OS is not completely halting on shutdown that may be related. The fix is partially in snapshots now but should be completely done shortly.
-
I observe the same behavior of the last blue LED.... system shutdown does not stop the LED slow flashing. As a workround, i use ssh to shutdown if needed, which allows me to see when the OS is actually halted.
I agree with @tjsober that it would be helpful if the last blue LED went dark once the system was properly halted. Perhaps this is something the watchdog timer can do?
-
Got a working tcsh shell script. It updates the left LED to green, amber, red, or blue, depending on the gateway status of the WAN port. Should be easy to customize.
#!/bin/tcsh # # This script updates the SG-3100 device's first LED with gateway status # # php /usr/local/sbin/pfSsh.php playback gatewaystatus # set gw = `/usr/local/bin/php /usr/local/sbin/pfSsh.php playback gatewaystatus | grep WAN ` set gwping = `echo $gw | awk '{ ORS=" "; print $6 }' ` set gwstatus = `echo $gw | awk '{ ORS=" "; print $7 }' ` # based on gwstatus, set color of first LED # led a - led b - led c # 6 7 8 - 3 4 5 - 0 1 2 switch ($gwstatus) case "none": case "Online": /usr/sbin/gpioctl 6 duty 0 /usr/sbin/gpioctl 7 duty 128 /usr/sbin/gpioctl 8 duty 0 breaksw case "down": case "Offline": /usr/sbin/gpioctl 6 duty 128 /usr/sbin/gpioctl 7 duty 0 /usr/sbin/gpioctl 8 duty 0 breaksw case "highloss": case "loss": case "highdelay": case "delay": case "Warning": /usr/sbin/gpioctl 6 duty 128 /usr/sbin/gpioctl 7 duty 32 /usr/sbin/gpioctl 8 duty 0 breaksw default: /usr/sbin/gpioctl 6 duty 0 /usr/sbin/gpioctl 7 duty 0 /usr/sbin/gpioctl 8 duty 128 endsw
-
@msf2000 said in Netgate SG-3100 LEDs:
@wgstarks
Got a working tcsh shell script.How/where should I install this? Needs to run at boot I'm guessing?
-
Yes, upload the shell script as a file. (Root's home directory is fine.) Then, install the "Cron" package. Add the shell script as a cron job to run every minute.
-
@msf2000
Thanks. Looks like it's working. -
@wgstarks It would be great if the lights could serve 2 purposes:
(1) show boot status during a power-on or reboot (like they do now)
(2) show network activity on 3 network segments the rest of the time (WAN, LAN, OPT1)If #2 was implemented, a glance at the firewall would tell us a lot about what's going on. It would be greatly appreciated.
-
@dpasadis said in Netgate SG-3100 LEDs:
@wgstarks It would be great if the lights could serve 2 purposes:
(1) show boot status during a power-on or reboot (like they do now)
(2) show network activity on 3 network segments the rest of the time (WAN, LAN, OPT1)If #2 was implemented, a glance at the firewall would tell us a lot about what's going on. It would be greatly appreciated.
This isn’t my code. It was provided by @msf2000.
-
- You could install the "ShellCmd" package and have the LED script run on bootup, if you'd like.
- Just rotate the device 180 degrees, and you'll see the network traffic. ;)
The script I wrote was more for users to see that the firewall is working, instead of power-cycling the pfsense unnecessarily when their internet is slow.
-
Thanks msf2000. I appreciate your contribution.
I like your first suggestion (and your second for different reasons).
I've done a lot of work on operating systems, including Unix/Linux, so I might be able to figure out #1 without spending a crazy amount of time on it. If I get a good result, I'll share it here.
-
Cool thread!
-
I wrote some more comprehensive documentation on my blog, which explains the timings in more depth. https://www.zacharyschneider.ca/blog/post/2019/12/customizing-leds-netgate-sg-3100
Hope it helps!