adafruit / nina-fw

Firmware for u-blox NINA W102 WiFi/BT module
85 stars 43 forks source link

server unstable when listenling to udp socket #64

Open AcThPaU opened 6 months ago

AcThPaU commented 6 months ago
esp.connect_AP(secrets["ssid"], secrets["password"])
pool = adafruit_connection_manager.get_radio_socketpool(esp)
sock = pool.socket(pool.AF_INET, pool.SOCK_DGRAM) # UDP socket
esp.start_server(1984, sock._socknum, conn_mode=1)

while True:
    n_bytes = esp.socket_available(sock._socknum)
    if n_bytes:
        bytes_read = esp.socket_read(sock._socknum, n_bytes)

Hardware: pyportal NINA version: 1.7.7 CP version: 9.1.0 beta3 esp32spi version: frozen

a client is constantly sending udp packets to the host address

after a few minutes n_bytes is always zero, and in some occasions TimeoutError: Timed out waiting for SPI char

AcThPaU commented 5 months ago

it's esp32spi library issue, the one frozen in pyportal 9.1.0 beta3 is buggy. ver. 8.3.1 works fine.

AcThPaU commented 5 months ago

TimeoutError: Timed out waiting for SPI char issue still present, it happens randomly from 30minutes to 12hours.