← index #15695Issue #16740
Off-topic · high · value 1.546
QUERY · ISSUE

RPI PICO W Regression: Setting DNS results in address resolution failure

openby vshymanskyyopened 2024-08-23updated 2025-10-24
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

RP2 W fails to receive UDP datagrams

closedby rynikeropened 2025-02-12updated 2025-02-13
bugport-rp2

Port, board and/or hardware

Pico W on Raspberry Pi Pico W

MicroPython version

MicroPython v1.25.0-preview.295.g30acb16ad on 2025-02-11; Raspberry Pi Pico W with RP2040

Reproduction

Simple receive program for the Pico W to run after
initializing the wireless hardware:

import socket
server_default_port = 50000
soc = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
soc.bind(('', server_default_port))
l, sender_address = soc.recvfrom(128)
print('l =', l)

This never returns from the call to recvfrom.
It works fine using an Espressif ESP-WROOM-32 board.

Simple test client:

import socket
server_default_port = 50000
IP_address = '192.168.100.91'
server_address = (IP_address, server_default_port)
soc = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
x = b'#0 D256\n'
n = soc.sendto(x, server_address)
print('sent', n, 'bytes', 'to', server_address)

Expected behaviour

Should have received the transmitted message.

Observed behaviour

No message received.

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied