CoAP on XBee3

There is a bit of documentaiton on CoAP here:

https://www.digi.com/resources/documentation/Digidocs/90002258/Default.htm#tasks/t_example_python_coap.htm

but it tells you to download a CoAP library from https://pypi.org/project/CoAPthon/ and looking at that library it does not seem to be built for micropython. I’m not sure what this documentation really is, as it refers to XBee3 but then it lists a bunch of steps to perform on a Host PC, without ever connecting the dots re: what you do on the XBee3 / Micropython side.

What’s up with this - is there a CoAP library I can just download into the XBee3?

I did find a third party library:

https://github.com/insighio/microCoAPy

but it does not support DTLS which is pretty critical. I think the ssl library in the Xbee3 is ussl (https://docs.micropython.org/en/latest/library/ussl.html#functions) which does not support datagrams.

Hello,

The CoAP example/documentation you linked to is under the section for performing CoAP using transparent mode on the XBee device – https://www.digi.com/resources/documentation/Digidocs/90002258/Default.htm#containers/cont_examples_iot_protocols.htm

XBee Cellular and XBee 3 Cellular do not currently support DTLS.

Thank you. If I were to find a DTLS library that worked in micropython, I should be able to do this myself by just creating the packets and sending them over a SOCK_DGRAM though?

Unfortunately I think you’ll be hard pressed to find (or write) a pure-MicroPython implementation of DTLS. But if you do, and are able to use that library from MicroPython (i.e. it doesn’t consume all available memory) then yes, absolutely.

In future firmware versions Digi may be able to incorporate DTLS functionality. No guarantees on when or if that might happen.

For our own reference, are you using your own CoAP server with DTLS, or a third party service?