Code Monkey home page Code Monkey logo

smartmeter-lora's Introduction

smartmeter-lora

Sends data from a smart power meter to homeassistant via LoRa

  • implements listen-before-send to prevent interference with LoRaWAN or other devices.
  • the current config uses SF7BW250 and sends every 60s which is reasonably above the 1% duty-cycle from Germanys regulations
  • encrypts data using ChaCha20-Poly1305

Requirements

  • rustup: so you can install the nightly version required by this project
  • cbindgen: The CLI, for generating C bindings to the SML library
  • rust-src for the currently used toolchain. E.g. rustup component add rust-src --toolchain nightly-2022-07-01-x86_64-unknown-linux-gnu
  • poppler: Provides pdftotext which is used to convert the SML specification to code
  • Zephyr RTOS dependencies
  • Currently, the build system builds the rust part for thumbv6m-none-eabi but it should be easy to extend if more platforms are needed

supported boards

b_l072z_lrwan1

Very useful for development but maybe a little expensive and physically large.

heltec_lora_node_151

Seemed like a good idea at first but is a VERY BAD choice and only kept for reference of how to use this board in zephyr.

  • doesn't have a cryptographically secure RNG(Random Number Generator). My implementation uses an insecure way to turn the temperature sensor into entropy.
  • it's support in zephyr is pretty bad(no USB, no power management, consumes 6mA in idle)
  • power circuitry is excluded from the schematics
  • official documentation

encryption key

generate

openssl rand -out key.bin 32
objcopy --change-addresses 0xf8000 -I binary -O ihex key.bin key.hex

flash

west flash -r openocd -d build-send --skip-rebuild --hex-file key.hex

Run lora2mqtt

lora2mqtt --port /dev/ttyACM0 --baud-rate 115200 --key /path/to/key.bin --mqtt-uri "tcp://127.0.0.1:1883"

smartmeter-lora's People

Contributors

m1cha 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.