QUERY · ISSUE
RPI PICO W Regression: Setting DNS results in address resolution failure
bugport-rp2
Port, board and/or hardware
RPI PICO W
MicroPython version
MicroPython v1.24.0-preview.224.g6c3dc0c0b on 2024-08-22; Raspberry Pi Pico W with RP2040
Reproduction
import socket
import network
import asyncio
async def test():
print("Connecting to WiFi...")
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect("---", "---")
while not sta_if.isconnected():
await asyncio.sleep_ms(100)
print("Setting DNS...")
cfg = list(sta_if.ifconfig())
cfg[-1] = "8.8.8.8"
sta_if.ifconfig(cfg)
server, port = "blynk.cloud", 443
print("Resolving IP...")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
addr = socket.getaddrinfo(server, port)[0][-1]
print("Connecting...")
sock.connect(addr)
print("OK")
asyncio.run(test())
Expected behaviour
MicroPython v1.23.0 on 2024-06-02; Raspberry Pi Pico W with RP2040:
MPY: soft reboot
Connecting to WiFi...
Setting DNS...
Resolving IP...
Connecting...
OK
Observed behaviour
MicroPython v1.24.0-preview.224.g6c3dc0c0b on 2024-08-22; Raspberry Pi Pico W with RP2040:
MPY: soft reboot
Connecting to WiFi...
Setting DNS...
Resolving IP...
Traceback (most recent call last):
File "main.py", line 22, in test # socket.getaddrinfo
OSError: -2
Additional Information
No response
Code of Conduct
Yes, I agree
CANDIDATE · ISSUE
Cannot change default exposed IP (for DHCP etc) on Pico W running in AP mode (remains exposing default 192.168.4.x)
bugport-rp2
Port, board and/or hardware
Pico W
MicroPython version
MicroPython v1.26.0 on 2025-08-09; Raspberry Pi Pico W with RP2040
Reproduction
- Create a WLAN in IF_AP mode and set IP (and subnet, GW, DNS, etc) via WLAN.ifconfig
- Confirm that ifconfig() returns the expected parameters
- Conclude that the exposed IP address (incl DHCP range etc) when connecting clients to the AP remains the default 192.168.4.1
Expected behaviour
Expected the exposed DHCP gateway address and range to follow the set parameters, instead of the default 192.168.4.1
Observed behaviour
DHCP gateway address and range remain 192.168.4.1
Additional Information
(!) Do ensure ifconfig() is called áfter activating the WLAN, as otherwise it will definitely reset to the default settings, confirmed by printing them. So WLAN.active(true), then WLAN.ifconfig(...)
See also this link
and this link
Code of Conduct
Yes, I agree