A CoAP over AT Lib for esp8266/esp32 with MicroPython.
from at_coap import AT_CoAP
# reveive message
def on_rev(rev_msg):
print('receive:', rev_msg)
# '_ERR_' for message sending failed
# uartid can only be 1 or 2 on esp32 / 0 on esp8266
coap = AT_CoAP(uartid=2, rxpin=16, txpin=17, callback=on_rev)
# send message
coap.send('123')
Only tested on ESP32 with QUECTEL BC28 NB-IoT module.
Only implements basic transceiver function and error handling function.
esp-atcoap-micropython © HAIZAKURA, Released under the MIT License.
Personal Website · GitHub @HAIZAKURA · Twitter @haizakura_0v0 · Telegram @haizakura