Adding a Status LED for RP3 B+

I’m doing a little troubleshooting on the Raspbrry Pi 3 B+ and figured I’d add my notes somewhere for safe keeping.

I’ve added a fancy metal momentary push button with blue led surround to switch my Volumio off/on using GPIO 3 and GPIO 4 with the GPIO Buttons plugin and a pair of diodes on the switch to ground both inputs when the switch is depressed.

I am using the UART on GPIO 14 to energize the LED when the Raspberry Pi is running which has used in the past however, apparently the Raspberry Pi 3 B+ uses a software UART rather than hardware and as a result, the LED energizes for a few seconds during boot and then extinguishes.

I’ve done some digging around and there is a fix which causes a kernel panic and there is another fix for that too.

  1. In order to make GPIO 14 to energize the LED when the Raspberry Pi 3 B+ is running, we need to add a line to userconfig.txt in the boot directory to turn the UART on: enable_uart=1

  2. When I added this line, it caused my system to hang on boot and it never came on line. Apparently this is a problem in the Raspberry Pi 3 firmware and in order to correct it we need to do the following. We need to edit the cmdline.txt which is also in the boot directory. We need to remove the reference to kgdboc. In my instance of Volumio, I removed kgdboc=serial0,115200 from the file and it came back online just fine.

If anyone has anything else to add, I’ll be happy to update my system. I have a concern that when I do another update on Volumio, I will need to edit cmdline.txt before I reboot or I run the risk of a broken system.

Hi,
I’m no expert but I followed the instructions here https://howchoo.com/g/ytzjyzy4m2e/build-a-simple-raspberry-pi-led-power-status-indicator and also here https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi

Seems to work for fine for me. Also see comments in both articles

Good luck

1 Like

Hi @digbyf,

Welcome to the Volumio community. I’m not a very active member but since this is your first post, I’m happy to welcome you into the fold. Volumio is an outstanding streamer. I’ve been using it since before it was called Volumio and it plays 99% of the music in my home and office.

I probably didn’t make my intensions clear in my post. My intent was to describe pitfalls I’ve encountered with the Raspberry Pi 3 B+ when interfacing the status LED off the UART on the RP3 B+ because it is a software UART and not a hardware UART in the hopes that it will help others and so that I have a detailed description of what I did so that I can resolve it when I encounter it again and have forgotten this chapter :upside_down_face:

I’ve got a small arsenal of RaspBerry Pi boards ranging from RP1 to RP2 and now I’ve been experimenting with the RP 3 B+ boards which have blown me away in terms of performance and responsiveness. Since my existing Volumio players are mostly RP 1, the RP3 is an astounding leap.

Anyway, all of my boards are outfitted with Status LED’s and a power button. To toggle the power I use one of the Volumio plugins called “GPIO Buttons” to recognize GPIO pin 4 as the signal to shut down. By default GPIO pin 3 will start it up. My Status LED is connected to the UART on GPIO pin 14 as detailed in the diagram below.

The issue is that because RP3 uses a software UART, it only energizes the LED briefly. The fix is to “enable_uart=1” which I described in point #1 but that causes a kernel panic so you must apply the #2 fix I detailed in my first post.

Anyway, thanks for the response. I have indeed seen those articles.

Cheers,
Andrew

This is my wiring diagram:

My latest streamer looks like this
(The silver push button does on/off and the status LED is built in):

Hello agian @digbyf, I just noted your suggestion about seeing the comments in the articles. I see they indeed ran into the same issue that I did. I’m still reading the comment threads so I’m not sure that they discovered the problem with kgdboc in the cmdline.txt file or whether they came up with a better solution.

Just a quick update.

I ran an update to the latest 2.xxx version to get rid of the expired ca-certificate issue. Because I have changed the cmdline.txt file in my system, I had to edit the file again and remove the reference to kgdboc from the file. Once that was done all works exactly as it should.

ever tried to put that in userconfig.txt?
That should survive an OTA update.

I was wondering that myself when I did the update but I’m not sure what I would put in for the setting. I tried kgdboc="" but that did not work. It survived the update but it doesn’t override the setting in cmdline.txt.

If it’s a pi3, then you would also need to switch to mini uart for Bluetooth…
Have a look at https://github.com/volumio/Build/pull/483 for some details :slight_smile:

You should also find some links to the official foundation docs with even more details! :slight_smile:

Thanks @ashthespy. I will look into that to see where that fits in. I can cast my iPhone to my Volumio and use it to play my phone through Volumio. Is there another BT facility I’m unaware of? That would be cool if I can connect it to other BT sources or even cast Volumio to other BT systems.

In the meantime, following @gkkpch’s lead, I did some research and landed here: https://github.com/raspberrypi/linux/issues/1697#issuecomment-392604386

I updated the contents of my userconfig.txt file with an entry for dtoverlay. This allowed for an update and reboot where the cmdline.txt file contains kgdboc=serial0,115200

This is the contents of my userconfig.txt file:

# Add your custom config.txt options to this file, which will be preserved during updates
enable_uart=1
dtoverlay=pi3-disable-bt

That would disable bluetooth… The overlay I suggested was based on this:

This puts the bluetooth onto the secondary miniuart

enable_uart=1 
dtoverlay=pi3-miniuart-bt 

Either way, we have removed the kgdboc in the upcoming 3.x builds, so it should be as easy as just enabling uart soon! :slight_smile:

1 Like

Well that is fantastic! It will make things so much simpler. I’m going to take some time away from work now and read up on that doc you linked to.

I’m also going to look into where Volumio is using BT. I had thought it was being used with allowing me to use my phone as a source for Volumio but I’ll bet that’s being done via the local network. Now I’m intrigued.

Here’s what I thought it was for but since I’ve turned off BT with dtoverlay=pi3-disable-bt, that can’t be the case.

EDIT: I’ll be changing my userconfig per your suggestion ASAP. Thanks for the updated direction.

EDIT II: I see the Bluetooth section in Settings → Playback. That is quite cool. I think I will be signing my brother up for a premium account as he would quite like to connect his BT AMP in his media room to the Volumio system I set up for him in the rest of the house.