Simple MQTT client test/example

Everything pertaining to the data.sparkfun.com service, the phant project which powers it, and user projects which talk to the service.

Moderators: phalanx, toddtreece, Brennen@SparkFun

Post Reply
bairdmar
Posts: 1
Joined: Tue Apr 26, 2016 8:05 am

Simple MQTT client test/example

Post by bairdmar » Tue Apr 26, 2016 8:11 am

I'm trying to learn to use MQTT with data.sparkfun.com. I've downloaded a few clients and done lots of googling but I''ve not had lots of success.
I've created a very simple stream on data.sparkfun.com with one field/data item. I'm trying to use the eclipse paho MQTT utility to publish data to that stream and I'm striking out. I am able to connect to the server (data.sparkfun.com:1883, using a generic username, and the public key from my data stream as password), but as soon as I try to publish data it disconnects and nothing is published. For what its worth, I don't really care what the MQTT client is so if there is another suggestion thats great too. I'd really appreciate any advice.
Thank you.

pconroy
Posts: 4
Joined: Fri Apr 22, 2016 8:06 pm

Re: Simple MQTT client test/example

Post by pconroy » Fri Apr 29, 2016 10:52 am

I'm sorry in that while I've done a lot of MQTT, I haven't started anything with data.sparkfun yet. I could only offer shot-in-the-dark debug suggestions. I don't know if data.sparkfun needs creds/certs, but it sounds like it does. In my experience, cert/TLS problems wouldn't let me connect. Since you are connecting, it sounds like something else.

The one MQTT parameter that bit me once was "Keep Alive". Make sure it's a nice high value until you understand the timing of your client.

Standing up a local broker is trivial (I've used mosquitto (mosquitto.org)). How about trying that? Convince yourself that it's not the client code? Get it working locally?

Sorry - not much help.
When I'm done messing w/ AWS, I'll start in on data.sparkfun (or Azure).

Post Reply