Skip to content

snt/co2-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CO2 monitor

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

Setup

Google Spreadsheet API credentials

Follow the instruction to enable Spreadsheet API.

Create service account and download its credentials in JSON.

Spreadsheet

  • Create spreadsheet and
  • share it with the service account.
  • Create sheet1

build

To build it for Raspberry Pi

GOOS=linux GOARCH=arm GOARM=7 go build

MQTT server

Run mosquitto

sudo apt install mosquitto
sudo systemctl start mosquitto

Run

CO2 monitor

./co2-monitor sniff

spreadsheet recorder

./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}/....

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published