volca02 / hr20-esp12-master

Re-implementation (with different features) of the master portion of OpenHR20 wireless project
GNU General Public License v2.0
12 stars 5 forks source link

Rewrite mqtt publishing code to use a state machine #15

Closed volca02 closed 6 years ago

volca02 commented 6 years ago

ESP12 seems to like to freeze now if we feed to much output data to mqtt PubSubClient. It goes away if timers are not synced, but the general solution is to use a state machine and update the mqtt broker incrementally piece by piece (Not blocking the main loop for too long).

This could also open the door to a more active mqtt publishing - after triplet of client-master-client packet exchange, there usually is a window to send the updated data to broker before the next second starts. This can easily be made configurable.

volca02 commented 6 years ago

done