I’ve got several sensors connected to a single Arduino and it’s sending those values to a Wemos that publishes the data to an MQTT server.
Right not I have the code sending data like:
So basically it reads a sensor, sends the data via serial, waits 1 second, and moves on to the next sensor, etc.
Another option would be to send:
(wait 1 second and loop again)
Basically read all the sensors without a delay between them and send off the values as one big batch across the serial.
Are there any recommendations on which is better to use, perhaps from a fault-tolerance perspective in the case that one of the sensors dies or something? Or maybe from the perspective of programming complexity when you have to parse a bigger object as in the case of the latter?