mqttxively

Xively not responding to MQTT requests


I'm trying to evaluate the xively service using MQTT. I have created a development device and am trying to connect to it using the mosquitto_pub client.

If I try to open a connection to api.xively.com with no username or password I am connected successfully (CONNACK 0x00 etc). However, if I supply my API key as a username then the connection times out (no response to the CONNECT packet).

This is the line I'm using to connect/publish:

mosquitto_pub.exe -h api.xively.com -u <API_KEY_HERE> -t /v2/feeds/<FEED_HERE>.csv -m 0,16.9

EDIT: and now it's working. Looks like it was something at their end.
EDIT2: appears to be intermittent. That's disappointing, can't be having my Things trying to connect to the cloud and having it time out.


Solution

  • I'd recommend putting a Mosquitto bridge between your application and Xively. This will "buffer" and possibly hide connection issues, and it has worked rather well for me in the past year or two (although I admit to only very sporadically look at the graphs on Xively).

    The bridge configuration I currently run looks like this:

    connection cosm_br address api.cosm.com:1883 clientid xxxxx username <API_KEY_HERE> topic "" out 0 topicname /v2/feeds/<FEED>/datastreams/0.csv

    Setting up Mosquitto isn't difficult, but it does of course mean "more moving parts" on your side.