Page 7 of 7

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 5:40 am
by kc7ngc
So if this does turn out to be entropy starvation for the wpa supplicant. It would makes sense. I couldn't figure out why pistar image would sometimes not work on a A+ on boot but a fresh stock rasbian buster image would work every time.

rng-tools and the hardware RNG are enabled by default in the stock buster build. But they aren't present in the 4.1 RC builds of Pi-star which is also buster. Would also explain why my A+ stopped malfunctioning awhile ago on pi-star as I had install rng-tools to fix problem where nginx didn't want to work on boot with a TLS certificate. Didn't think it might be related to my wifi issues going away.

So I guess this is a question for Andy. Was the 4.1 RC candidate based on a fresh buster image or was it an upgrade from stretch to buster?

Looking at the /etc/apt/trusted.gpg file it would appear that the 4.1 RC was upgraded from jessie->stretch->buster. Which would explain the absence of the rng-tools in the install as well as some other differences I had noticed between the pi-star 4.1 RC's and regular rasbian buster. If you upgrade from stretch to buster it maintains the same core legacy service configs and doesn't install or configure the newer services such as rpg-tools and some other items that would be present in a fresh image. As doing so would break legacy services that existed prior to the upgrade.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 10:58 am
by MW0MWZ
I agree that using software based entropy generation isn't the "best possible solution" but I am also supporting more than just Raspberry Pi foundation hardware, and some of that does not have onboard RNG support.

There are a LOT of OS related changes that it was easier to migrate forwards rather than rebuild - but that is starting to cause a lot of pain.

I am already quite aware that the next major build is a re-write and will be quite different in many regards, not least a fresh install of the OS.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 5:31 pm
by ea7gwc
This morning I added.
kc7ngc wrote: Fri Dec 20, 2019 7:08 pm sudo apt-get install rng-tools
then
sudo systemctl disable haveged
And I haven't had a bad start, pi-star starts
fast and connects to the wifi without problems.
We continue testing.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 5:47 pm
by KE0FHS
Interesting.

After a day and a half of things appearing to work better, I'm experiencing this issue again this morning.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 7:51 pm
by kc7ngc
MW0MWZ wrote: Sat Dec 21, 2019 10:58 am I agree that using software based entropy generation isn't the "best possible solution" but I am also supporting more than just Raspberry Pi foundation hardware, and some of that does not have onboard RNG support.
There is no real harm with shipping rng-tools on a image and having that image used on a device with out a True hardware RNG. As the startup code checks to see if its supported and just doesn't start the service.

In theory there also isn't any harm with having haveged installed (as it is on current Beta RC) and running it concurrently with rng-tools. As both haveged and rngd service will receive notification from the kernel when entropy drops below value in /proc/sys/kernel/random/write_wakeup_threshold and try to populate the pool. Which creates a harmless race condition between the two.

In many cases neither wins as both end up populating pieces of the entropy pool at same time during normal system operation.

Having rng-tools does tend to speed up boots as at boot havenged will have to wait for entropy to be built in software. If havenged (software based PRNG) doesn't have enough entropy it waits to fill the pool and the rngd service will win. Usually what happens at boot on a rPi. If not running Rpi hardware and no hardware RNG then rngd won't start at all and system will wait for havenged to populate the entropy pool.

So if you don't want to disable havenged service to maintain compatibility with other hardware you wouldn't have to. I just do it as I like my Pi to run in a more defined state so knowing hardware RNG is running all the time just removes another variable to worry about. Also makes SSH sessions, wifi sessions more secure.

If going the persistent seed route on the images. Would be a good idea to make sure when shipping your golden image to delete the seed file from the image. That way when folks boot the image for the first time, there will be no common seed to inherit and no common weakness. Could even put something in your startup script to check if seed is there, then populate it on first boot then do a reboot to make sure wifi comes up successfully.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 10:02 pm
by ea7gwc
KE0FHS wrote: Sat Dec 21, 2019 5:47 pm Interesting.

After a day and a half of things appearing to work better, I'm experiencing this issue again this morning.
You tried the solution provided by kc7ngc ?
Since I installed the PI3 A + it works perfectly.

So far it has not failed in any startup, and I have done many.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 10:19 pm
by KE0FHS
ea7gwc wrote: Sat Dec 21, 2019 10:02 pm You tried the solution provided by kc7ngc ?
Since I installed the PI3 A + it works perfectly.
So far it has not failed in any startup, and I have done many.
Not yet. So far, I've just getting all my hotspots on RC7. With several of them, that has meant starting with a fresh image, so it has been a slow process.

From the next post by kc7ngc, it looks like only the first command is actually necessary, so that may be the next thing I try.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sat Dec 21, 2019 11:23 pm
by KE0FHS
KE0FHS wrote: Sat Dec 21, 2019 10:19 pm
ea7gwc wrote: Sat Dec 21, 2019 10:02 pm You tried the solution provided by kc7ngc ?
Since I installed the PI3 A + it works perfectly.
So far it has not failed in any startup, and I have done many.
Not yet. So far, I've just getting all my hotspots on RC7. With several of them, that has meant starting with a fresh image, so it has been a slow process.

From the next post by kc7ngc, it looks like only the first command is actually necessary, so that may be the next thing I try.
Okay, I ran just the first command (sudo apt-get install rng-tools) on one of my 4B hotspots which had been having trouble connecting to my WiFi even after being upgraded to RC7. Results so far after multiple power ups is that it is starting very quickly and connecting to my WiFi every time. We'll see how it goes for the next day or two, but so far, so good!

Re: Raspberry Pi 3A+ WiFi issue

Posted: Sun Dec 22, 2019 12:00 am
by KE0FHS
Same good initial results with a 3A+ hotspot.

Re: Raspberry Pi 3A+ WiFi issue

Posted: Mon Dec 23, 2019 10:40 pm
by ea7gwc
After three days using 3A +, tell them
Everything works OK. Goodbye to the problems
Wifi boot.
Thank you very much for sharing your knowledge.