Skip to content

Request to include datagram type for sockets #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Copperhead-Labs opened this issue Nov 24, 2019 · 3 comments · Fixed by #127
Closed

Request to include datagram type for sockets #83

Copperhead-Labs opened this issue Nov 24, 2019 · 3 comments · Fixed by #127
Labels
enhancement New feature or request

Comments

@Copperhead-Labs
Copy link

Is it possible to enhance the adafruit_esp32spi_socket.socket class to include datagram (UDP) socket type? This needed to allow connections with UDP only services like NTP.

@docmollo
Copy link
Contributor

I don't know if there are plans to add UDP socket support, but you mentioned NTP, so I thought I'd let you know the NINA firmware on the ESP32 does NTP and that time is available via this library's get_time() in case that is useful.

@brentru
Copy link
Member

brentru commented Nov 25, 2019

@cs0ckn Yep - but you will need to do some hacking to expose it. As mentioned by @docmollo, there's a NTP method in ESP32SPI which uses the ESP-IDF's NTP API directly (nice helper library here: https://github.com/adafruit/Adafruit_CircuitPython_NTP)

In adafruit_esp32spi, you can specify the conn_mode as UDP_MODE (https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/master/adafruit_esp32spi/adafruit_esp32spi.py#L616).

Feel free to submit a PR!

@kattni kattni added the enhancement New feature or request label Apr 29, 2020
@anecdata
Copy link
Member

anecdata commented Sep 15, 2021

There was a PR to allow socket-level (datagram) UDP clients #127, example here https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/main/examples/esp32spi_udp_client.py.

@anecdata anecdata linked a pull request Sep 15, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants