Git Product home page Git Product logo

sensors-pub's Introduction

sensors-pub

Application for publishing sensor measurements.

Sensors

Sensor Measures
AM2320 Temperature & Humidity (i2c)
DS18b20 Temperature (1-wire)
Faker Generate fake measures for demo or development purpose.

Publishers

Publisher Description
Stdout Just write to stdout.
MQTT Publish with support for Home Assistant MQTT discovery.

Cross compilation

This example is for running on a Raspberry Pi Zero 2 W (ARMv7). For a Raspberry Pi Zero (ARMv6) replace armv7-unknown-linux-gnueabihf with arm-unknown-linux-gnueabihf

Cargo

  • Add target with rustup :
rustup target install armv7-unknown-linux-gnueabihf

Note: you may need to install cross-compiler stuff like the gcc-arm-linux-gnueabihf package on Debian.

  • Build with cargo :
cargo build --release --target armv7-unknown-linux-gnueabihf
  • Installation:
cargo install cross --git https://github.com/cross-rs/cross
  • build with cross :
cross build --release --target armv7-unknown-linux-gnueabihf

Docker

run

docker run -d --name sensors-pub --rm \
    -v "$(pwd)/config.yml:/app/config.yml:ro" \
    --device /dev/i2c-1 \
    --group-add $(getent group i2c | cut -d: -f3) \
    ghcr.io/gbredz1/sensors-pub:latest

Compose

services:
  app:
    image: ghcr.io/gbredz1/sensors-pub:latest
    restart: unless-stopped

    volumes:
      - ${PWD}/config.yml:/app/config.yml:ro

    group_add:
      - 115 # getent group i2c

    devices:
      - /dev/i2c-1

sensors-pub's People

Contributors

gbredz1 avatar

Watchers

 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.