Code Monkey home page Code Monkey logo

dsmr-reader's Introduction

DSMR Reader for Raspberry Pi

Prerequisites

On the Raspberry Pi:

  • Java Runtime Environment for Java 8, for example: sudo apt-get install openjdk-8-jre-headless
  • WiringPi: sudo apt-get install wiringpi
  • Pi4J version 1.2-SNAPSHOT (see below)

This uses Pi4J 1.2-SNAPSHOT instead of 1.1 because 1.2-SNAPSHOT has support for the Raspberry Pi Zero W, which is what I am using for this project.

To install Pi4J 1.2-SNAPSHOT:

wget http://get.pi4j.com/download/pi4j-1.2-SNAPSHOT.deb
sudo dpkg -i pi4j-1.2-SNAPSHOT.deb

(See installation instructions - note that the easy option installs Pi4J 1.1 which is not what you need).

Ofcourse, you need a cable to connect the P1 port of your smart meter to an USB port of the Raspberry Pi.

On the PC:

  • JDK 8, Maven, your favorite IDE

Building

Build with mvn clean package

Running

After building, copy the JAR file dsmr-reader-1.0-SNAPSHOT.jar in the target directory to the Raspberry Pi.

Run it on the Raspberry Pi:

java -jar dsmr-reader-1.0-SNAPSHOT.jar

Or to make it run in the background, saving logging to a file:

nohup java -jar dsmr-reader-1.0-SNAPSHOT.jar > log.txt & 

If the USB port that the cable to your smart meter is connected to is different from the default /dev/ttyUSB0, then you can specify a different name on the command line, for example:

java -jar dsmr-reader-1.0-SNAPSHOT.jar /dev/ttyS0

Note: The JAR file is an executable JAR with a custom manifest that points to the Pi4J JAR files, in the location where they will be installed when you installed the Pi4J package (directory: /opt/pi4j/lib).

More information

See: Serial programming with Pi4J example.

TODO

Idea: Automatically upload file with received messages to Google Drive once a day. See Google Drive REST API.

Do this in a separate thread (not in the thread that called dataReceived).

dsmr-reader's People

Contributors

jesperdj avatar

Watchers

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