Sensorclouds
MQTT Connectivity

Connection Troubleshooting

Diagnose why a device can't connect, why its data doesn't appear, or why it shows offline

Work through the sections in order: can it connect → is the message received → is it stored → does status look right.

Keep the application's Live Data page open while you test. It shows every message the platform receives, and every error, in real time.

1. The device can't connect

SymptomLikely causeFix
Connection times outWrong host or port, or a firewall blocking port 8883Use mqtt.sensorclouds.app:8883. Ask your network team to allow outbound 8883
Connection refused on port 443WSS isn't availableUse MQTTS on port 8883
TLS handshake failsThe device doesn't trust the certificate, or its clock is wrongEmbed ISRG Root X1. Make sure the device has the correct time
"Not authorized" / bad username or password (MQTT code 4 or 5)Wrong token or password, or the password was regeneratedCopy the Device Token again. Generate a new password and update the device
ESP32 connect() returns false, state = -2PubSubClient buffer too small, TLS failure, or networkAdd mqtt.setBufferSize(1024). Check the root CA and the clock
Connects, then drops right awayAnother client is using the same client ID, or the client ID was refusedUse the Device Token as the client ID, and only on one connection

2. Connected, but nothing in Live Data

SymptomLikely causeFix
Publish succeeds, but nothing appearsWrong topic. The device isn't allowed to publish there, so the broker drops the messageCopy the topic from the device's Overview tab. Check the /data suffix
Unknown device in Live DataThe token in the topic doesn't match a registered device in that applicationCheck the token and the Application ID in the topic
Invalid topicThe topic doesn't follow the patternUse tenant/{tenantId}/app/{applicationId}/device/{deviceToken}/data
Payload too largeThe message is bigger than 256 KBSend smaller messages
Rate limitedThe device publishes faster than allowedSend less often, or combine readings into one message

3. In Live Data, but not on dashboards

SymptomLikely causeFix
Uplink received, but Decoded payload is emptyThe profile's codec is NONESwitch to CUSTOM and add the JSON decoder
Decode failedThe decoder threw an errorOpen the event details for the error, then fix and test the decoder
Fields are decoded, but a widget is emptyThe widget uses a different field name, or a time window older than the dataCompare field names. Choose a window that includes the data
Data appears hours in the pastThe payload contains a timestamp with the wrong time zone or unitsSend Unix seconds/milliseconds or ISO 8601 with a zone, or remove timestamp

4. Status looks wrong

SymptomLikely causeFix
Flips between ONLINE and OFFLINEIt reports less often than 1.5 × the profile's keep-aliveRaise the keep-alive above the reporting interval
Stays ONLINE after being unpluggedNo Last Will was setSet the Last Will on /status. See Connecting Your Device
Stays UNKNOWNIt has never sent a messageStart at section 1

5. Commands don't work

SymptomLikely causeFix
Stays SENT, then TIMEOUTThe device isn't subscribed to /cmd, or never acknowledgesSubscribe to /cmd with QoS 1, and publish an ACK to /ack
Always FAILED although it workedThe ACK uses the wrong status valueSend "status": "ok" (not "success")
ACK ignoredcommandId missing or not copied exactlyEcho the commandId from the command

Still stuck?

Collect these details before contacting support:

  • The device's name and Device Token (never send the password)
  • The time of a failed attempt
  • The error from the device's log, and any Live Data event details

Next Steps

On this page