Hoppa till huvudinnehåll

CoAP Connector

Connector details CoAP

The CoAP connector allows the platform to receive data from CoAP-enabled devices and services.
Typically, the devices use NB-IoT or LTE Cat-M mobile networks as bearer protocols.

Ports

The platform can receive CoAP data on two ports:

  • 5683/UDP → CoAP: Unencrypted or protected with OSCORE ([RFC 8613])
  • 5684/UDP → CoAPs: CoAP over DTLS, secure

CoAP

Using the Generic CoAP Connector

Every server provides a standard generic CoAP connector. To use it:

  1. Create a generic node
    • As secret, define:
generic_coap_[your secret identifier]
  1. POST CoAP data from your device or service:
  • coap://staging.yggio.net:5683/in/generic
  • Use content format: application/json.
  1. JSON message body example:
{
"secret": "[your secret identifier]",
"encodedData": {
"hexEncoded": "32874387bd387342fed74843832"
}
}
  1. Add and existing or develop a new translator to decode the incoming data

Example: Node-RED CoAP Request

Below is an example Node-RED CoAP Request node that sends CoAP data to a device using the generic CoAP connector:

CoAP via Node-RED

Additional Information

  1. DTLS Encryption

    • The platform supports CoAP over DTLS.

    • PSK - Pre Shared Key, RPK - Raw Public Key or X.509 Certificates are required.

      DTLS Key TypeSecurityComplexityUse Case
      PSK (Pre-Shared Key)MediumLowConstrained devices, small fleets
      RPK (Raw Public Key)HighMediumMedium-scale deployments, secure key exchange without CA
      X.509 CertificatesVery HighHighLarge-scale deployments, enterprise/industrial IoT
    • → Contact your support representative if you want to enable DTLS.

  2. LwM2M Support

    • CoAP is commonly used as the transport protocol for LwM2M-enabled devices.
    • The platform includes a built-in LwM2M server.
    • → Contact your support representative if you want to use LwM2M.
  3. OSCORE (RFC 8613)

    • CoAP can be secured with end-to-end encryption using OSCORE.
    • The platform has built-in OSCORE support.
    • → Contact your support representative if you want to enable OSCORE.
  4. Vendor-Specific CoAP Endpoints

    • Many NB-IoT/Cat-M CoAP device manufacturers define their own CoAP API to post data.
    • Except LwM2M, there is no firm standard in CoAP, and variations often involve different CoAP endpoints (similar to custom HTTP endpoints).
    • To support such devices, a customized CoAP connector is usually required.
    • → Contact your support representative for assistance.