Home of the Squeezebox™ & Transporter® network music players.
Page 16 of 28 FirstFirst ... 6141516171826 ... LastLast
Results 151 to 160 of 275
  1. #151
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,302
    If you want to used gpio to control Jivelite, you will need to simulate keyboard events. I think this is covered in the Jivelite thread.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #152
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Quote Originally Posted by paul- View Post
    LMS is the problem......you need to halt the system first. You can build or buy power relays. To drop power after the kernel shuts down.
    I've been trying to understand the foregoing discussion so that I can shutdown my pCP LMS server(s) safely. I'd appreciate guidance on whether I've got it straight.

    From the 'gpio-shutdown' section here:
    The default
    configuration uses GPIO3 with a pullup, so if you connect a
    button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
    you get a shutdown and power-up button.
    So I believe I need to enable the gpio-shutdown overlay on the tweaks page, and specify a pin number - I assume this replaces the default GPIO3 mentioned above.

    With a button connected between the specified pin and GND, a press of that button will call the pcp-powerbutton.sh script in /home/tc. That script will safely shut down pCP, issuing a 'halt' command to prevent corruption of the SD card caused if prefs or cache are being written when the power is cut.

    If I'm on the right lines, should that button be a momentary button or a latching button? Does pCP restart when the pin is grounded a *second* time, or when the connection to ground is broken? If a momentary button is required, that button should presumably *not* be configured as part of an sbpd setup.

    Quote Originally Posted by Jeff07971 View Post
    I just tried "gpio-shutdown" but it does not shutdown the pi as the readme suggests it only does "Player power off"

    the next button push does "Player power on"

    Jeff
    Jeff - did you get this resolved?

  3. #153
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Reading more carefully, it seems like the button should be a momentary button: "After shutdown, the system can be powered up again by driving GPIO3 low."

    So grounding the pin while pCP is running will call the pcp-powerbutton.sh script, which issues the 'sudo /sbin/poweroff' command. Grounding GPIO3 while it's shut down will use built-in RPi functionality to restart it. I also note that GPIO3 has an external pull-up resistor, so the pull-up setting in the 'tweaks' configuration should presumably be 'off' if using GPIO3 - or does this setting have no effect on GPIO3?

    Something to play with this evening. I have a DIY button panel, with a 'red' button that currently uses sbpd to power off the local player (short press) or restart LMS (long press). Assuming it's not possible to use the button configured for the gpio-shutdown overlay to also function with sbpd, I'll remove those two functions from my sbpd configuration and connect that button to GPIO3 instead.

    If I were to use a different pin for the gpio-shutdown, say GPIO26, then grounding that pin would power off, and grounding GPIO3 would restart, so a SPDT toggle switch might work (GPIO26-GND-GPIO3). Would it matter if GPIO3 stays grounded after a restart? Would it matter if GPIO26 stays grounded after shutting down?

  4. #154
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Grounding GPIO3 apparently performs a 'wake from halt', so it seems it'll only work if the Pi has actually been halted (e.g. by /sbin/poweroff?), rather than having the power interrupted. In its 'halted' state the Pi can then have the power removed safely. I think a toggle switch isn't such a good idea after all, but using a momentary button to ground GPIO3, to either halt the system or wake it up again, seems like the way to go.
    Last edited by chill; 2019-05-08 at 02:44.

  5. #155
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    These settings seem to work for the gpio-shutdown overlay:



    Grounding GPIO3 while the system is running will shut it down, grounding it again wakes it up.

  6. #156
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Wait... it doesn't seem reliable - sometimes works and sometimes doesn't. Coming back from a 'halt' (e.g. if I manually issue the 'sudo /sbin/poweroff' command in a terminal) seems reliable, but shutting down seems intermittent. Haven't spotted a pattern yet.

  7. #157
    Junior Member
    Join Date
    Apr 2019
    Posts
    13
    Quote Originally Posted by chill View Post
    Wait... it doesn't seem reliable - sometimes works and sometimes doesn't. Coming back from a 'halt' (e.g. if I manually issue the 'sudo /sbin/poweroff' command in a terminal) seems reliable, but shutting down seems intermittent. Haven't spotted a pattern yet.
    I'm surprised that works for you at all. I could never get mine to shut down using GPIO pin 3.

    What I do - and it seems to work reliably, so far - is to use a different pin for shutdown (GPIO 4 in my case) and then GPIO 3 for restart. Then I wired both of these and ground (3 wires) to the same double-pole momentary switch. Thus the two pins are independent but both grounded at the same time when you push the button.

  8. #158
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Interesting. I wonder if it's the hard-wired pull-up resistor that's different then. Or the fact that I2C uses GPIO3.

    Feeling a bit guilty about spamming this sbpd thread with this discussion....

  9. #159
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,302
    Yes, i2c uses gpio3, if you are using a DAC hat, most of those use i2c to control the dac, and you cannot use GPIO3 for anything else.

    Lets move the discussion over here

    https://forums.slimdevices.com/showt...tdown-overlays
    Last edited by paul-; 2019-05-08 at 06:43.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #160
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    In my case I don't have a DAC hat - no hats at all in fact. Testing so far has been with a bare 3B+.

    EDIT - just saw your suggestion to move the discussion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •