esp32 UDP socket bind()/recvfrom(): incoming empty packet crashes the system

Abierto
#736 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Empieza ejecutando pc-tester.py y notifications.py con MESSAGE vacío y con un payload, usando la configuración de ESP32-CAM descrita en el issue. Compara la temporización del bucle de recepción y la IP y el puerto indicados; se considera terminado cuando los paquetes UDP vacíos ya no provocan un bucle de recepción rápido y espurio ni bloquean el sistema.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I'm using the following image:

MicroPython v1.20.0-206-g33b403dfb-kaki5 on 2023-07-11; ESP32 CAMERA w/SSL (KAKI5) with ESP32 on an AiThinker ESP32-CAM.

When listening for incoming UDP packets, if the packet has a payload, everything works normally. If the packet is empty, instead of blocking, the receive loop begins looping very fast, receiving a bogus empty packet every time, which locks up the system.

Un-/comment MESSAGE="" after properly setting TARGET_IP in pc-tester.py (which is run from PC), and setting SSID and PASSWORD in notifications.py (which should be uploaded to mpy) to see the difference (you may also want to comment the wifi.ifconfig(...) line if using dynamic IP.

Notice the timestamps in the picture. For wrong.png, the timestamps are way too close, even though pc-tester.py is only sending once per second. The top picture is the wrong case, the bottom one is the correct case, when the udp packet has the payload foo. In the wrong case, the IP and port are then also reported incorrectly.

Is this a bug, or am I not paying attention to some quirk?

wrong
pc-tester.py.txt
notifications.py.txt
correct

Lenguaje dominante
Python
Estrellas
2.9k
Forks
1.1k
Merge medio
7 d 6 h
PR fusionados (30 d)
3

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de micropython/micropython-lib

Todos los issues de micropython/micropython-lib

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.