Has anyone set up a Pico W as an Access Point with a different IP address.
No matter what I do it always defaults to 192.168.4.1.
The Pico W is connected to a PC USB running Thonny.
Stop/Restart clicked.
Python script run.
It looks like when you set the IP, Subnet, Gateway, and DNS using ifconfig()
and then activate it the default values are used not the ones set. To me this is an error in the Micro Python implementation for the Pico W.
Also the IP Access Point remains active until the Pico W is powered off. Even when the program is stopped. Connect and disconnect to the ssid ok; but of course no web page when program stopped, as you would expect.
btw the Access Point works perfectly using the default IP address.
I can connect using my phone to the ssid with the password.
Google Chrome then displays the program web page when accessing the default IP.
I have been through the documentation on how to set up WLAN.
All other set ups I have, tried work nicely, internet access ok, web page display ok, etc.
I am very impressed with the operation of the Pico W and how easy it is to use with Micro Python.
Its just the Access Point IP I am unable to change.
Regards
Jim
# python code to set up access point and IP address
ap = network.WLAN(network.AP_IF)
ap.config(ssid=ssid, password=pw)
print('01 ',ap.ifconfig())
ap.ifconfig(('192.168.12.1','255.255.255.0','192.168.12.1','0.0.0.0'))
print('02 ',ap.ifconfig())
ap.active(True)
print('03 ',ap.ifconfig())
while ap.active() == False:
pass
print('Connection successful')
print('04 ',ap.ifconfig())
# Shell output
01 ('0.0.0.0', '0.0.0.0', '0.0.0.0', '0.0.0.0')
02 ('192.168.12.1', '255.255.255.0', '192.168.12.1', '0.0.0.0')
03 ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')
Connection successful
04 ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')