I’m developing an esp8266-based device that will send data to Cayenne. Using the MQTT connection works well, but sending data once per hour will result in almost 4kB traffic per hour. That’s not much compared to web browsing, but it is a lot when paying for every kilobyte which is the case for many M2M sim cards.
I understand that MQTT isn’t really suitable when targeting very low bandwidth usage. The CayenneLPP library looks great, but I am unable to find out how to use it over a GPRS connection since it seems intended primarily for LPWAN.
Does Cayenne have a non-MQTT API that I haven’t found? Are there any other options for minimizing bandwidth usage?
My suggestion would be to only connect to the server to send the data when you need to and then immediately disconnect, or using the sleep function would achieve the same result. Calling the loop function tells the server you are still there and that uses data. I have a post over here that uses sleep.
Thanks @adam. Doing that got bandwidth usage down to 2.5kB per message. An improvement of about 35% when sending once per hour. Not close to what can be done with the LPP library, but I guess we now know the lower limit when using MQTT.
As a comparison, doing a HTTPS request needs 3kB (can be more if certificates and revocation lists are checked) and a HTTP request needs 1kB. This was measured with wget to localhost on a linux machine and counting the bytes that hit the lo interface.
So if there was a way to push data to Cayenne using HTTP GET or POST, I would be able to shave off another ~60% of the bandwidth. But there is no such option, right?