COAST-Lab / Open-Water-Level

An open-source, low-cost, DIY ultrasonic water level sensor
MIT License
9 stars 4 forks source link

Time from publish to sleep too short #9

Closed SUPScientist closed 11 months ago

SUPScientist commented 11 months ago

Two of three Particle cloud connections had water level data come through (11:06 and 11:18 successful; 11:12 unsuccessful). Hypothesis is that limited time between Particle.publish() and System.sleep() is too short. Try extending to see if it improves data transmission success.

SUPScientist commented 11 months ago

Possible solution: https://community.particle.io/t/sleep-after-publish-updates/58913/2

SUPScientist commented 11 months ago

Initial testing suggests that https://github.com/COAST-Lab/Open-Water-Level/commit/e53327af54e34b8ccbb32b29bcdd0b6829fdf052 works, but it adds another data operation (thereby doubling data ops per data point, or halving publish efficiency). Keep this open for now as it may be necessary to find another way to do this. Maybe asking for acknowledgment on first publish of data is better than asking for ACK after an additional publish.

SUPScientist commented 11 months ago

Answered in Particle forum here: https://community.particle.io/t/most-data-operation-efficient-way-to-get-ack/65640/8

SUPScientist commented 11 months ago

Solved in https://github.com/COAST-Lab/Open-Water-Level/commit/54ce997f1eb8373ccff7d9eae4b8c81036406980. Closing.