Added Adafruit_MQTT

I tried to use some of the other libs with the adafruit service but did not seem allow the use of the magic AIO_KEY that they have. So I ported their code over. Its here in this repository.

I have made the lib public although does not seem to show up when I search it. Only added yesterday so maybe it takes time. I have another issue too.

When I go to my libraries it shows two with the same name, Adafruit_MQTT, one is all correct and the other says “Library is valid. Ready to import” but then shows a lit of errors saying it has no files. Something seems to have got screwed up.

The one that does work imports fine into my Weather app.

Anyone seen this?

Many thanks,
Rich.

1 Like

I can see a version 1.6.1 which is not included in any app yet.

I see the library as well, but unless my issue is related to the fact I’m compiling against the Oak firmware (which now seems to fail, instead of upload and brick Oaks, which is a good thing!)… there seems to be something else going on?? I got this error when trying to compile/verify the example sketch included with the 1.6.1 library, which said it was from the OPs github.

That’s maybe because the sample is actually adafruit_mqtt_spark_test.ino but your error message refers to a Adafruit_MQTT_SPARK.ino which is not the sample project file.

The actual sample file features the correct statement #include "Adafruit_MQTT/Adafruit_MQTT_SPARK.h"

1 Like

Actually… it was even better than that… talk about new user PBKAC! :smiley:

I did a search for MQTT, went down to the “ADAFRUIT_MQTT” entry… and then when looking at library, verified it was the OPs code - i.e. 1.6.1 / right github repo.

Then clicked on the big use example button, and then tried to compile it, and got that message. The problem? I didn’t change tabs… so the file that was open when I clicked use this example was the “Adafruit_MQTT_SPARK.cpp” file, which was promptly renamed by the system to “Adafruit_MQTT_SPARK.ino”… and it all went downhill after that. I didn’t bother reading the code, so didn’t realise that the code was the library code, not the actual example ino code.!!! Should have clicked that end tab before clicking use example so it doesn’t do nasty things to my head! :smiley:

1 Like

Thanks, I’ve used it although that may not count or their system is slow to update. At least others can see it. :slight_smile:

@ pfeerick
I’ve made the same mistake too. The use example does not seem to work so well, as you say you have to have the correct source file (ino file) selected before clicking the button. I don’t know if this is due to how I added the lib or just a quirk of the system.

Thanks for checking it out. :smile:

I do see that the lib system will be changing soon to make it compatible with the Arduino lib system, at which point I’ll contact Adafruit and see if my small number of changes and client class can be added to their repository. Would be better than copying their repository and relying on me to keep it up to date.

1 Like

The issue is not the Particle side being slow but in the cached libraries repo in your account/browser.
If you click REFRESH LIBRARIES and possibly CLEAR CACHE or incognito mode you should see it near instant.

It's not a quirk but by design. There could be multiple samples and by selecting the correct file you select what sample to build.

2 Likes

Thanks for the feedback. Hopefully it will be useful for anyone using adafruit.io. :smile:

1 Like