• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Netgate 2100 Customization of LEDs (Guide)

Hardware
2
37
2.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JonathanLee @wgstarks
    last edited by Jul 18, 2024, 6:59 PM

    @wgstarks That's the DNS yes if the gateway went offline I am sure that state would no longer exist. Try that unplug wan for 10 mins see if it glows red plug it v=back in wait ten mins see if it normalizes. Great idea

    W 1 Reply Last reply Jul 18, 2024, 7:11 PM Reply Quote 0
    • W
      wgstarks @JonathanLee
      last edited by Jul 18, 2024, 7:11 PM

      @JonathanLee
      Do you know what the factory default is for the “or else”?

      Box: SG-4200

      J 1 Reply Last reply Jul 18, 2024, 7:29 PM Reply Quote 0
      • J
        JonathanLee @wgstarks
        last edited by JonathanLee Jul 18, 2024, 7:32 PM Jul 18, 2024, 7:29 PM

        @wgstarks

        I think it is very close too..

        sysctl -q dev.gpio.2.led.2.pwm=0
        gpioctl -f /dev/gpioc2 8 duty  30 >/dev/null
        

        it pulses blue like that... I never used the default once I went to custom blinking light mode

        Remember you have to disable the others before you change it back with

        sysctl -q dev.gpio.2.led.0.pwm=1
          gpioctl -f /dev/gpioc2 0 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 1 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 2 duty 0 >/dev/null
          sysctl -q dev.gpio.2.led.1.pwm=1
          gpioctl -f /dev/gpioc2 3 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 4 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 5 duty 0 >/dev/null
          sysctl -q dev.gpio.2.led.2.pwm=1
          gpioctl -f /dev/gpioc2 6 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 7 duty 0 >/dev/null
          gpioctl -f /dev/gpioc2 8 duty 0 >/dev/null
        

        This would be like a reset turns them all off..

        W 1 Reply Last reply Jul 18, 2024, 7:34 PM Reply Quote 0
        • W
          wgstarks @JonathanLee
          last edited by Jul 18, 2024, 7:34 PM

          @JonathanLee
          Thanks. Might be simpler to just set it to red and green. I never remember what the default patterns mean anyway.😁

          Box: SG-4200

          J 1 Reply Last reply Jul 18, 2024, 7:36 PM Reply Quote 0
          • J
            JonathanLee @wgstarks
            last edited by Jul 18, 2024, 7:36 PM

            @wgstarks One other item with the custom LEDs you will not see the firmware LED program run so I added a email alert for updates program with it that another user shared on Netgate...

            https://forum.netgate.com/topic/137707/auto-update-check-checks-for-updates-to-base-system-packages-and-sends-email-alerts/

            That way you still get a alert that you have updates without the Orange LED

            1 Reply Last reply Reply Quote 0
            • W
              wgstarks
              last edited by Jul 18, 2024, 9:04 PM

              Thanks. Have had that installed for a while.

              Box: SG-4200

              1 Reply Last reply Reply Quote 1
              • J JonathanLee referenced this topic on Jul 18, 2024, 9:09 PM
              • J
                JonathanLee
                last edited by JonathanLee Jul 18, 2024, 9:24 PM Jul 18, 2024, 9:17 PM

                @stephenw10 Can you please help me?
                Where is the standard led program in pfSense filesystem located it would be easier to just call that program if the gateway is up for @wgstarks request. He wants to normalize the LED behavior if the gateway is up. I could just set the scrip to call that program if needed. /dev/led is not listed in 2100 file system

                1 Reply Last reply Reply Quote 0
                • J
                  JonathanLee
                  last edited by JonathanLee Jul 18, 2024, 9:33 PM Jul 18, 2024, 9:30 PM

                  @wgstarks

                  To normalize it call this program originally sets bootup conditions, I am searching for the file it calls

                  /usr/local/sbin/pfSense-led.sh

                  1 Reply Last reply Reply Quote 0
                  • J
                    JonathanLee
                    last edited by JonathanLee Jul 18, 2024, 9:41 PM Jul 18, 2024, 9:38 PM

                    @wgstarks

                    set the program to call

                    /usr/local/sbin/pfSense-led.sh ready
                    

                    Use that for the else condition that would normalize it automatically for your model

                    🔒 Log in to view

                    1 Reply Last reply Reply Quote 0
                    • W
                      wgstarks
                      last edited by Jul 18, 2024, 9:59 PM

                      Thanks. I’ll test this and see if I can get it working.

                      Box: SG-4200

                      J 1 Reply Last reply Jul 18, 2024, 10:30 PM Reply Quote 1
                      • J
                        JonathanLee @wgstarks
                        last edited by JonathanLee Jul 18, 2024, 10:52 PM Jul 18, 2024, 10:30 PM

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • J
                          JonathanLee
                          last edited by JonathanLee Jul 18, 2024, 11:07 PM Jul 18, 2024, 10:57 PM

                          I got it don't use DNS use the interfaces name and pinger

                          pfctl -vvss | grep -e "mvneta0 icmp"

                          that works!!!

                          #!/bin/sh
                          led_intensity=0
                          while [ $led_intensity -le 8 ]; do
                            gpioctl -f /dev/gpioc2 $led_intensity duty 0 >/dev/null
                            led_intensity=$(( led_intensity + 1 ))
                          done
                          
                          check_current_states=$( pfctl -vvss | grep -e "mvneta0 icmp" )
                          WAN=0
                          case "$check_current_states" in
                            *icmp* ) WAN=1 ;;
                          esac
                          if [ $WAN = 0 ];
                          then
                           sysctl -q dev.gpio.2.led.0.pwm=0
                           gpioctl -f /dev/gpioc2 0 duty 200 >/dev/null
                           sysctl -q dev.gpio.2.led.1.pwm=0
                           gpioctl -f /dev/gpioc2 3 duty 200 >/dev/null
                           sysctl -q dev.gpio.2.led.2.pwm=0
                           gpioctl -f /dev/gpioc2 6 duty 200 >/dev/null
                          else
                            /usr/local/sbin/pfSense-led.sh ready
                          
                          fi
                          
                          

                          🔒 Log in to view

                          Your mvneta0 might be different over the 2100 check it on Interface Assignments, that is the pinger state used to check to see if gateway is up just use it for the program also

                          YEAH!!

                          Just updated after testing 4:07 7-18-24

                          1 Reply Last reply Reply Quote 0
                          • J
                            JonathanLee
                            last edited by Jul 18, 2024, 11:21 PM

                            Update to mine to reflect the gateway offline

                            #!/bin/sh
                            check_current_states=$( pfctl -vvss | grep -e ', rule 105' -e ', rule 52' -e '192.168.1.11' -e '192.168.1.15' -e 'mvneta0 icmp' )
                            res=1
                            resb=1
                            resc=1
                            resd=1
                            WAN=1
                            case "$check_current_states" in
                              *icmp* ) WAN=0 ;;
                            esac
                            if [ $WAN = 1 ];
                            then
                             sysctl -q dev.gpio.2.led.0.pwm=0
                             gpioctl -f /dev/gpioc2 0 duty 200 >/dev/null
                             sysctl -q dev.gpio.2.led.1.pwm=0
                             gpioctl -f /dev/gpioc2 3 duty 200 >/dev/null
                             sysctl -q dev.gpio.2.led.2.pwm=0
                             gpioctl -f /dev/gpioc2 6 duty 200 >/dev/null
                             exit 1
                             fi
                            case "$check_current_states" in 
                              *", rule 105"* ) res=0 ;;
                            esac
                            case "$check_current_states" in
                              *192.168.1.11* ) resb=0 ;;
                            esac
                            case "$check_current_states" in
                              *192.168.1.15* ) resc=0 ;;
                            esac
                            case "$check_current_states" in
                              *", rule 52"* ) resd=0 ;;
                            esac
                            if [ $res = 0 ] && [ $resb = 0 ]; 
                            then
                              sysctl -q dev.gpio.2.led.1.pwm=1
                              gpioctl -f /dev/gpioc2 3 duty 50 >/dev/null
                              gpioctl -f /dev/gpioc2 4 duty 15 >/dev/null
                              sysctl -q dev.gpio.2.led.2.pwm=0
                              gpioctl -f /dev/gpioc2 6 duty 55 >/dev/null
                              gpioctl -f /dev/gpioc2 7 duty 20 >/dev/null
                              gpioctl -f /dev/gpioc2 8 duty 15 >/dev/null
                            elif [ $res = 0 ];
                            then
                              sysctl -q dev.gpio.2.led.1.pwm=1
                              gpioctl -f /dev/gpioc2 3 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 4 duty 0 >/dev/null
                              sysctl -q dev.gpio.2.led.2.pwm=0
                              gpioctl -f /dev/gpioc2 6 duty 55 >/dev/null
                              gpioctl -f /dev/gpioc2 7 duty 20 >/dev/null
                              gpioctl -f /dev/gpioc2 8 duty 15 >/dev/null
                            elif [ $resb = 0 ];
                            then
                              sysctl -q dev.gpio.2.led.2.pwm=1
                              gpioctl -f /dev/gpioc2 6 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 7 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 8 duty 0 >/dev/null
                              sysctl -q dev.gpio.2.led.1.pwm=1
                              gpioctl -f /dev/gpioc2 3 duty 50 >/dev/null
                              gpioctl -f /dev/gpioc2 4 duty 15 >/dev/null
                            else
                              sysctl -q dev.gpio.2.led.1.pwm=1
                              gpioctl -f /dev/gpioc2 3 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 4 duty 0 >/dev/null
                              sysctl -q dev.gpio.2.led.2.pwm=1
                              gpioctl -f /dev/gpioc2 6 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 7 duty 50 >/dev/null
                              gpioctl -f /dev/gpioc2 8 duty 0 >/dev/null
                              
                            fi
                            if [ $resc = 0 ] || [ $resd = 0 ];
                            then
                              sysctl -q dev.gpio.2.led.0.pwm=1
                              gpioctl -f /dev/gpioc2 2 duty 50 >/dev/null
                              gpioctl -f /dev/gpioc2 0 duty 50 >/dev/null
                            else
                              sysctl -q dev.gpio.2.led.0.pwm=1
                              gpioctl -f /dev/gpioc2 2 duty 0 >/dev/null
                              gpioctl -f /dev/gpioc2 0 duty 0 >/dev/null
                            
                            fi
                            
                            1 Reply Last reply Reply Quote 0
                            • W
                              wgstarks
                              last edited by Jul 19, 2024, 12:17 AM

                              When I test in shell I get the following result-

                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              gpio_open: No such file or directory
                              

                              My script-

                              #!/bin/sh
                              led_intensity=0
                              while [ $led_intensity -le 8 ]; do
                                gpioctl -f /dev/gpioc2 $led_intensity duty 0 >/dev/null
                                led_intensity=$(( led_intensity + 1 ))
                              done
                              
                              check_current_states=$( pfctl -vvss | grep -e "igc3 icmp" )
                              WAN=0
                              case "$check_current_states" in
                                *icmp* ) WAN=1 ;;
                              esac
                              if [ $WAN = 0 ];
                              then
                               sysctl -q dev.gpio.2.led.0.pwm=0
                               gpioctl -f /dev/gpioc2 0 duty 200 >/dev/null
                               sysctl -q dev.gpio.2.led.1.pwm=0
                               gpioctl -f /dev/gpioc2 3 duty 200 >/dev/null
                               sysctl -q dev.gpio.2.led.2.pwm=0
                               gpioctl -f /dev/gpioc2 6 duty 200 >/dev/null
                              else
                                /usr/local/sbin/pfSense-led.sh ready
                              
                              fi
                              
                              
                              

                              Box: SG-4200

                              J 1 Reply Last reply Jul 19, 2024, 12:26 AM Reply Quote 0
                              • J
                                JonathanLee @wgstarks
                                last edited by JonathanLee Jul 19, 2024, 12:30 AM Jul 19, 2024, 12:26 AM

                                @wgstarks

                                Do me a favor take a look in
                                /usr/local/sbin/pfSense-led.sh

                                Find your model firewall and tell me what directive is used to change the LEDS…

                                Also peek in /dev/led see if you have that folder, if you do it should be easy to adapt with the directive used for your model

                                W 1 Reply Last reply Jul 19, 2024, 12:34 AM Reply Quote 0
                                • W
                                  wgstarks @JonathanLee
                                  last edited by Jul 19, 2024, 12:34 AM

                                  @JonathanLee said in Netgate 2100 Customization of LEDs (Guide):

                                  @wgstarks

                                  Do me a favor take a look in
                                  /usr/local/sbin/pfSense-led.sh

                                  Find your model firewall and tell me what directive is used to change the LEDS…

                                  Maybe this is what you need.

                                  
                                  # Netgate 4200
                                  #
                                  
                                  4200_led_off() {
                                  	local _leds="red_0 green_0 blue_0 red_1 green_1 blue_1 red_2 green_2 blue_2"
                                  
                                  	for led in ${_leds}; do
                                  		echo 0 > /dev/led/${led}
                                  	done
                                  }
                                  
                                  4200_led_booting() {
                                  	4200_led_off
                                  	# Fast blink blue on all LEDs
                                  	echo f2 > /dev/led/blue_0
                                  	echo f2 > /dev/led/blue_1
                                  	echo f2 > /dev/led/blue_2
                                  }
                                  
                                  4200_led_ready() {
                                  	4200_led_off
                                  	# Left LED solid blue
                                  	echo 1 > /dev/led/blue_2
                                  }
                                  
                                  4200_led_update() {
                                  	# Purple on center LED
                                  	echo 1 > /dev/led/red_1
                                  	echo 0 > /dev/led/green_1
                                  	echo 1 > /dev/led/blue_1
                                  }
                                  
                                  4200_led_update_off() {
                                  	# Turn off center LED only
                                  	echo 0 > /dev/led/red_1
                                  	echo 0 > /dev/led/green_1
                                  	echo 0 > /dev/led/blue_1
                                  }
                                  
                                  4200_led_updating() {
                                  	4200_led_off
                                  	# Fast green blink on all LEDs
                                  	echo f2 > /dev/led/green_0
                                  	echo f2 > /dev/led/green_1
                                  	echo f2 > /dev/led/green_2
                                  }
                                  

                                  Box: SG-4200

                                  J 1 Reply Last reply Jul 19, 2024, 12:53 AM Reply Quote 1
                                  • J
                                    JonathanLee @wgstarks
                                    last edited by JonathanLee Jul 19, 2024, 1:02 AM Jul 19, 2024, 12:53 AM

                                    @wgstarks said in Netgate 2100 Customization of LEDs (Guide):

                                    echo f2 > /dev/led/blue_0
                                    echo f2 > /dev/led/blue_1
                                    echo f2 > /dev/led/blue_2

                                    try this one

                                    #!/bin/sh
                                    echo 0 > /dev/led/blue_0
                                    echo 0 > /dev/led/blue_1
                                    echo 0 > /dev/led/blue_2
                                    echo 0 > /dev/led/red_0
                                    echo 0 > /dev/led/red_1
                                    echo 0 > /dev/led/red_2
                                    echo 0 > /dev/led/green_0
                                    echo 0 > /dev/led/green_1
                                    echo 0 > /dev/led/green_2
                                    
                                    check_current_states=$( pfctl -vvss | grep -e "igc3 icmp" )
                                    WAN=0
                                    case "$check_current_states" in
                                      *icmp* ) WAN=1 ;;
                                    esac
                                    if [ $WAN = 0 ];
                                    then
                                     echo f2 > /dev/led/red_0
                                     echo f2 > /dev/led/red_1
                                     echo f2 > /dev/led/red_2
                                    else
                                      /usr/local/sbin/pfSense-led.sh ready
                                    
                                    fi
                                    

                                    Or to just turn on solid red

                                    #!/bin/sh
                                    echo 0 > /dev/led/blue_0
                                    echo 0 > /dev/led/blue_1
                                    echo 0 > /dev/led/blue_2
                                    echo 0 > /dev/led/red_0
                                    echo 0 > /dev/led/red_1
                                    echo 0 > /dev/led/red_2
                                    echo 0 > /dev/led/green_0
                                    echo 0 > /dev/led/green_1
                                    echo 0 > /dev/led/green_2
                                    
                                    check_current_states=$( pfctl -vvss | grep -e "igc3 icmp" )
                                    WAN=0
                                    case "$check_current_states" in
                                      *icmp* ) WAN=1 ;;
                                    esac
                                    if [ $WAN = 0 ];
                                    then
                                     echo 1 > /dev/led/red_0
                                     echo 1 > /dev/led/red_1
                                     echo 1 > /dev/led/red_2
                                    else
                                      /usr/local/sbin/pfSense-led.sh ready
                                    
                                    fi
                                    

                                    Please let me know if that works unplug wan it should come on red when you test it.

                                    After set your cron job to what ever amount of timer you want every min check it or whatever you want. Mine runs every min

                                    make sure you chmod the file also so it can run.

                                    if you want just do a chmod 777 on it and or a more secure privilege.

                                    I have some that run in the day and some at night so this is my 6am - 8:59 one

                                    🔒 Log in to view

                                    W 1 Reply Last reply Jul 19, 2024, 1:05 AM Reply Quote 1
                                    • W
                                      wgstarks @JonathanLee
                                      last edited by Jul 19, 2024, 1:05 AM

                                      @JonathanLee said in Netgate 2100 Customization of LEDs (Guide):

                                      @wgstarks said in Netgate 2100 Customization of LEDs (Guide):

                                      echo f2 > /dev/led/blue_0
                                      echo f2 > /dev/led/blue_1
                                      echo f2 > /dev/led/blue_2

                                      try this one

                                      #!/bin/sh
                                      echo 0 > /dev/led/blue_0
                                      echo 0 > /dev/led/blue_1
                                      echo 0 > /dev/led/blue_2
                                      echo 0 > /dev/led/red_0
                                      echo 0 > /dev/led/red_1
                                      echo 0 > /dev/led/red_2
                                      echo 0 > /dev/led/green_0
                                      echo 0 > /dev/led/green_1
                                      echo 0 > /dev/led/green_2
                                      
                                      check_current_states=$( pfctl -vvss | grep -e "igc3 icmp" )
                                      WAN=0
                                      case "$check_current_states" in
                                        *icmp* ) WAN=1 ;;
                                      esac
                                      if [ $WAN = 0 ];
                                      then
                                       echo f2 > /dev/led/red_0
                                       echo f2 > /dev/led/red_1
                                       echo f2 > /dev/led/red_2
                                      else
                                        /usr/local/sbin/pfSense-led.sh ready
                                      
                                      fi
                                      

                                      Or to just turn on solid red

                                      #!/bin/sh
                                      echo 0 > /dev/led/blue_0
                                      echo 0 > /dev/led/blue_1
                                      echo 0 > /dev/led/blue_2
                                      echo 0 > /dev/led/red_0
                                      echo 0 > /dev/led/red_1
                                      echo 0 > /dev/led/red_2
                                      echo 0 > /dev/led/green_0
                                      echo 0 > /dev/led/green_1
                                      echo 0 > /dev/led/green_2
                                      
                                      check_current_states=$( pfctl -vvss | grep -e "igc3 icmp" )
                                      WAN=0
                                      case "$check_current_states" in
                                        *icmp* ) WAN=1 ;;
                                      esac
                                      if [ $WAN = 0 ];
                                      then
                                       echo 1 > /dev/led/red_0
                                       echo 1 > /dev/led/red_1
                                       echo 1 > /dev/led/red_2
                                      else
                                        /usr/local/sbin/pfSense-led.sh ready
                                      
                                      fi
                                      

                                      Please let me know if that works unplug wan it should come on red when you test it.

                                      After set your cron job to what ever amount of timer you want every min check it or whatever you want. Mine runs every min

                                      make sure you chmod the file also so it can run.

                                      if you want just do a chmod 777 on it and or a more secure privilege.

                                      I have some that run in the day and some at night so this is my 6am - 8:59 one

                                      🔒 Log in to view

                                      I like the blinking red. More of an attention getter IMO. Working beautifully. Thanks for the script and the help.

                                      Box: SG-4200

                                      J 1 Reply Last reply Jul 19, 2024, 1:10 AM Reply Quote 1
                                      • W
                                        wgstarks
                                        last edited by wgstarks Jul 19, 2024, 1:11 AM Jul 19, 2024, 1:10 AM

                                        Is it possible to increase the brightness? And blink all three?

                                        Box: SG-4200

                                        J 1 Reply Last reply Jul 19, 2024, 1:12 AM Reply Quote 0
                                        • J
                                          JonathanLee @wgstarks
                                          last edited by Jul 19, 2024, 1:10 AM

                                          @wgstarks said in Netgate 2100 Customization of LEDs (Guide):

                                          IMO

                                          Great, no problem enjoy. I have one that turns purple when my wife has her work stuff on... royal purple means do not mess with firewall when she is working... haha

                                          1 Reply Last reply Reply Quote 0
                                          16 out of 37
                                          • First post
                                            16/37
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.