Closed pkazmier closed 7 years ago
Perhaps this is because I don't advertise my SSID in my home network so it's a "hidden" network? I'll try not hiding it later today and see if I ever get the same results.
Thanks for opening this... I'm also having intermittent connection issues with a RPi3. I have the same code in two projects -- a slightly modified hello_wifi (it pulls the SSID and PSK from environment variables) and the cat_feeder project.
With hello_wifi firmware, it connects reliably. With cat_feeder, it mostly refuses to connect (like you I am assuming that the lack of log messages means it did not connect.) I was re-triple-checking the code and comparing the projects to make sure there was no typo, when I power-cycled the cat feeder and it DID connect. But only once. Good thing I have it on video. Many times before, and several times after that, it did not connect.
Is there a way to 'kick' the Wifi library to try again without re-starting? (Something to type at the iex console?)
I'm very suspicious of something weird with my wifi network, not the library code, but I don't know how to debug this.
I have a somewhat similar experience last weekend. I tried to setup wifi on my rpi1 with a usb wifi, which works properly with Rasparian. My wifi at home and at work use WPA2-PSK and the behavior is the same: After booting, the system seems to connect on the wifi level, but console output repeats the event :ifdown
a couple of times, during which DHCP starts up and fails. After that, networking is down.
The issues with rpi3 have been resolved by building the broadcom driver as a module and then mod probing it in. You can see an example of this in the hello_wifi example project https://github.com/nerves-project/nerves-examples/blob/master/hello_wifi/mix.exs#L16 https://github.com/nerves-project/nerves-examples/blob/master/hello_wifi/lib/hello_wifi.ex#L27-L30
There was an issue with :ifdown events not being handled properly when in an already down state. This has been corrected in 0.1.1. @alfert if you can give this a shot and if the problem remains, please open a new issue :bowtie: Thanks!
Just want say thanks guys! I had now the time to do a proper retest. The new hello_wifi example works after the obvious addition of
def kernel_modules("rpi"), do: ["8192cu"]
in mix.exs
. Perfect! 👍
I'm hesitant to open an issue on this as I cannot deterministically reproduce, but roughly 1 out of 30 times, Wi-Fi fails to connect when using my rpi3. This happened once when I was actually hooked up to my TV, so I was able to observe the difference in behavior between a normal startup and this bad scenario.
As you know, in the normal scenario the wifi manager starts up, and then numerous wifi events start happening - and generating many logging statements to the console. When the bad scenario took place, the only log message on my console was one about the wifi manager starting, and then dead silence - none of the other various events were ever logged.
To fix, I just power off and on my rpi3, and then it will usually connect fine. I haven't looked at the code, but it almost sounds like some race condition where an initial event is missed, which then impacts the rest of the wifi setup process.