New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
picow_access_point example cannot be changed to other subnet #383
Comments
I can't think what would need to change - probably a bug. Is there any reason why are you using the tcp_server example rather than the access point example? |
Hi @peterharperuk |
You changed the gateway address to 192.168.3.1 ad it still offers 192.168.4.1? IP4_ADDR(ip_2_ip4(&state->gw), 192, 168, 4, 1); // Start the dhcp server As far as I'm aware the dhcp server uses its own address and just changes the last number. Do you have two netifs? If you have an AP and are also connected via STA mode - be aware of this bug #382 |
@peterharperuk Only the AP mode is activated at the time of running the TCP server. Also please find my screenshot above regarding the DHCP packet. |
If you changed the gateway address I don't see how it's possible for it to offer the wrong address. |
@peterharperuk I finally trace back to the source of the 192.168.4.1 For which when DHCP sends the offer, it uses 192.168.4.1 as the source. Unfortuantely due to the lack of knowledge I'm not sure why the system could not behave as normal when the IP address is changed to 192.168.3.1. Is this coincidence for pico-example to also choose the 192.168.4.1 as the default subnet for example in the AP mode? |
Ah right. Well done - I'd completely forgotten about that! |
I think they have to match, right? The cyw43-driver comes originally from Micropython and I "borrowed" this DHCP server from Micropython, so I suspect that's why they match. |
Thank you very much! |
Use CYW43_DEFAULT_IP_AP_ADDRESS instead. Fixes raspberrypi#383
Use CYW43_DEFAULT_IP_AP_ADDRESS instead. Fixes raspberrypi#383
The example code from https://github.com/raspberrypi/pico-examples/blob/master/pico_w/wifi/access_point/picow_access_point.c#L293 shows the default IP address for the DHCP server is 192.168.4.1. When I changed the subnet to, for example, 192.168.3.1, my TCP client could not connect to the pico w anymore.
Wireshark shows the DHCP server is still offering 192.168.4.1 as the router.
Unfortuantely I'm not professional in lwip implementation therefore I could not figure out where the IP address is hard coded.
The text was updated successfully, but these errors were encountered: