soypat/cyw43439

Not getting DHCP IP address from TP-Link AC1750 wifi router

Closed this issue · 5 comments

I tried the tcpserver example with my test router and my Starlink router. The example connects fine with my Starlink router but fails to wifi connect to the TP-Link router, model AC1750.

Will need to sniff wireshark traffic on router side to troubleshoot. May need to install openWRT on the TP-Link to get a wireshark trace.

cmol commented

Is it DHCP that fails or the WiFi association itself? I haven't tested the latest example yet, but DHCP was still broken for me last time. I made a bunch of packet dumps and there might be something with the parsing order of the DHCP options.

Oh, crap, good question. It's DHCP that's failing, not wifi connect. I'm going to close this issue and start a freah one. Thanks for catching that @cmol!

Re-opened this issue and update title to reflect the DHCP failure, not wifi connect failure.

So I updated the firmware on the TP-link AC1750 router to latest OpenWRT firmware, and now I'm getting a DCHP IP address:

sfeldma@nuc:~/work/cyw43439$ tinygo flash -target=pico -opt=1 -stack-size=32kb -size=short -monitor  ./examples/tcpserver/
   code    data     bss |   flash     ram
 564232   15676    3916 |  579908   19592
Connected to /dev/ttyACM1. Press Ctrl-C to exit.
starting program
time=1970-01-01T00:00:02.001Z level=DEBUG msg="starting program"
wifi join failed: SET_SSID failed
wifi join failed: join failed



MAC: 28:cd:c1:01:13:7c
dhcp ongoing...
time=1970-01-01T00:00:20.929Z level=DEBUG msg=UDP:send plen=590
time=1970-01-01T00:00:20.979Z level=DEBUG msg=UDP:recv plen=300
time=1970-01-01T00:00:20.980Z level=DEBUG msg=dhcp-rx msgtype=2
time=1970-01-01T00:00:20.981Z level=DEBUG msg=UDP:send plen=590
time=1970-01-01T00:00:21.030Z level=DEBUG msg=UDP:recv plen=300
time=1970-01-01T00:00:21.030Z level=DEBUG msg=dhcp-rx msgtype=5
DHCP complete IP: 10.0.0.170
start listening on: 10.0.0.170:1234
time=1970-01-01T00:00:26.129Z level=DEBUG msg=ARP:recv op=2
time=1970-01-01T00:00:26.130Z level=DEBUG msg=ARP:send isReply=true

So the open issue is why does stock firmware on TP-Link AC1750 not give out a DHCP lease? Will need to revert back to factory firmware to find out...

Reverting back to factory firmware fixes the issue also. So now I've lost my failing test case. Oh well, we'll keep an eye out and re-open this issue if it pops up again.