Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: RPi3A+ Network instability.
#1
Hi Folks,

There's quite a tale here so please bear with me.  The tl;dr is moOde 9 on a Pi3A+ becomes catatonic probably because of something in the wifi.

I upgraded my Pi Zero W to a Pi3A+ in preparation for the 64bit only moOde 9 series.  Even back on 8.3.9 I ran into wifi issues in which the syslog would show "wlan0 disconnected" periodically and the player would vanish off the network for a bit then the wlan0 would re-attach but the mDNS entries wouldn't work until the wifi connection on the client end was reset.  After a lot of trouble shooting (new power supply, new SD card, re-flashing, minimal config, etc etc) including returning the Pi and getting a new one to rule out hardware, I traced that problem to my router scanning for interference and changing channel.  Once I turned that "feature" off, it became stable.  The Pi Zero W in the same situation never saw that problem, nor does the Pi4B+ I have on the same wifi network.  I conclude that the wifi chip in the 3 must be a different beast.
Now, on to moOde 9 I find that the 3 will go into a catatonic state, I think mostly in situations where there is a deal of two-way network traffic (scanning the library, swapping from screen to screen while configuring and so on).  By catatonic I mean that the UI will swap happily to pages that have already been loaded (I assume using the browser cache) but will either show the spinner or the "reconnect" message indefinitely elsewhere. CTRL+F5 will give a "website not found" message in this state.  When connected via SSH the catatonia is more total.  The thing just stops.  No input is recognised, no commands run, if I'm tailing a log it simply shows the entry when the freeze began and never any more.  If I start a new SSH session in this state using the mDNS host name the window will sit waiting for the password prompt forever, I've waited several hours and seen no response.  SSH using the IP will result in "no route to host".  My router reports that the device is still attached.  This is why I call it catatonic, it is as if all the devices in the network think the Pi is "there" in some sense, but it isn't even as if they say it isn't responding, no "busy" type messages, no "connection lost" messages, just patiently waiting for a communication that never comes and never times out.  The only thing that wakes it all up is to pull the power and start the Pi3 up again.  When I do this leaving the SSH or UI connected they remain unresponsive until the boot completes at which point the UI will refresh and the SSH sessions will report a broken pipe and disconnect.
Given my experience with the "smart" feature on my ISP router (VirginMedia Hub 3 for those who know/care), I decided to finally buy my own (a Linksys M2000) thinking that would sort it out.  No joy, exactly the same (although everything else on my network is a LOT happier).

What do the logs have to say?  Pretty much nothing.  There's no syslog anymore obviously but tailing the journal (journalctl -f) shows no smoking gun.  The log will just stop.  The final message is the last of what ever it did before, often something to do with time sync or log cleanup.  Examining the log after a reboot shows that the beginning of the log shows the time and date of when the system froze last before it syncs with the network and jumps to the correct time.  Don't know if that's at all relevant other than it shows just how little was going on in the Pi when it freezes.

I've totally drawn a blank on how to diagnose this further.  I even installed wireshark, but ran out of talent on first launch (wow, I do not understand networks....)  I know it's not something in moOde, it must be related to the Bookworm under-pinning, but I've not found a way to trigger the issue using just Raspian.  I take heart from the fact that others have noticed a difference in network behaviour on Pi3 models and hope I'm not alone in this.  Has anyone else seen Pi3 wifi instability, or have any idea where I can look for a clue as to the cause?
----------------
Robert
Reply
#2
These types of network issues can be difficult to troubleshoot but let's take a step back to summarize things and see where that leads.

1. Pi-3A+
a. with r839 Bullseye drops off the network
b. with r9 Bookworm drops off the network
c. with plain RaspiOS no issues

2. Pi-4B and Zero W no issues

3. Virgin Hub 3 Router
a. Post describes wireless settings for addressing wifi dropouts
https://community.virginmedia.com/t5/Net...-p/5397800
b. Using only as a Gateway now with Linksys M2000 for wireless

The approach I would take is to analyze the success case #1 c.

1. Is it RaspiOS Lite, same kernel and OS version as moode 9 ?
2. Compare the NetworkManager connection file on RaspiOS vs moode 9 and If there are differences make the moode 9 file the same and then re-test.
sudo ls -l /etc/NetworkManager/system-connections/

Other things that can be tried

Install moode-player package on plain RaspiOS Lite. If no wifi dropouts then I can look at our image build. It's done using essentially the same pi-gen tooling thats used to make Raspberry Pi OS but there could be diffs.

I'll run one of my systems on a 3A+ and see what happens over the next couple of days.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Thanks for taking the time to think about this Tim. It is, as you say, very difficult to pinpoint what's up.
Regarding 1a. I got a stable connection on 8.3.9 by implementing the fixes you referred to in 3a (basically stopping the VM router from trying to be clever), 8.3.9 is also very happy on the Linksys router. I've been using this configuration for a week or so with no issues whatever. The rest of your statements are accurate. I would point out though that with just RaspiOS lite, I'm not doing the same level of network traffic, I stream a radio station into /dev/null via curl but that doesn't simulate the back and forth traffic that seems to be the main trigger of the freeze.

I will spend some time doing the analysis you suggest and report back.
----------------
Robert
Reply
#4
@the_bertrum 

