Odd Peripheral Goings-On With RPi4

for all subjects/topics not covered by the other forum categories
User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Wed Sep 25, 2019 10:37 am

I fitted the "fan shim" the other day, which I'd ordered before I ruled out a heat problem. It's now keeping Pipi at a nice consistent 40 centigrade.

The fan assembly also has a little button on it, and I was thinking this would solve my latest problem - "how do I fit a button across 2 GPIO pins to invoke my keybind/shutdown thing?" Currently I am just touching the pins with a jumper header, but I think actually it is causing multiple keypresses when I do that 'cos I'm not quick enough!

After fitting I pressed the button and was surprised to find that the Pi shut itself down! After some investigation it appears that the fan's extra button is already mapped to GPIO 3, so it was doing my shutdown function without me having to change anything. I don't remember reading in the instructions that the button uses GPIO 3, but I am sure it must be documented somewhere.

Anyhow I still have the same problem: HDMI cable plugged into the RPi4 and going to my converter box - button and keyboard/trackerball work.

Cable out - button and keyboard/trackerball cease to function.

Earlier it was suggested a firmware update might help - how do I go about checking and updating the Pi's firmware?
Image

User avatar
Elminster
Posts: 4111
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by Elminster » Wed Sep 25, 2019 11:00 am

BeebMaster wrote:
Wed Sep 25, 2019 10:37 am
Earlier it was suggested a firmware update might help - how do I go about checking and updating the Pi's firmware?
dp11 suggested
new beta firmware for the VLI USB chip.
Not looked at how to do that.

I have now permanently setup my pi4 to replace mediacentre macmini. The files are on a QNAP Nas, Pi4 is the plex server, amazon fire tv 4k is the plex player. So far nothing has hung. But I have the other way around. Key/board mouse is not plugged in, but I left the hdmi plugged into Yamaha home cinema amp so that I can get to desktop/console if I need to without faffing about with wires.

I found because I have a sealed case the shim fan still does not keep it cool, I was going to drill holes but then saw the best cooling soluion for the Pi4 is the FLIRC Case. So I have one of them on order.

If I see any issues I will let you know but I think my setup does not recreate your issue.

Edit: https://github.com/raspberrypi/firmware
Doing a quick google the USB beta firmware was out in Jun, so it maybe in core by now.
Last edited by Elminster on Wed Sep 25, 2019 11:06 am, edited 1 time in total.


User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Mon Nov 25, 2019 4:53 pm

Thanks to BigEd, it's now been fixed.

The problem seemed to be that without a display attached, the X server wasn't starting, which I understand also runs the keyboard & mouse, and therefore my keybinds mapped to GPIO pins as well. All it needed was hdmi_force_hotplug=1 uncommenting from config.txt and it's now fine, monitor or no monitor.
Image

User avatar
Elminster
Posts: 4111
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by Elminster » Mon Nov 25, 2019 8:10 pm

Odd as I ran the rpi4 for days (back on post from 13th September) with the hdmi cable unplugged and gui enabled. But never hit issue. not sure the difference,?

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Mon Nov 25, 2019 9:24 pm

It's not clear from your post if you booted without HDMI cable at any point - that, I think, is the thing. Removing HDMI after booting won't, I think, cause any bother.

Coeus
Posts: 1571
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by Coeus » Mon Nov 25, 2019 10:26 pm

BeebMaster wrote:
Mon Nov 25, 2019 4:53 pm
Thanks to BigEd, it's now been fixed.

The problem seemed to be that without a display attached, the X server wasn't starting, which I understand also runs the keyboard & mouse, and therefore my keybinds mapped to GPIO pins as well. All it needed was hdmi_force_hotplug=1 uncommenting from config.txt and it's now fine, monitor or no monitor.
Does that also rely on someone being logged on? Does it auto logon?

I can't help the better solution would be to have a daemon that reads the GPIO directly rather than relying on X. Does it appear as an input/event device, i.e. one of /dev/input/event0... up to some number determines by how many input devices there are. There is a program called evtest that can be used to find which events appear on which device and for other things such as working which codes an odd-ball keyboard generate.

User avatar
Elminster
Posts: 4111
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by Elminster » Mon Nov 25, 2019 10:32 pm

BigEd wrote:
Mon Nov 25, 2019 9:24 pm
It's not clear from your post if you booted without HDMI cable at any point - that, I think, is the thing. Removing HDMI after booting won't, I think, cause any bother.
It ran with nothing but power plugged in for days, and I could always get to it to ssh via WiFi. I was heat soak testing it.

It was tested with no hdmi cable, cable plug into port one, cable plug into port 2. It was also test with/without keyboard& mouse, and test with and without power hub. I could never recreate the issue.

It was always boot from fresh. Was with latest version and updates at the time.

So was the log showing messages from the Xserver failing.

I can easily test again. It will take a moment to yank the hdmi cable, and power it off/on again. It is now using Ethernet rather than WiFi.

Edit: of course it’s feasible the application sets up a pseudo display, not unheard of for headless applications.

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Tue Nov 26, 2019 7:58 am

Ah, I think we may be talking about different things. Maybe you're investigating the idea of the Pi4 not working well if there's no HDMI cable connected at boot. But I think that's not what Beebmaster's problem was. It was very specifically some facilities he's using which seem to be reliant on the X startup (and indeed, I think I may be right in saying, an automatically started GUI session, so not just X but also a window manager and so on.)

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Tue Nov 26, 2019 10:38 am

To be honest I am not entirely sure.

But the behaviour I was always getting, with standard Raspbian install, was no HDMI at boot = no display (obviously) but also no mouse & keyboard, and therefore seemingly, also no keybinds to the GPIO pins.

Plugging in a monitor whilst running did not restore any of these missing functions.

We worked out that the X server wasn't starting if it didn't detect anything on the HDMI output, and with the config.txt mod it now works fine.

I am currently running it with no monitor, keyboard or mouse and I can press the button mapped to GPIO keybind that I use to run my shutdown script.

Next to look at is if I can use a GPIO pin to revive from its shutdown-but-still-powered-on state without having to power it off and on again.
Image

User avatar
Elminster
Posts: 4111
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by Elminster » Tue Nov 26, 2019 10:47 am

Does sound something specific then. Although not obvious why that would be different between a pi3 and a pi4.

scruss
Posts: 246
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by scruss » Tue Nov 26, 2019 2:57 pm

BeebMaster wrote:
Tue Nov 26, 2019 10:38 am
Next to look at is if I can use a GPIO pin to revive from its shutdown-but-still-powered-on state without having to power it off and on again.
This might help: GLOBAL_EN must be shorted to ground to boot. It's a momentary contact that should restart the processor.

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 1:37 pm

I've got another funny going-on, although not peripheral related.

Loading some PDFs makes the Pi 4 suddenly restart!

At first I thought it was a bug in the standard Raspbian install PDF viewer (qdf), so I deleted it and replaced it with Okular. Still it occasionally resets when I load a PDF. More often it resets when I select several PDFs to load. I haven't established a reliable pattern to when or why it does it.

Next I thought it might be a spurious control code in one of the documents, which was calling my Shift-BREAK restart keybind, so I added a logging file facility to that script to see if it was being called just before the reset happens - but no.

I don't really know how to investigate this further, dmesg is no help as its output starts again on every boot. Anyone else heard of this behaviour or know of a log I can consult which survives a restart?
Image

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Fri Feb 28, 2020 2:03 pm

I'm tempted to suspect the power supply, and the Pi's response to low voltage - it knows about low voltage, and it cares, but it's not clear how well-calibrated it is. It may be perceiving a brownout and rebooting on purpose.

With the latest firmware and the latest OS, you can (and should) update the secondary firmware, to improve the power usage of the Pi 4. See for example here and here.

Code: Select all

sudo apt update
sudo apt full-upgrade
sudo apt install rpi-eeprom
Running the rpi-eeprom-update command with no parameters indicates whether an update is required
Reading the EEPROM version

Code: Select all

vcgencmd bootloader_version

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 2:41 pm

Interesting...I do have lots of USB devices connected. How do I check how much power is being drawn?

Looks like I'm pretty up to date:

Code: Select all

