Skip to content

A simple rest server running on your raspberry pi, reporting the current CO2 concentration in your room using a MHZ19 sensor.

Notifications You must be signed in to change notification settings

YNNS/mhz19-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MH-Z19 CO₂ Rest

A simple rest server running on your raspberry pi, reporting the current CO2 concentration in your room.


This project is part of the blog article How I built my own CO2 monitor using a Raspberry Pi for Home Office.

Project showcase

Installation

1. Download the pre-built binary

  • Go to the release page and download the latest binary for your architecture.
  • Add the execute permission to the binary. This is required to run the binary. chmod +x ./mhz19-rest
  • Execute the binary on your Raspberry Pi. ./mhz19-rest
  • You can now access the rest api on http://[raspberry-ip]:3500/api/v1/co2

2. Build it yourself

  • Clone this repository. git clone [email protected]:YNNS/mhz19-rest.git or git clone https://github.com/YNNS/mhz19-rest.git
  • Build your binary
    • on the remote machine: go build -o bin/mhz19-rest main.go
    • on a local machine: GOOS=linux GOARCH=arm64 go build -o bin/mhz19-rest main.go (or GOARCH=arm if you are using a 32-bit ARM image)
  • cd bin/ - Or upload the file to the remote machine.
  • Add the execute permission to the binary. This is required to run the binary. chmod +x ./mhz19-rest
  • Execute the binary on your Raspberry Pi. ./mhz19-rest
  • You can now access the rest api on http://[raspberry-ip]:3500/api/v1/co2

Frontend

Check out the corresponding frontend here

👍 Contribute

If you want to say thank you

  1. Add a GitHub Star to the project.
  2. Tweet about the project on your Twitter.
  3. Add some claps to the story of this project on Medium

About

A simple rest server running on your raspberry pi, reporting the current CO2 concentration in your room using a MHZ19 sensor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages