Page 1 of 1

Adafruit-io

Posted: Sun Feb 07, 2016 8:39 pm
by rodrigob
Has anyone tried using micropython to communicate with the new adafriut-io service ?

https://learn.adafruit.com/adafruit-io?view=all
https://github.com/adafruit/io-client-python

Is it there around a micropython-compatible library ?

Thanks for your input.

Re: Adafruit-io

Posted: Mon Feb 08, 2016 12:16 pm
by platforma
This looks quite interesting, lots of similar services exist though. But I think adafruit one will grow faster than others.
The python client looks reasonably simple to port with standard modules: json, requests, collections/namedtuple. I don't think we have the last two in micropython-lib. But the data model doesn't have to be based on namedtuple so can be rewritten any other way. MQTT client, of course, needs an mqtt library.

The service is still in Beta, and I don't think writing a micropython lib in parallel is a good idea. The API will grow and a bunch of stuff will change and improve, but one could start doing the work now. Even reading comments in code (model.py)

Code: Select all

# Depending on how people use the
# client it might be prudent to revisit this decision and consider making these
# full fledged classes that are mutable.

Re: Adafruit-io

Posted: Wed Feb 10, 2016 9:45 am
by pfalcon
json, requests, collections/namedtuple. I don't think we have the last two in micropython-lib.
What do you mean? namedtuple is part of core MicroPython. I started to code urequests (micro requests), but that was put on hold, as entire priority now on running ESP8266 KS campaign and coding for it.

Generally, the best bet to have good progress on this is the campaign, http://forum.micropython.org/viewtopic.php?f=8&t=1338 . There's actually an intrigue whether to go for some cloud service integration as the next stretch goal ;-). But you know, we're realistic guys, and not talking about more stretch goals before current are met ;-). (And indeed, there're many such services, and even deciding which one to support is a lot of time/effort (to review alternatives), and that conflicts with development).

Re: Adafruit-io

Posted: Wed Feb 10, 2016 1:38 pm
by platforma
pfalcon wrote:What do you mean? namedtuple is part of core MicroPython.
Didn't know that, apologies! And urequests sounds very exciting. Of course, the KS campaign will take off the majority of yours and Damiens time, as we all appreciate. Since there is a plethora of such platforms that provide cloud data collection and analysis, I don't think aiming to support one particular service is advantageous. Certainly our own platform would be amazing, but priorities are set right. Anyone else is free to write a library for any other cloud service that's out there, but with all the maintenance and transitions from upstream beta and any API changes should be taken into account.