Open pnunn opened 1 month ago
I've tried adding a static IP to the DHCP example, but the same behaviour is seen. With debug = true, the log stack is.
time=1970-01-01T00:00:23.155Z level=DEBUG msg=rx len=258 hdr=asyncev time=1970-01-01T00:00:23.156Z level=DEBUG msg=rx len=260 hdr=asyncev time=1970-01-01T00:00:23.157Z level=INFO msg=rxEvent event=AUTH status=0 reason=0 flags=0 dev.linkstate=1 time=1970-01-01T00:00:23.157Z level=ERROR msg="wifi join faled" err="join:wait for ssid" time=1970-01-01T00:00:28.158Z level=INFO msg=joinWpa2 ssid=EarlNetNew len(pass)=12 time=1970-01-01T00:00:28.159Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=19 time=1970-01-01T00:00:28.160Z level=DEBUG msg=rx len=259 hdr=asyncev time=1970-01-01T00:00:28.171Z level=DEBUG msg=rx len=258 hdr=asyncev time=1970-01-01T00:00:28.182Z level=DEBUG msg=rx len=260 hdr=asyncev time=1970-01-01T00:00:28.182Z level=INFO msg=rxEvent event=AUTH status=0 reason=0 flags=0 dev.linkstate=1 time=1970-01-01T00:00:28.193Z level=DEBUG msg=rx len=259 hdr=asyncev time=1970-01-01T00:00:28.204Z level=DEBUG msg=rx len=260 hdr=asyncev time=1970-01-01T00:00:28.215Z level=DEBUG msg=rx len=260 hdr=asyncev time=1970-01-01T00:00:28.216Z level=INFO msg=rxEvent event=AUTH status=5 reason=0 flags=0 dev.linkstate=4 time=1970-01-01T00:00:28.227Z level=DEBUG msg=rx len=258 hdr=asyncev time=1970-01-01T00:00:28.227Z level=INFO msg=rxEvent event=SET_SSID status=1 reason=0 flags=0 dev.linkstate=3 time=1970-01-01T00:00:28.238Z level=DEBUG msg=rx len=259 hdr=ctl time=1970-01-01T00:00:28.239Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC len=4 time=1970-01-01T00:00:28.250Z level=DEBUG msg=rx len=256 hdr=ctl time=1970-01-01T00:00:28.251Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=23 time=1970-01-01T00:00:28.262Z level=DEBUG msg=rx len=259 hdr=ctl time=1970-01-01T00:00:28.263Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=31 time=1970-01-01T00:00:28.274Z level=DEBUG msg=rx len=259 hdr=ctl time=1970-01-01T00:00:28.275Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=27 time=1970-01-01T00:00:28.286Z level=DEBUG msg=rx len=259 hdr=ctl time=1970-01-01T00:00:28.387Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC_PMK len=68 time=1970-01-01T00:00:28.388Z level=DEBUG msg=rx len=256 hdr=ctl time=1970-01-01T00:00:28.389Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_INFRA len=4 time=1970-01-01T00:00:28.390Z level=DEBUG msg=rx len=256 hdr=ctl time=1970-01-01T00:00:28.390Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_AUTH len=4 time=1970-01-01T00:00:28.391Z level=DEBUG msg=rx len=256 hdr=ctl time=1970-01-01T00:00:28.392Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WPA_AUTH len=4 time=1970-01-01T00:00:28.403Z level=DEBUG msg=rx len=256 hdr=ctl time=1970-01-01T00:00:28.404Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_SSID len=36 time=1970-01-01T00:00:28.435Z level=DEBUG msg=rx len=256 hdr=ctl
I seems the SSID isn't found????
I'd suggest going into the router configuration and checking the security configuration- also make sure you match the case of the SSID perfectly! Right now cyw43439 driver chooses WPA2 security here https://github.com/soypat/cyw43439/blob/a62ee4027d66bc0f92d4f7bc3902627fb8e6ed6b/wifi.go#L321. If you are using a different security configuration I'd suggest either changing your router security to WPA2 or cloning this repo and setting the security to your router's current configuration.
This is what a a succesful connection looks like:
Thanks so much for getting back to me on this Patricio. I think that the system I'm trying to connect to is configured as you require. (Shot attached).
The SSID is correct and the password seems to be passed correctly as well (from some debug code).
I can't connect to an open network here either, but the mobile phone hot spot works perfectly.
Is there any more debugging I can turn on?
Yes, in examples you can set log level to the lowest level (trace) by setting Level here: https://github.com/soypat/cyw43439/blob/a62ee4027d66bc0f92d4f7bc3902627fb8e6ed6b/examples/dhcp/main.go#L19
Set the Level field of slog.HandlerOptions to -99
to enable all logging.
OK, starting to get some more information now. I did a dump of an attempt to connect to my home wifi and to my phone hotspot (attache, home wifi net.log, phone hotspot.log).
The files are the same up to line 569 in the net.log which matches to 591 in the hotspot log.
Here the hotspot connects, the home network throws
time=1970-01-01T00:00:06.758Z level=INFO msg=rxEvent event=AUTH status=0 reason=0 flags=0 dev.linkstate=1
570 │ time=1970-01-01T00:00:06.758Z level=DEBUG-3 msg=tryPoll:start
571 │ time=1970-01-01T00:00:06.759Z level=DEBUG-3 msg=f2PacketAvail:start
572 │ time=1970-01-01T00:00:06.760Z level=ERROR msg="wifi join faled" err="join:wait for ssid"
573 │ time=1970-01-01T00:00:11.761Z level=INFO msg=joinWpa2 ssid=EarlNetNew len(pass)=12
574 │ time=1970-01-01T00:00:11.761Z level=DEBUG-2 msg=set_iovar var=ampdu_ba_wsize
575 │ time=1970-01-01T00:00:11.762Z level=DEBUG-2 msg=sendIoctlWait:start
576 │ time=1970-01-01T00:00:11.763Z level=DEBUG-2 msg=log_read
577 │ time=1970-01-01T00:00:11.765Z level=DEBUG-1 msg="000004.317 wl0: JOIN: authentication failure, no ack"
578 │ time=1970-01-01T00:00:11.765Z level=DEBUG-2 msg=waitForCredit:start
579 │ time=1970-01-01T00:00:11.766Z level=DEBUG-2 msg=sendIoctl:start
580 │ time=1970-01-01T00:00:11.767Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=19
581 │ time=1970-01-01T00:00:11.768Z level=DEBUG-2 msg=pollForIoctl:start
582 │ time=1970-01-01T00:00:11.768Z level=DEBUG-3 msg=tryPoll:start
The password for the home network ends in a % character, could that be causing issues?
OK, I set a second SSID and gave it a password without any punctuation and it connected.
Nope.. more testing and it seems to be the AES encryption that's causing the issue. Turn it from Auto to AES only, and it fails to auth every time.
P.
So the % punctuation makes AES fail every time?
No, sorry to confuse things. I don't think the % has anything to do with it, its the AES that seems to be the problem.
If I set the encryption to auto it connects happily.
I tried to connect the pico w to two different wifi networks (using quite powerful AP's) but in both cases (one an open network, the other encrypted) could not get the device to connect.
This is the case with two different pico w devices.
I tried to connect to my phone hotspot and that did work.
How would I fault find this issues? ` The failures looked like time=1970-01-01T00:00:13.664Z level=INFO msg=rxEvent event=SET_SSID status=1 reason=0 flags=0 dev.linkstate=3
time=1970-01-01T00:00:13.665Z level=ERROR msg="wifi join faled" err="join:SET_SSID failed"
time=1970-01-01T00:00:18.666Z level=INFO msg=joinWpa2 ssid=EarlNetNew len(pass)=12
time=1970-01-01T00:00:18.666Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=19
time=1970-01-01T00:00:18.677Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:18.678Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC len=4
time=1970-01-01T00:00:18.689Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:18.690Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=23
time=1970-01-01T00:00:18.701Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:18.702Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=31
time=1970-01-01T00:00:18.713Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:18.714Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=27
time=1970-01-01T00:00:18.725Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:18.825Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC_PMK len=68
time=1970-01-01T00:00:18.836Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:18.837Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_INFRA len=4
time=1970-01-01T00:00:18.848Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:18.849Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_AUTH len=4
time=1970-01-01T00:00:18.860Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:18.861Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WPA_AUTH len=4
time=1970-01-01T00:00:18.872Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:18.872Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_SSID len=36
time=1970-01-01T00:00:18.903Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:22.145Z level=DEBUG msg=rx len=258 hdr=asyncev
time=1970-01-01T00:00:22.146Z level=DEBUG msg=rx len=260 hdr=asyncev
time=1970-01-01T00:00:22.146Z level=INFO msg=rxEvent event=AUTH status=0 reason=0 flags=0 dev.linkstate=1
time=1970-01-01T00:00:22.147Z level=DEBUG msg=rx len=259 hdr=asyncev
time=1970-01-01T00:00:22.148Z level=DEBUG msg=rx len=258 hdr=asyncev
time=1970-01-01T00:00:22.149Z level=DEBUG msg=rx len=260 hdr=asyncev
time=1970-01-01T00:00:22.149Z level=INFO msg=rxEvent event=AUTH status=0 reason=0 flags=0 dev.linkstate=1
time=1970-01-01T00:00:22.150Z level=DEBUG msg=rx len=259 hdr=asyncev
time=1970-01-01T00:00:22.151Z level=DEBUG msg=rx len=258 hdr=asyncev
time=1970-01-01T00:00:22.152Z level=INFO msg=rxEvent event=SET_SSID status=1 reason=0 flags=0 dev.linkstate=3
time=1970-01-01T00:00:22.153Z level=ERROR msg="wifi join faled" err="join:SET_SSID failed"
time=1970-01-01T00:00:27.153Z level=INFO msg=joinWpa2 ssid=EarlNetNew len(pass)=12
time=1970-01-01T00:00:27.154Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=19
time=1970-01-01T00:00:27.165Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:27.166Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC len=4
time=1970-01-01T00:00:27.177Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:27.178Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=23
time=1970-01-01T00:00:27.189Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:27.189Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=31
time=1970-01-01T00:00:27.200Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:27.201Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_VAR len=27
time=1970-01-01T00:00:27.212Z level=DEBUG msg=rx len=259 hdr=ctl
time=1970-01-01T00:00:27.313Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WSEC_PMK len=68
time=1970-01-01T00:00:27.324Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:27.325Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_INFRA len=4
time=1970-01-01T00:00:27.336Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:27.336Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_AUTH len=4
time=1970-01-01T00:00:27.347Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:27.348Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_WPA_AUTH len=4
time=1970-01-01T00:00:27.359Z level=DEBUG msg=rx len=256 hdr=ctl
time=1970-01-01T00:00:27.360Z level=DEBUG msg=sendIoctl kind=2 cmd=SET_SSID len=36
time=1970-01-01T00:00:27.391Z level=DEBUG msg=rx len=256 hdr=ctl
This was the case with both my code and any of the example code.
Ta.