nymea / berrylan

Raspberry Pi WiFi setup
http://berrylan.org
GNU General Public License v3.0
334 stars 55 forks source link

After reboot, wifi interface doesn't come up, bluetooth doesn't find device #82

Open DFC72 opened 1 year ago

DFC72 commented 1 year ago

I've installed onto the following platform: Pi Zero W Raspbian 32-bit Lite

Performed a fresh install of the OS. sudo apt update && sudo apt upgrade -y

added repository like this: echo "deb http://repository.nymea.io bullseye rpi" | sudo tee /etc/apt/sources.list.d/nymea.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key A1A19ED6

updated apt: sudo apt update

installed nymea-networkmanager: sudo apt install nymea-networkmanager dirnmgr

No issues there...

Disabled dhcpd: sudo systemctl disable dhcpcd

Rebooted: sudo reboot

After reboot, the wlan0 interface doesn't come up on the original SSID, and when I try to connect to the Pi using the iPhone app, it doesn't find the pi. I've also tried disabling the filter, but there are a ton of BT devices with no name, and no way to see which may be the Pi.

Where to go from here?

How do I re-enable the wlan0 interface on the Pi?

mzanetti commented 1 year ago

It should work just fine, but note that the Pi Zero W is really slow, it may take several minutes until its fully bootet and visible on Bluetooth.

DFC72 commented 1 year ago

I'll try again and wait longer before I reboot! I've got a Zero 2 W coming for my prototype version I'm sending out, so hopefully that will work.

Alternatively, I could build on a RPi4, and it should be able to proof the build and then just bring it up on the Zero after switching in the SD card?

mzanetti commented 1 year ago

Yeah, should work I suppose.

The Zero 2 W is definitely much faster than the v1, yes.

DFC72 commented 1 year ago

Ok, this is weird now - I pulled the sd and put it in the RPi 4B and it works fine. I delete the SSId profile by running sudo nmcli con del 'CONNECTION_NAME' and the wifi connection drops. I open the app on my iPhone and it finds it right away. I connect WiFi using the app and everything works fine.

I try the same thing on the Pi Zero W - waited looking at the app on my phone and it didn't show up - even after 15m....

Is there some difference in hardware between the two that would prevent this from working on the Zero W? (BT4 on the ZeroW vs BT5 on the Pi4B?)

mzanetti commented 1 year ago

There is a difference in the hardware, yes, in that the RPi 4B (starting from the RPi 2) is a armhf machine, while the RPi 0 W (just like the RPi 1) is a armel machine (with some custom hard-float extensions). However, if you're using the rpi component of the nymea repo that should not be an issue as packages in there are build to to support the RPi0/1 architecture.

Another thing I could think of, is maybe the smaller memory size of the Pi Zero. Depending on what else there's running, perhaps it's running out of memory and being killed by the OS. I suppose a swap file on the SD card could help with that, dunno... In order to track that down, the most useful thing you could do is to connect a serial console to the UART pins and watch the boot logs, as well as checking nymea-networkmanager logs. If you don't have that at hand, perhaps fetching the logs from the SD card (syslog, nymea-networkmanager log) with your Pi4 or something may give some clues too...

Frankly, I've stopped bothering with the Pi Zero W a wile ago as it's really /that/ low end hardware to not serve well for a general purpose computing device. We'll likely even drop support for the Pi 0/1 architecture soon (it's 11 year old hardware by now).

DFC72 commented 1 year ago

I wanted to use the smaller dimensions of the Pi Zero (and 2) for a product I'm prototyping - The 4B is overkill for me... plus expensive and hard to find currently. If I could find a supply if 1/2GB models that may be an option, but still 3-4 times more expensive than the Zero platform. Would the Pi Zero 2W be supported in the future with the 4-core cpu?

I'll try the swap file increase to 1GB as it's still at the default of 100MB- I have direct access to the device as it's plugged into a monitor and keyboard currently while I'm prototyping... Would that give me access to the boot logs?

As for the nymea logs, I looked for them with fzf but couldn't find them - could you pls point me in the right direction? Do I need to use journalctl: sudo journalctl -u nymea-networkmanager ?

I also found this thread with someone else having the same issue a few years ago - https://github.com/nymea/nymea-networkmanager/issues/29

Last update was as you see - Could be a race condition with some of the later builds and related to arm6 vs arm7?

My Zero 2 W should be arriving this week so I'll see if the newer cpu fixes this issue and report back unless you have a further idea based on the older post ?

mzanetti commented 1 year ago

Yes, the Zero 2 W (which is comparable to a RPi 3 in terms of horse power) should be good for another while still.

DFC72 commented 1 year ago

Just received my Pi Zero 2W - Can confirm that this issue does not occur on the newer Zero.