A few days ago I acquired a shiny new Raspberry Pi 4B. I got it to do my microcontroller programming with to save having to wrestle Windows into doing Linuxy stuff.
I bought the 4Gb Pi along with the necessary power supply, HDMI cable and 32Gb SD card (with pre-installed NOOBS). Some heat sinks, a case, a fan and a fan controller completed the order with those nice people at the Pi Hut.
In general this is an impressive piece of kit but I've encountered some problems with it that I thought I'd share in case I can help prevent someone else from tearing their hair out.
About my setup
It's relevant to what follows to point out the following:
- I use a stand-alone monitor with my laptop and share this with the Pi by means of an HDMI v2 compatible switch.
- A powered 4 way USB3 hub is plugged into one of the Pi's USB3 ports. There's a Logitech wireless dongle plugged into the hub that enables use of my Logitech wireless keyboard and mouse with the Pi. Each of the hub's ports has its own on/off switch and all unused ports were off.
- The laptop and monitor (and lots of other MIDI stuff) are plugged into the same wall outlet via a power block. The Pi and its USB hub are plugged into a different outlet via another power block.
- The Wi-Fi signal is showing at about 80% on my Windows laptop. Th Pi lives behind the laptop and probably has slightly worse reception.
First boot - all seems hunky dory
When the Pi was booted for the first time I ensured it was using only the official Raspberry Pi branded power supply & HDMI cable along with the SD card by SanDisk - no 3rd party extras and no corners cut. I had my laptop running on mains and displaying the relevant docs on the Raspberry Pi web page, which I was following.The Pi started up and ran the configuration program. That went fine until just near the end of the setup when the Pi turned itself off. This was during, or just after, the OS update stage. Because the update takes a long time I'd gone off to have a cuppa and consequently didn't see what caused the Pi to go on strike. Weirdly, my laptop also went to sleep at the same time! Since I've got the laptop configured so that it never sleeps while plugged into the mains, that was a surprise. I assumed there must have been a mini power cut.
Anyhow, re-booting the Pi re-ran the setup program from the start. Some of the information I'd entered was remembered but I had to re-enter my new password along with Wi-Fi details. It didn't try to do an update again and this time it all ended correctly.
Assuming all was well I waited for the Pi to cool down then fitted the heat sinks and installed it into its case, along with the fan.
Flaky Wi-Fi
With the Pi powered on again and seemingly happy in its new case, I started exploring. All seemed well so I installed the Arduino IDE, which worked fine. Next I installed Samba and shortly after that the internet went down.
I (wrongly) blamed Samba for conflicting with the net connection and tried uninstalling it, but made a bit of a mess of it. After rebooting, the net just wouldn't come back. Sometimes my router could see the Pi but most of the time it couldn't. Running ifconfig wlan0
on the Pi showed up my Wi-Fi router, but I could not connect to it.
After a couple of hours getting nowhere I decided I'd re-install the OS from scratch. So I downloaded the latest Raspberry Pi OS from their website, "burned" it onto the SD card using the Raspberry Pi Imager, plugged it into the Pi and powered up.
Well, exactly the same thing happened: towards the end of the setup the Pi turned off and the laptop went to sleep! Re-running had the same result as before. But the net was back ...
... until the following day when it died again!
Pi won't stop
One other weird, unrelated, issue was that if the laptop was plugged in I couldn't turn off the Raspberry Pi. Not with the inline switch & not by pulling the plug. WTF!? 😲
It turns out that modern HDMI can feed power back to the units that are plugged into it. Was power from the laptop going out onto its HDMI cable and somehow leaking back to the Pi, even with the HDMI switch set against the Pi's cable? Or maybe the power was coming from the monitor which was also still plugged in? Either way, power was getting into the Pi via the HDMI cable. The proof of this came when I pulled the HDMI cable out of the Pi and it turned off instantly.
Now there are many people on the net who say HDMI can't supply power that way. Seems to me it can.
Sorting it out - almost
Stay with me, we're nearly there. I read on the net that HDMI could interfere quite badly with Wi-Fi. Hmm. Next I found claims that there's a problem with the first HDMI port on newer Raspberry Pi 4Bs that interferes with Wi-Fi. Oh great, because this port is the one that Raspberry Pi say you really should use when setting up a Pi - they caution against using the second port.
Sod that. I moved the HDMI cable from the first to the second port and rebooted. Wi-Fi's back folks - and it's also a bit quicker now. And the Pi turns off - sometimes.
If the laptop and monitor are plugged in, but the laptop is off or hibernating then the Pi will switch off using the USB cable switch. But if the laptop is running then the Pi won't turn off. If I pull the HDMI cable from the Pi with the laptop running it turns off and doesn't come on again when the cable is re-inserted. Obviously!
I'd love to get to the bottom of the HDMI cable issues, but enough of my life has been wasted on this. The worst that can happen is that I'll waste a bit of power occasionally running the Pi when I don't need it.
So, happy, happy, happy (ish). Apart from the aforementioned waste of precious life that is.😒
Have I fixed the Wi-Fi problem? Three days in and all is well, but only time will tell. If you're experiencing similar issues then switching HDMI ports could be worth a go. (Usual disclaimers apply re any damage you may cause.)
Moving to ethernet?
Our 1950s bungalow has incredibly strong brick interior walls that are pretty adept at blocking Wi-Fi signals. The signal in my "tinkering" room isn't too good at the best of times, let alone for the poor little Pi tucked in behind the laptop, underneath a rather large powered monitor speaker (see the photo above).So at some point I may run an ethernet cable from my Wi-Fi hub and plug the Pi into that. We'll see. Of course the laptop doesn't have an ethernet port - I mean that would be helpful - so I'll need to source a USB to ethernet adapter for it. One more thing to go wrong, eh!
Comments
Post a Comment