I have a Pi3A+ running moOde 8.3.9 connected via WiFi to the router on the other side of the house and outputting via Bluetooth to a Sonos Move speaker in our sunroom. My partner and I listen to it every morning (when she and I can agree the playlist, that is).

When I tried moOde 9.0.1 I had no WiFi instabilities such as you report (for test periods up to an hour) but I experienced severe BT instability. (the subject of another thread when i get time to gather evidence).

In the interest of domestic tranquility I reverted to 8.3.9.

This morning I fired up moOde 9.0.1 on a spare 3A+, again connected via WiFi but outputting to a USB DAC, and don't seem to be experiencing any instabilities in the WebUI or SSH.

At this point I don't see any obvious way for me to repro your issue.

As for differences in wireless behavior between different Pi models, you have to read the tech specs very carefully to discern the differences in chips, layout, firmware, and antennas.

Regards,
Kent


PS - If I had it to do over again, I'd ignore the salesman's advice and not buy the Sonos Move just because it has a Bluetooth interface in addition to the Sonos WiFi interface. I'm planning to swap it out for conventional amp---possibly a HAT---and compact speakers.
Reply
#5
For the BT issue try the just released 9.0.2. The ISO image is at Linux kernel 6.6.31 and has all the latest firmware.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
(06-13-2024, 02:12 PM)Tim Curtis Wrote: For the BT issue try the just released 9.0.2. The ISO image is at Linux kernel 6.6.31 and has all the latest firmware.

I noticed that while doing an in-place update on a Pi 5B. About the Pi 3A+, see the support post I'm about to send.

Regards,
Kent
Reply
#7
So, a few more tests and a bit more information.
I've checked the files in /etc/NetworkManager/system-connections/ on moOde 9 and a vanilla RaspiOS, there are subtle differences:

Code:
network config moOde9.
master@prometheus:/etc/NetworkManager/system-connections $ sudo cat TeawithRuby.nmconnection
#########################################
# This file is managed by moOde          
# Wireless: Configured SSID              
#########################################

[connection]
id=TeawithRuby
uuid=3919fc65-ccc0-4c70-a814-e10cd355d633
type=wifi
interface-name=wlan0
autoconnect=true
autoconnect-priority=100
[wifi]
mode=infrastructure
ssid=TeawithRuby
hidden=false
[wifi-security]
key-mgmt=wpa-psk
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
Code:
RaspiOS network config:
master@prometheus:/etc/NetworkManager/system-connections $ sudo cat preconfigured.nmconnection
[connection]
id=preconfigured
uuid=4734a9c2-4806-4c25-8a8a-323bdd1d90b3
type=wifi
[wifi]
mode=infrastructure
ssid=TeawithRuby
hidden=false
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
[wifi-security]
key-mgmt=wpa-psk
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I copied the lines from type=wifi onwards into a moode 9 config file and got the same behaviour with the freeze.

So I did a fresh burn of moode 9.0.2 and put it in the Pi3A+ with no HAT or other stuff, left it out of the case and near the router.  Minimal config of network (pre-configured in the Imager), then the legacy mode so I could play stuff to the headphone socket without ALSA complaining there wasn't actually a device.  I played radio streams for a few hours with no issues, even swapping rapidly from one to another to another didn't cause issues.
Next I added the SMB share for my library and kicked off a scan.  Now I can get a freeze by doing stuff while the scan is running (swapping radio stations a few times will reliably kill it).  Wipe it and start again and kick off another scan but leave it alone while it scans and I find that the scan gets to the end (mpd log shows the last file has been processed) but the system is frozen and library doesn't load into the UI.  Reboot and there is no evidence that mpd scan ran at all.

So, maybe not network after all, but mpd?

I can definitely cause the freeze at will by running a scan then playing a radio stream or two.
----------------
Robert
Reply
#8
It wasn't in a metal case was it :-O

I've been running and playing music on my 3A+ since this morning, Allo Boss DAC.

Tested against my moode NAS (both NFS and Samba) and I didn't run into any issues when updating the Library from scratch. The WebUI was responsive, station switching fast etc. HTOP didn't show any weirdness.

I also repeated the Library update test (Samba) with the Headphone jack config i.e., removing the Boss DAC and switching Integrated audio to Firmware mode (Legacy) and no issues.

Are the network stats clean when doing the Library update?
ifconfig
iwconfig
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
(06-13-2024, 07:58 PM)Tim Curtis Wrote: It wasn't in a metal case was it :-O

I've been running and playing music on my 3A+ since this morning, Allo Boss DAC.

Tested against my moode NAS (both NFS and Samba) and I didn't run into any issues when updating the Library from scratch. The WebUI was responsive, station switching fast etc. HTOP didn't show any weirdness.

I also repeated the Library update test (Samba) with the Headphone jack config i.e., removing the Boss DAC and switching Integrated audio to Firmware mode (Legacy) and no issues.

Are the network stats clean when doing the Library update?
ifconfig
iwconfig

Thanks Tim.  No it wasn't a metal case Smile just wanted to remove even that as a potential cause.

It HAS to be something to do with my particular setup some how. Otherwise there'd be lot more noise about this I'm sure.  I'll try the network stats later today.
----------------
Robert
Reply
#10
I would also try starting a Ping test from the Pi to your NAS or Pi to Router with nothing happening on the Pi. Note the ping times to get a baseline. Then do a Lib update or Re-gen and see if the ping times increase.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: