Skip to content
Stand with Ukraine flag

Device connectivity

Devices connect directly to ThingsBoard Edge, not to the cloud server. Edge exposes the same transport protocols as the ThingsBoard server — MQTT, HTTP, CoAP, LwM2M, and SNMP — on the local network. Devices communicate with Edge even when the internet connection is unavailable.

ProtocolDefault portTLS/DTLS port
MQTT18838883
HTTP8080443
CoAP5683 (UDP)5684 (DTLS)
LwM2M5685 (CoAP), 5687 (TCP)5686 (CoAP/DTLS), 5688 (TCP/TLS)
SNMP161 (UDP)

Use the hostname or IP address of your Edge instance in place of $EDGE_HOST in all examples below.

Each device authenticates with an access token or an X.509 certificate. Access tokens are the simplest option and work with all three protocols.

  1. Log in to your Edge instance and go to Entities → Devices.

  2. Open the device and click Copy access token on the Device details page.

Store the token as an environment variable for convenience:

Terminal window
export ACCESS_TOKEN=your_device_token
export EDGE_HOST=your_edge_host_or_ip

Use the protocol your device supports to send a test telemetry message.

Terminal window
mosquitto_pub -d \
-h $EDGE_HOST \
-t "v1/devices/me/telemetry" \
-u "$ACCESS_TOKEN" \
-m '{"temperature": 25}'

After sending, go to Entities → Devices, open the device, and select the Latest telemetry tab. The temperature key appears with the value you sent.

Devices that need to receive RPC commands or shared attribute updates must subscribe to the appropriate topics or long-poll the HTTP endpoint. For the full API reference, see:

For production deployments where access tokens are not acceptable, ThingsBoard supports X.509 certificate-based authentication. Provision the device certificate via Device credentials on the Device details page.

For the full certificate provisioning reference, see Mutual TLS for MQTT.