dtoverlay changes? - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: dtoverlay changes? (/showthread.php?tid=1686) |
dtoverlay changes? - Listener - 09-04-2019 Hello, Did something change in version 6.x with dtoverlay support? In version 5.x I used the following code placed in /boot/config.txt to affect an orderly shut down via a momentary push button connecting gpio 3 to ground. Code: dtoverlay=gpio-shutdown I tried gpio-poweroff as well and various parameters like gpiopin=3 and active_low=1, but no combination works for me with 6.1.0. My button is connected between header pins 5 and 9, gpio3 and ground. Thanks, John RE: dtoverlay changes? - TheOldPresbyope - 09-04-2019 (09-04-2019, 01:41 PM)Listener Wrote: Hello, What model RPi? Regards, Kent RE: dtoverlay changes? - Tim Curtis - 09-04-2019 Maybe the parameter names changed for that overlay. I don't really track that kind of stuff. You could try the command below to see if there were any errors logged when the kernel tried to load the overlay. Code: sudo vcdbg log msg RE: dtoverlay changes? - Listener - 09-05-2019 (09-04-2019, 03:33 PM)TheOldPresbyope Wrote: What model RPi? It is a 3b+. John RE: dtoverlay changes? - TheOldPresbyope - 09-05-2019 @Listener Ah. I was thinking it might be an RPi4B, which is so different internally that the firmware- and Raspbian-developers are still working out kinks. I have never tried this shutdown overlay so don't have personal experience. The current firmware documentation says (I pasted this snippet as code rather than quote so the text formatting doesn't break up): Code: Name: gpio-shutdown So, no, the parameter names don't appear to have changed. (We're up to systemd version 241 in moOde 6.1.0, so the udev rule is unnecessary.) I know this says the default pin is 3 but I suggest you try the full invocation anyway: Code: dtoverlay=gpio-shutdown,gpio_pin=3 Note the underscore in "gpio_pin". If I get a chance tomorrow I'll try this for myself. Regards, Kent Post-edit notes: [1] Tim's suggestion will turn up bad parameter names [2] It turns out I didn't need to go to the github repo. I could have printed out the same information at the command line entering a command I didn't know about until 1 minute ago: Code: dtoverlay -h gpio-shutdown RE: dtoverlay changes? - TheOldPresbyope - 09-05-2019 @Listener @Tim Curtis Ok, my post last night was correct but not helpful. This morning I found the problem. Hardware: moOde 6.1.0 on RPi3B+ (I don't think the model matters). Onboard audio device. From the cli, add the gpio-shutdown overlay Code: pi@moode:~ $ sudo dtoverlay gpio-shutdown In a second terminal window I see the following syslog output Code: pi@moode:~ $ tail -f /var/log/syslog Hmmm. Pin assignment conflict with i2c. Doh. My chart shows gpio pin 3 is assigned to i2c SCL. Naturally setting explicitly gpio_pin=3 similarly fails. Choosing pin 4 as the shutdown pin, Raspbian seems happy: Code: pi@moode:~ $ sudo dtoverlay -r gpio-shutdown However, shorting this pin to ground doesn't shutdown the Pi. I don't have time this morning to do any homework on the correct choice of pin and level but this should get you started in the right direction. Regards, Kent RE: dtoverlay changes? - Listener - 09-05-2019 OK Kent, That is a good trailhead. I'll be off grid for four days in the Sierra, so I won't be able to pursue it until next week. Thanks, John RE: dtoverlay changes? - lopchu - 03-05-2020 Hello, does Code: dtoverlay=gpio-shutdown,gpio_pin=3, active_low=1,gpio_pull=up work with current release (using a RPi3 B if that matters)? I wanted to add a power button according to this guide https://bitreporter.de/raspberrypi/richtiger-an-ausschalter-fur-den-raspberry-pi It is in German but basically says: Connect button to GPIO3 and GND, add line above to /boot/config.txt. Will that work with moode audio? RE: dtoverlay changes? - lopchu - 03-24-2020 I can answer my own question: it works. I ordered a simple cable with a button (this one). In /boot/config.txt, I added: Code: dtoverlay=gpio-shutdown,gpio_pin=3, active_low=1,gpio_pull=up (These are the default settings, so not necessary). And then had to comment out these entries: Code: #dtparam=i2c_arm-on (I am not sure if both are necessary but they were commented out in the link I was following, see previous post). P.S. Raspberry PI 3B, Moode 6.4.2 2020-02-12 RE: dtoverlay changes? - DRONE7 - 03-24-2020 Quote:(I am not sure if both are necessary but they were commented out in the link I was following, see previous post). If you are using a USB audio device or the Pi's onboard audio that will be ok. If you are or ever use a HAT dac or i2s connected dac or devices needing i2c connection (Oled displays etc) then you will need to uncomment those lines. |