Problems related to using WiFi Radio with ESP8266

Issue #529 resolved
xixicarry created an issue

Hello John, I used two ESP8266s to test WiFi Radio, one of them created a WiFi hotspot and the other connected to it. When I used the broadcast message building block, I found that the two boards couldn't communicate with each other when the IP was 255.255.255.255, and then I changed to the specified IP. 192.168.4.2 (the IP of the receiving board), the boards can communicate normally, what is the reason?
This is my test video

Comments (5)

  1. John Maloney repo owner

    When using UDP, the address 255.255.255.255 means "send the UPD packet to all devices within this subnet". However, it sounds as though the ESP8266 hotspot code might not support that form of UDP broadcast. (I'm surprised; I thought that address was part of the UDP standard since 1984.) Your change sends the UDP message to a specific board, but that requires that you know the IP address of that board and it is no longer a broadcast.

    You might try 192.168.4.255 (i.e. the first three bytes of the local IP address with 255 as the final byte). This a "subnet-directed broadcast address".

    If 192.168.4.255 works with the ESP8266 hotspot then it might make sense to change the WiFi Radio library to use that form of broadcast address.

  2. John Maloney repo owner

    At first I could not reproduce this problem.

    Then I discovered that, while UDP broadcasts to 255.255.255.255 sent by clients of the hotspot work as expected, broadcasts to 255.255.255.255 from the ESP8266 that is acting as the WiFi hotspot do NOT work. Surprising! One might argue this behavior is a bug in Espressif's networking stack.

    Fortunately, the "subnet-directed broadcast address" form works even from the ESP8266 serving as the hotspot. I will change the radio library to use that form.

  3. John Maloney repo owner

    Fixed in pilot release 1.2.81. You'll need to update the MicroBlocks firmware on your ESP8266 boards.

  4. Log in to comment