fruito wrote:What is the meaning of DATA_FIELDS and where are they documented?
Those are names of fields that can exist in a 'data' object sent to or received from the Adafruit.io server. You can find descriptions of them here:
https://io.adafruit.com/api/docs/#data
fruito wrote:The example code always assumes the internet is there and IO is available. Well, what if it is not?
Then you shouldn't be trying to run such code.
Broadly speaking, your code should check for a working network connection long before it tries to execute any code that needs such a connection to function. If you want to capture data while there's no internet connection, you'll need to write it to some other kind of storage like an SD card, then upload data on the card to Adafruit.io when the board gets its next working internet connection.
fruito wrote:Would be nice if a microcontroller could be rebooted without losing data. (assuming time is known)
That would require a layer of hardware memory management that doesn't exist in microcontrollers. You could build your own approximation by writing all data to FRAM or something, but it still wouldn't be robust against random crashes.
fruito wrote:What is the maximum size of the batch? When should the data be split in chunks?
The function .send_batch_data() is a front-end for an HTTP request, so there's no hard technical limit. In practice you'll run into the 60-updates-per-minute rater limiting or 1000-data-points pagination limit first:
https://io.adafruit.com/api/docs/#rate-limiting