Shop OBEX P1 Docs P2 Docs Learn Events
UDP receive for WX WiFi Module? — Parallax Forums

UDP receive for WX WiFi Module?

Can the WX WiFi module do UDP receive? Looks like it can only do http, websockets, and TCP according to the documentation. I waded into the source and it looks like some of the UDP files are still there but I don't know how to establish a UDP listener.

Comments

  • ke4pjwke4pjw Posts: 1,169

    I think I gave up too early. Looks like there is a token for UDP. CROSSES FINGERS

  • ke4pjwke4pjw Posts: 1,169

    OK, I got it to work (I think)

    @"Ken Gracey" I may have a Christmas present for those that purchased the Flip Holiday Lighting Kit. I will do my best, but I can't make any promises.

  • Nice!

    BTW... If there are any commands that need explaining, I probably used them recently and could help with explanations.

  • ke4pjwke4pjw Posts: 1,169

    @VonSzarvas said:
    Nice!

    BTW... If there are any commands that need explaining, I probably used them recently and could help with explanations.

    Will do. Much appreciated. I dug through the source code to figure out how to do UDP, and it took a little longer than I had hoped :smiley:

  • iseriesiseries Posts: 1,496

    UDP on the WX module has a bug in the code and may not work for receiving UDP packets.

    I had put a pull request out to fix that bug, but sadly it was never included in the current code.

    UDP send however does work and I have been using it for years now.

    I have also moved on to using ESP32, ESP32C3 that have faster processors, more memory, and use less power than the ESP8266 units.
    The conversion of the code from ESP8266 to ESP32 was major and required a lot of code changes.
    Some functions have not been implemented yet, but they are functions I don't use since I mostly use P2's.

    There is a discussion here.

    Mike

  • @iseries said:
    UDP on the WX module has a bug in the code and may not work for receiving UDP packets.

    I had put a pull request out to fix that bug, but sadly it was never included in the current code.

    If you are referring to these updates Mike.... https://github.com/parallaxinc/Parallax-ESP/pull/41
    Then I included them in 2020-2021, and they are in the current (and previous) modules shipping from Parallax.

    I'd suspect Terry will be OK for UDP, as I think he bought his module this year, or with the Holiday kit.

  • iseriesiseries Posts: 1,496

    @VonSzarvas ,
    Great, can that pull request be closed or deleted then?

    Mike

  • I'm not allowed near that stuff :) Don't know.

    -- but I will ask Jeff to check it, next time we meet.

  • ke4pjwke4pjw Posts: 1,169

    @iseries The firmware that came on the one I received, appears to receive UDP. You have to just send to 0.0.0.0 to make it open to listening from any unicast source.

  • Not sure what IDE Parallax is using under the hood for the ESP8266 module... i.e. Arduino, or Native Assembly code for the ESP8266, but either way the hardware TX & RX FIFOs for the ESP8266 are 128 bytes long which can be a limitation depending on how you handle the data stream. IOW some libraries used might be better than others handling the data. That Aside, I know that the RAW ESP8266 can handle just about anything you throw at it and there are lots of libraries available ... One thing to watch out for are examples that are blocking vs. non-blocking. Using non-blocking is always better in my honest opinion ... I've done UDP, TCP, etc. but lately I have moved to MQTT for many things using a local broker which is much easier than using POST and GET ... my Point to Point experience has been at least 350 feet according to Google and measuring location points on my 4 Acre property.

    ESP8266 based MQTT Clock that sets itself from the internet:
    https://www.youtube.com/shorts/9pLxBHhexDk
    ESP8266 based MQTT Clock Test Pattern:
    https://www.youtube.com/shorts/3tflK89joOE

  • iseriesiseries Posts: 1,496

    @"Beau Schwabe"
    The firmware is using native code that is built with Espressif. I have been using it with an application that receives multiple 1024 TCP packets of data with no issues.

    The reason for 1024 is a memory limitation with ESP8266.

    Mike

Sign In or Register to comment.