MQTT over TLS
Devices on WiFi or Ethernet: ESP32, Raspberry Pi, gateways, PLC bridges.
The usual choice. Start here.
The SiliconWit.io broker
Connect with MQTT, MQTT-SN, CoAP or HTTPS. Each device signs in with its own ID and token, and every reading goes into your siliconwit.io record.
Already have an account? Sign in and open Devices.
Ways to connect
All of them use the same Device ID and Access Token, and land in the same record.
Devices on WiFi or Ethernet: ESP32, Raspberry Pi, gateways, PLC bridges.
The usual choice. Start here.
Web pages and apps that need live readings in the browser.
Battery and cellular devices that send small packets over UDP.
Use 1885. Plain 1884 is only for devices that cannot do DTLS.
Very low power devices on NB-IoT and other LPWAN links.
Need encryption over UDP? Use MQTT-SN on 1885.
Any device or script that can send a POST request. No MQTT library needed.
POST /api/devices/ingest
A device may use only its own topics. Anything else closes the connection, so one lost device never exposes the others.
How a reading travels
Three topics, all named after the device. Nothing else is allowed.
Connect
mqtt.siliconwit.io:8883 and publish JSON to d/{id}/t.import json, ssl, time import paho.mqtt.client as mqtt DEVICE_ID = "SWD-XXXXXX" # from your account ACCESS_TOKEN = "your-token" # from your account client = mqtt.Client( callback_api_version=mqtt.CallbackAPIVersion.VERSION2, client_id=DEVICE_ID, ) client.username_pw_set(DEVICE_ID, ACCESS_TOKEN) client.tls_set(tls_version=ssl.PROTOCOL_TLS_CLIENT) client.connect("mqtt.siliconwit.io", 8883, keepalive=60) client.loop_start() while True: reading = {"temperature": 24.6, "humidity": 58} client.publish(f"d/{DEVICE_ID}/t", json.dumps(reading), qos=1) time.sleep(10)
The rules
| Item | Rule |
|---|---|
| Sign-in | Device ID as username, Access Token as password. One pair per device. |
| Topics | d/{id}/t readings, d/{id}/c commands, d/{id}/k/{session} replies. No others. |
| Payload | JSON, up to 10 KB, 50 top-level keys and 2 levels of nesting. |
| Quality of service | QoS 0 or 1. Use 1 when a missed reading matters. |
| Encryption | TLS on 8883, 8084 and 443. DTLS on 1885. Ports 1884 and 5683 are plain. |
| Certificate | A public certificate for mqtt.siliconwit.io, renewed automatically. |
Start with 3 devices and 7 days of history at $0. Move up when you need more.