pi@raspberrypi:~ $ sudo apt update 
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Fetched 15.0 kB in 1s (23.3 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
pi@raspberrypi:~ $ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo apt install rpi-eeprom
Reading package lists... Done
Building dependency tree       
Reading state information... Done
rpi-eeprom is already the newest version (4.0-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ rpi-eeprom-update
BCM2711 detected
BOOTLOADER: up-to-date
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
 LATEST: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
VL805: version unknown. Try sudo rpi-eeprom-update
CURRENT: 
 LATEST: 000137ad
pi@raspberrypi:~ $ sudo rpi-eeprom-update
BCM2711 detected
BOOTLOADER: up-to-date
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
 LATEST: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
VL805: update required
CURRENT: 000137ab
 LATEST: 000137ad
pi@raspberrypi:~ $ vcgencmd bootloader_version
Sep 10 2019 10:41:50
version f626c772b15ba1b7e0532a8d50a761b3ccbdf3bb (release)
timestamp 1568112110
pi@raspberrypi:~ $ 
Not sure how I update VL805. I think that's the USB controller, so it may be the culprit to all this (though I don't know why it might only manifest itself when loading PDFs).
Image

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 2:53 pm

Looks like I have to do

Code: Select all

rpi-eeprom-update -u <new file>
to update the USB firmware, but I haven't found the file yet!
Image

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 2:57 pm

I think it's here:

https://github.com/raspberrypi/rpi-eepr ... 0137ad.bin

If I go offline for a month, it didn't work.
Image

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 3:04 pm

Yay:

Code: Select all

pi@raspberrypi:~ $ vcgencmd bootloader_version
Sep 10 2019 10:41:50
version f626c772b15ba1b7e0532a8d50a761b3ccbdf3bb (release)
timestamp 1568112110
pi@raspberrypi:~ $ sudo rpi-eeprom-update          
BCM2711 detected
*** UPDATE REQUIRED ***
BOOTLOADER: update required
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
 LATEST: Fri 17 Jan 17:37:11 UTC 2020 (1579282631)
VL805: up-to-date
CURRENT: 000137ad
 LATEST: 000137ad
pi@raspberrypi:~ $ 
Unyay:

Code: Select all

sudo rpi-eeprom-update -a
BCM2711 detected
FREEZE_VERSION=1                                                              
EEPROM version is frozen. Skipping update
Image

dp11
Posts: 1139
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by dp11 » Fri Feb 28, 2020 3:19 pm

have you rebooted ? I think you might have to reboot for it to take effect.

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Fri Feb 28, 2020 3:51 pm

(I notice this one-line advice on the RPi forums:
Install the rpi-eeprom-images package.
)

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 4:19 pm

Yes, rebooted. Also rpi-eeprom-images is up-to-date.

I had this "frozen" problem before on a previous attempt to update all the firmware, and went through the rigmarole of extracting and editing the firmware update configuration options. I checked before doing anything today and it was "unfrozen" - so it looks like my manual update of the USB firmware has frozen it again. I'm a bit wary of unfreezing it again in case it does any harm, it must have applied that setting for a reason.
Image

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 4:24 pm

Ahh...got it...another thing I did when trying to get it to auto-update VL805 was change /etc/default/rpi-eeprom-update to make the status "beta" instead of "critical". I've put it back to critical now, and it isn't finding that January 2020 update any longer:

Code: Select all

pi@raspberrypi:~ $ sudo rpi-eeprom-update   
BCM2711 detected
BOOTLOADER: up-to-date
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
 LATEST: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
VL805: up-to-date
CURRENT: 000137ad
 LATEST: 000137ad
pi@raspberrypi:~ $ 
Image

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 4:40 pm

Wow, no longer limited to PDFs, it just reset itself when trying to load this page:

https://www.flickr.com/photos/simoninns ... 334359291/

But hasn't done it when I loaded it again after restarting.

Something seriously wrong here!

Have I got it overclocked too much?
Image

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Fri Feb 28, 2020 4:42 pm

Sounds like you have!

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 4:53 pm

Is a reset triggered by excess overclocking going to be logged somewhere? Or detectable in a definitive way?
Image

dp11
Posts: 1139
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by dp11 » Fri Feb 28, 2020 5:19 pm

What are your overclock settings ? you may need to up the overvoltage setting.

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 6:12 pm

I've got this in my config.txt:

Code: Select all

over_voltage=7
arm_freq=2100
Apart from these occasional (but now seemingly more frequent) sudden resets, it's worked very well with those settings for some time now.

As an experiment, I am trying having my USB3 hub externally powered all the time. Usually I only power it when I connect my portable USB backup drives, which won't spin up without the hub being externally powered. I'm going to run it like that for a few days and see if there are any sudden resets.

None so far!
Image

User avatar
hoglet
Posts: 9240
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by hoglet » Fri Feb 28, 2020 6:25 pm

BeebMaster wrote:
Fri Feb 28, 2020 6:12 pm

Code: Select all

arm_freq=2100
:shock:

User avatar
BeebMaster
Posts: 3309
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BeebMaster » Fri Feb 28, 2020 8:42 pm

I just opened 29 Seagate hard drive manual PDFs at once, and it reset itself, so I can rule out powering the USB hub as a solution.

Time to start reducing the overclocking I suppose.
Image

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Odd Peripheral Goings-On With RPi4

Post by BigEd » Fri Feb 28, 2020 8:45 pm

Yes... if you have an unstable machine, and you're overclocking, the first thing is surely to go back to nominal speeds. Then you find out if the machine itself is unstable or if the overclocking is too extreme.

Post Reply

Return to “off-topic”