Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Raspberry_Pi_4-Ham_RADIO] Raspberry Pi with battery backup

Expand Messages
  • Max Harper
    The Raspberry Pi and Linux is all new to me. I ve only had the Pi now for a couple of weeks. How difficult is it to have the Pi shut down when a GPIO pin is
    Message 1 of 8 , Jan 5, 2013
      The Raspberry Pi and Linux is all new to me. I've only had the Pi now for a couple of weeks. How difficult is it to have the Pi shut down when a GPIO pin is pulled low? I've been searching using Google but can only find hardware articles, nothing in reguards to software. I can build charging / power supply circuits and program a Pic chip to monitor AC power / battery voltage and pull an output pin low on the Pic which would be connected to an input pin on the Pi, wait long enough for the Pi to shutdown and then remove power to the Pi until AC power is restored. If there was a way to pull an output pin on the Pi low as it was shutting down my pic chip could remove power after it had time to finish, basically making it act just like a PC. Hit a power button and the Pi turns on. The shutdown command or the power button would turn it off. Everything outside the Pi I can handle, i just don't know anything about programming on it yet. Any suggestions?
       
      Max, KG4PID

      From: Jeff Francis™ <jeff@...>
      To: Raspberry_Pi_4-Ham_RADIO@yahoogroups.com
      Sent: Saturday, January 5, 2013 10:00 PM
      Subject: Re: [Raspberry_Pi_4-Ham_RADIO] Raspberry Pi with battery backup
       
        If all you want to do is monitor the status of a single GPIO pin, all it takes is a half dozen lines of bash script shoved into a crontab.  If you actually want to monitor a commercial UPS, there are packages like apcupsd.

        
      On Sat, Jan 5, 2013 at 5:59 PM, Max <kg4pid@...> wrote:
       
      Anyone know of a program for the PI that can communicate with a battery backup so it can be shutdown when the batteries are depleted? If I could find a program that would monitor the status of one of the GPIO pins and would issue the shutdown command when pulled low would be all I need, I can build the rest. I don't like powering off without a proper shutdown first since this APRS Igate with APRX will be running unattended.

      Thanks, Max KG4PID


      -- -=jeff=-
    • Dave B
      ... Interesting. For the Bash/Cron challenged amongst us, how about an example to chew on? Please... In regards to monitoring a GPIO pin that is via
      Message 2 of 8 , Jan 7, 2013
        On 6 Jan 2013 at 11:28, Raspberry_Pi_4-Ham_RADIO@yahoogroups.com wrote:

        > ______________________________________________________________________
        > Re: Raspberry Pi with battery backup
        > Posted by: "Jeff Francis¢" jeff@... jeffrey_francis
        > Date: Sat Jan 5, 2013 8:10 pm ((PST))
        >
        > If all you want to do is monitor the status of a single GPIO pin,
        > all it takes is a half dozen lines of bash script shoved into a
        > crontab. If you actually want to monitor a commercial UPS, there
        > are packages like apcupsd.
        >

        Interesting.

        For the Bash/Cron challenged amongst us, how about an example to chew on?
        Please... In regards to monitoring a GPIO pin that is via Bash/Cron.

        (There are just tooooooo many often conflicting hits when googling for
        that sort of thing.)

        There is a lot of interest in using the Pi on battery power, so something
        like that could be very useful to have an example of (however crude at
        first) so an orderly shutdown can be done, before the lights become too
        dim..

        Perhaps also, at the last gasp, to flip another GPIO pin, to actually
        disconnect the supply (by FlipFlop and power fet?) from the Pi, so though
        the OS is killed of, the Pi's residual power consumption doesn't wreck
        the (otherwise still connected) batteries. Said FlipFlop could be
        toggled back to the "Power ON" state by hardware when the batteries have
        recovered enough (if unatended use is needed) or by mk1 push button.

        73.

        Dave (G0WBX)
      • David Kjellquist
        Here is a thread that provides all the needed shell scripts for watching a GPIO pin for reset (-r) or shutdown(-h). I am using the watch_reset.sh with
        Message 3 of 8 , Jan 7, 2013
          Here is a thread that provides all the needed shell scripts for watching a GPIO pin for reset (-r) or shutdown(-h).  I am using the watch_reset.sh with rc.local mods in my remote antenna switch for rebooting if the client-server connection gets hosed.   Be careful modding rc.local since it can cause booting to lockup. If you do mess up and boot fails, simply remove the SD card go to another computer with a card reader, mount the card and fix /etc/rc.local

          http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=14255




          On 1/7/2013 5:22 AM, Dave B wrote:
           

          On 6 Jan 2013 at 11:28, Raspberry_Pi_4-Ham_RADIO@yahoogroups.com wrote:

          > __________________________________________________________
          > Re: Raspberry Pi with battery backup
          > Posted by: "Jeff Francis¢" jeff@... jeffrey_francis
          > Date: Sat Jan 5, 2013 8:10 pm ((PST))
          >
          > If all you want to do is monitor the status of a single GPIO pin,
          > all it takes is a half dozen lines of bash script shoved into a
          > crontab. If you actually want to monitor a commercial UPS, there
          > are packages like apcupsd.
          >

          Interesting.

          For the Bash/Cron challenged amongst us, how about an example to chew on?
          Please... In regards to monitoring a GPIO pin that is via Bash/Cron.

          (There are just tooooooo many often conflicting hits when googling for
          that sort of thing.)

          There is a lot of interest in using the Pi on battery power, so something
          like that could be very useful to have an example of (however crude at
          first) so an orderly shutdown can be done, before the lights become too
          dim..

          Perhaps also, at the last gasp, to flip another GPIO pin, to actually
          disconnect the supply (by FlipFlop and power fet?) from the Pi, so though
          the OS is killed of, the Pi's residual power consumption doesn't wreck
          the (otherwise still connected) batteries. Said FlipFlop could be
          toggled back to the "Power ON" state by hardware when the batteries have
          recovered enough (if unatended use is needed) or by mk1 push button.

          73.

          Dave (G0WBX)


        • Jeff Francis™
          Here s a nice page showing how to do I/O from a number of different scripting languages, including simple shell scripts. Should have everything you need:
          Message 4 of 8 , Jan 8, 2013
              Here's a nice page showing how to do I/O from a number of different scripting languages, including simple shell scripts.  Should have everything you need:

            http://elinux.org/RPi_Low-level_peripherals#GPIO_Driving_Example_.28Bash_shell_script.2C_using_sysfs.2C_part_of_the_raspbian_operating_system.29


            On Mon, Jan 7, 2013 at 6:48 AM, David Kjellquist <dave@...> wrote:
             

            Here is a thread that provides all the needed shell scripts for watching a GPIO pin for reset (-r) or shutdown(-h).  I am using the watch_reset.sh with rc.local mods in my remote antenna switch for rebooting if the client-server connection gets hosed.   Be careful modding rc.local since it can cause booting to lockup. If you do mess up and boot fails, simply remove the SD card go to another computer with a card reader, mount the card and fix /etc/rc.local

            http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=14255





            On 1/7/2013 5:22 AM, Dave B wrote:
             

            On 6 Jan 2013 at 11:28, Raspberry_Pi_4-Ham_RADIO@yahoogroups.com wrote:

            > __________________________________________________________
            > Re: Raspberry Pi with battery backup
            > Posted by: "Jeff Francis¢" jeff@... jeffrey_francis
            > Date: Sat Jan 5, 2013 8:10 pm ((PST))
            >
            > If all you want to do is monitor the status of a single GPIO pin,
            > all it takes is a half dozen lines of bash script shoved into a
            > crontab. If you actually want to monitor a commercial UPS, there
            > are packages like apcupsd.
            >

            Interesting.

            For the Bash/Cron challenged amongst us, how about an example to chew on?
            Please... In regards to monitoring a GPIO pin that is via Bash/Cron.

            (There are just tooooooo many often conflicting hits when googling for
            that sort of thing.)

            There is a lot of interest in using the Pi on battery power, so something
            like that could be very useful to have an example of (however crude at
            first) so an orderly shutdown can be done, before the lights become too
            dim..

            Perhaps also, at the last gasp, to flip another GPIO pin, to actually
            disconnect the supply (by FlipFlop and power fet?) from the Pi, so though
            the OS is killed of, the Pi's residual power consumption doesn't wreck
            the (otherwise still connected) batteries. Said FlipFlop could be
            toggled back to the "Power ON" state by hardware when the batteries have
            recovered enough (if unatended use is needed) or by mk1 push button.

            73.

            Dave (G0WBX)





            --
            -=jeff=-
          Your message has been successfully submitted and would be delivered to recipients shortly.