0

Time Feed?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Time Feed?

by msk on Sat May 05, 2018 8:34 pm

Using the older Adafruit MQTT library I was able to subscribe to the time by:
Adafruit_MQTT_Subscribe timefeed = Adafruit_MQTT_Subscribe(&mqtt, "time/seconds");

How do I access this feed using the newer Adafruit IO library?
(the one that only calls io.run() at the beginning of the loop)

I am asking because:
1- It is easier to use this library than the MQTT library.
2-I need to use feed->get(); at the end of my setup() for another feed.

THANKS SO MUCH!
--MK

msk
 
Posts: 11
Joined: Tue Sep 10, 2013 9:57 pm

Re: Time Feed?

by brubell on Fri Jul 06, 2018 12:14 pm

There's currently no way to do that in Adafruit IO Arduino. Time subscriptions will be added on the next release of the new Arduino and Python libraries.

Keep an eye on these two issues for now, they'll be updated once there's an update to the library (soon - I'm working on it currently :) ).
https://github.com/adafruit/Adafruit_IO ... /issues/41
https://github.com/adafruit/io-client-python/issues/53

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Re: Time Feed?

by msk on Fri Jul 06, 2018 12:21 pm

Thank you SO MUCH for looking into this.
Thank you to PT for facilitating!

Please let me know if you need a beta tester.

--MSK

msk
 
Posts: 11
Joined: Tue Sep 10, 2013 9:57 pm

Re: Time Feed?

by brubell on Fri Jul 06, 2018 12:41 pm

Whoo, the Python Adafruit IO Client can now retrieve time!

Using the REST client (API)?
Just call: receive.time(time_unit)

Example added in examples/aio_basics/adafruitio_17_time.py

"Wait, I want to use the MQTT Client"
Never fear! We have you covered there too:
Just call: client.subscribe_time('seconds')

Exampled added in: examples/mqtt/mqtt_time.py


Note: This library is in active development and nearing release. The time feature is currently in the api-v2 branch and will get merged into master when it's ready (soon!):
https://github.com/adafruit/io-client-p ... ree/api-v2

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Re: Time Feed?

by brubell on Mon Jul 09, 2018 12:23 pm

Adafruit IO Arduino can now retrieve time too!


Adafruit_IO_Arduino client library updated to support three types of time helpers: time/seconds, time/milliseconds, and time/ISO-8601

Example for subscribing to all three of the feed subscriptions added to examples/adafruitio_17_time_subscribe/adafruitio_17_time_subscribe.ino


New, new, new release over at: https://github.com/adafruit/Adafruit_IO ... /tag/2.7.6

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Re: Time Feed?

by msk on Mon Jul 09, 2018 12:33 pm

This.
Is.
AWESOME!

Thanks for making it happen.

msk
 
Posts: 11
Joined: Tue Sep 10, 2013 9:57 pm

Re: Time Feed?

by brubell on Mon Jul 09, 2018 12:39 pm

msk wrote:This.
Is.
AWESOME!

Thanks for making it happen.


You're welcome - build something awesome with it!

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.