All the code that runs on our water monitoring devices.
0
stars
0
forks
source link
As a system, I want to put all the sensor data from the current main loop cycle into a dictionary so that it can be easily accessed and serialized later. #14
We have a main device loop that is meant to cycle through all connected sensors, gather and bundle the data, save it to a file, and send the data if there is an internet connection. The main loop currently includes placeholders (commented code) for future sensor code. But the thermometer and camera can be used now and we should create a main device dict to temporary store all sensor data before it is bundled and sent.
You should be mindful of a few things in completing this task:
We don't know what kind of sensors we'll use in the future. Do some research to see what kind of data sensors currently produce so we can be ready for different data (e.g.: camera has json data and image data)
this dict should be used directly after the last sensor's data has been gathered in the payload.py code. Update the code in that file to pull data from this dict.
This dict should be discarded once it's been saved to the payload file. Only used as temporary storage while all the sensors are gathering data
It is ok for the main loop to block other sensors from executiing. As long as the sensors don't get hung up, it is ok to wait several seconds during each main loop iteration.
Acceptance Criteria
mainloop.py has a dict that all existing and future sensor data capture functions will use to store their sensory data in.
the dict is serialized into a payload .json file. If there is an internet connection, the contents of the json file are sent and the file is deleted.
Background
We have a main device loop that is meant to cycle through all connected sensors, gather and bundle the data, save it to a file, and send the data if there is an internet connection. The main loop currently includes placeholders (commented code) for future sensor code. But the thermometer and camera can be used now and we should create a main device dict to temporary store all sensor data before it is bundled and sent.
You should be mindful of a few things in completing this task:
Acceptance Criteria