Record CO2 ppm value from MH-Z19b via UART.
- retrieve ppm value and publish it to MQTT topic
- subscribe MQTT topic and append min/max/median/avg to google spreadsheet
Follow the instruction to enable Spreadsheet API.
Create service account and download its credentials in JSON.
- Create spreadsheet and
- share it with the service account.
- Create
sheet1
To build it for Raspberry Pi
GOOS=linux GOARCH=arm GOARM=7 go build
Run mosquitto
sudo apt install mosquitto
sudo systemctl start mosquitto
./co2-monitor sniff
./co2-monitor recordSpreadsheet -record-interval 300 -spreadsheet-id your-spreadsheet-id
where your-spreadsheet-id
is in the URL of Google spreadsheet.
https://docs.google.com/spreadsheets/d/{your-spread-sheet-id}/...
.