Coder Social home page Coder Social logo

balena-enviro-plus's Introduction

Balena enviro+

Deploy an Enviro+ environment sensor (with PMS5003 particle sensor) using Balena and export the data for Prometheus.

Getting Started

To try this on your Raspberry Pi using Docker:

Install Docker.

  • curl -sSL https://get.docker.com | sh
  • sudo usermod -aG docker pi
  • Reboot your Pi

Clone this repo, and initialise the submodule.

  • git clone https://github.com/sighmon/balena-enviro-plus
  • cd balena-enviro-plus
  • git submodule update --init

Build and run the Docker image in the background.

  • docker build -t sighmon/enviroplus_exporter:v1 .
  • docker run -d --privileged -p 8000:8000 sighmon/enviroplus_exporter:v1
  • Open your favourite browser and visit: raspberrypi.local:8000
  • See the running container with docker ps
  • Check the logs with docker logs <containaer_name>

Post to InfluxDB as well as exporting to Prometheus

If you'd like to also post your data to InfluxDB, enable this by adding your InfluxDB-Cloud environment variables to the Dockerfile:

ENV INFLUXDB_URL="https://your_server_location.gcp.cloud2.influxdata.com"
ENV INFLUXDB_TOKEN="your_token"
ENV INFLUXDB_ORG_ID="your_organisation_id"
ENV INFLUXDB_BUCKET="your_bucket_name"
ENV INFLUXDB_SENSOR_LOCATION="Adelaide"
ENV INFLUXDB_TIME_BETWEEN_POSTS="5"
# To see all debug messages
ENV DEBUG="true"

Post to Luftdaten as well as exporting to Prometheus

If you'd like to also post your data to Luftdaten, set the time between posts in the Dockerfile:

ENV LUFTDATEN_TIME_BETWEEN_POSTS="30"
# To see all debug messages
ENV DEBUG="true"

Enabling Particulates on RPi 3, 4, & ZeroW

If you're using Enviro+ on a RPi3, 4 or Zero W you'll need to set "pi3-miniuart-bt" in your Balena Dashboard / Device/Fleet Settings / "Define DT overlays" section for it to read from the serial interface for the PMS5003 particulate monitor.

You'll also need to disable the Serial port on the Balena Host by masking the serial getty service.

# SSH to Balena Host
mount -o remount,rw /
systemctl mask [email protected]
reboot

Deploy with Balena

Once you're happy that it works on your Pi, use the Balena CLI to push it to a Balena app.

  • balena push <your_app_name>

Build your own base image

If you'd prefer to build your own base image, follow these instructions:

  • cd base_image
  • docker build -t <your_name>/balena-enviro-plus:v1 .
  • Create a repository on Docker Hub
  • docker push <your_name>/balena-enviro-plus:v1

Acknowledgments

Thanks to Zane Williamson for his work.

balena-enviro-plus's People

Contributors

fsargent avatar sighmon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.