Netgate SG-3100 LEDs
- 
 @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! 
- 
 I took some of the information in this article and wrote a script that sets the LED colors based on network interface state and bandwidth usage. 
- 
 @jchonchi Sounds useful. Does the script work as intended? I'm a complete moron when it comes to coding, so my risk tolerance is near zero. 
- 
 @jchonchi i am using the script, works like charm. Thanks 
- 
 Very helpful thread. I re-wrote msf2000s script as a sh script and generalized it a bit. I use the left (circult) and middle (square) LEDs to monitor my two WAN connections. I also toned it down a bit so I don't need sunblock. You can find it here 
- 
 @msf2000 This was working for a long time in 2.4.5 -- but doesn't seem to anymore in 21.02. 
- 
 @bldnightowl said in Netgate SG-3100 LEDs: @msf2000 This was working for a long time in 2.4.5 -- but doesn't seem to anymore in 21.02. After reading the release notes I’m guessing this is the reason- Several abandoned and deprecated packages have been removed, including: OpenBGPD (use FRR instead) Quagga OSPF (use FRR instead) routed blinkled gwled
- 
 @bldnightowl 
 What the crap is NetGate doing with version numbers? Breaking their own products? I don't plan to update past 2.4.5. Guess I'll read up on what's going on later.As for my script, sorry, you are probably on your own if you upgrade to v21. 
- 
 @bldnightowl Check that you're using the right GPIO device: sysctl dev.gpio | grep .led.When I upgraded to 21.02/2.5, the GPIO device changed from 0to2on my SG-3100.@wgstarks The blinkledandgwledpackages aren't needed for the SG-3100 LED driver, those are for controlling the LEDs on ALIX and WRAP platforms.
- 
 @z4xh What is the relationship between the output of that command to the numbers I provide to gpioctl? I'll update my script to make use of that and test it on 2.4.5 while they figure out the issues with 21.02. Thanks. Jeff 
- 
 @jchonig This github commit explains it best: https://github.com/justdaniel-gh/sg3100customleds/commit/ddbf412cb1cf3ba32160972e2177c356611ff57f 
- 
 The probe order of the GPIO devices changed in the newer version of FreeBSD since more of the on-board devices are supported now. It wasn't intentionally moved or anything. 
- 
 Yes, it looks like the script doesn't set the gpio device so it defaults to using device 0 which is no longer valid. You need to set gpioctl to use /dev/gpioc2, for example: /usr/sbin/gpioctl -f /dev/gpioc2 6 duty 0Steve 
- 
 
- 
 I've updated my script for the gatewaystatus returned by pfSense+ 21.05 and to allow the specification of the gateways to monitor on the command line. It's no longer necessary to edit the script. In my case the cron command looks like: /root/gw_leds -v -a WAN_OTTC_DHCP -b WAN_EA_DHCPWhich means that LED a (left-most) monitors WAN_OTTC_DHCP gateway and LED b (middle) monitor WAN_EA_DHCP gateway. 
- 
 I bit more hacking on the script today. I made it more modular. I disable PWM mode on any LEDs we are using which disables the slow blink. Maybe I should make that configurable. I also added -A, -B and -C options to set a fixed color for a given LED give a list of 3 comma-separated numbers. Mostly for testing. Off to do non-computer stuff on a Saturday. 





