-->
Page 3 of 6

Re: Data logging to ThingSpeak ** Tuning for speed

PostPosted: Thu Jan 12, 2017 4:49 am
by kas
So my goal is to bring the full session time (wake up, data acquisition, router connection, ThingSpeak connection, deep-sleep) below 800ms for
- 1-wire 18B20 (possibly 2 sensors at FULL 12 bits resolution)
- BMP180 temperature - BMP180 pressure
- battery voltage
- timing info


Success: 700ms (full session time, with two 18B20 at full resolution)

Image
The trick is to work in masked time and avoid the 750ms delay per sensor specified in the official example

Re: Data logging to ThingSpeak ** Tuning for speed

PostPosted: Thu Jan 12, 2017 10:38 am
by warwick
Thingspeak has MQTT API available now - it may be possible to further reduce the time by using Thingspeak MQTT API rather than REST API.

https://www.mathworks.com/help/thingspeak/mqtt-api.html

Re: Data logging to ThingSpeak ** Tuning for speed

PostPosted: Fri Jan 13, 2017 11:54 am
by kas
Thanks, I will give it a try

Re: Data logging to ThingSpeak ** Tuning for speed

PostPosted: Fri Jan 13, 2017 2:09 pm
by al1fch
I tried a kind of 'publish and sleep' code with the new Thingspeak MQTT API.
Not faster than Http get in my case :( (.....no permanent connection to ThingSpeak MQTT broker )
PubSubClient 2.6.0 used