GithubHelp home page GithubHelp logo

batrium / watchmonudplistener Goto Github PK

View Code? Open in Web Editor NEW
30.0 14.0 22.0 1.17 MB

WatchMon UDP Binary Listener translates to JSON and stores to influxdb

Home Page: https://www.batrium.com/

License: MIT License

JavaScript 99.78% Dockerfile 0.18% Shell 0.04%
batrium bms node-js raspberry-pi battery battery-management-system battery-monitor

watchmonudplistener's Introduction

WatchMonUdpListener

WatchMon UDP Binary Listener translates to JSON and stores to influxdb or sends it to MQTT

Getting Started

git clone https://github.com/Batrium/WatchMonUdpListener

or

npm install watchmonudplistener

or

Download premade Raspberry PI 3 ISO with everything built in: http://diytechandrepairs.nu/raspberry-solar/

Prerequisites

MQTT Binary-Parser Influx

How to install them: (If you clone from GitHub)

npm install mqtt
npm install binary-parser
npm install influx

Installing

Main install in "Get started"

Start with copying the batrium_config.json_dist to batrium_config.json

Example code in linux:

cp config.json_dist config.json

Edit the file to suit your needs. In the file you have 4 tags for each message:

  • mqtt-> Here you enable or disable if you want a message to be sent to your MQTT brooker

  • Influx -> Enable or disable to send the message to Influx DB. Its not recommended to send more than needed!

  • tag -> Its possible to add tagging to Influx db. Currently run it as is unless you want something special

  • series -> If you want to split out data for instance slow running data from the fast running for easier query in the database this is what you use

The configuration also holds ip/dns for the MQTT brooker and Influx. If you have them on localhost you can leave it as is.

Example config for main setup:

 	"config" : {
                "mqtthost" : "localhost",
                "influxhost" : "localhost",
                "influxdatabase" : "batrium"
        },

Example config for a message:

 "3e" : {
             "mqtt" : true,
             "influx" : true,
             "tag" : "general",
             "serie" : "generic"
     },

When you have cloned the git repo and setup the configuration in the configuration files you also need to prepare the database. In the config section you define the influxdatabase and that one need to be created in InfluxDB

Run:

influxdb

then you run: (Change to the database you want to use)

create database batrium 

When all this is done its just a matter of running the application

Automatic startup

cp systemctl/batrium.service /etc/systemd/system/

Be sure to update paths in the file acordingly to where you installed the Batrium UDP listener

systemctl --system daemon-reload

To enable:

systemctl enable batrium.service

To disable

systemctl disable batrium.service

Contributing

For contributing to this project you can support Batrium by getting HW from them. Supporting the creator of this script by Patreon/Paypal/Subscribing to youtube channel. Patreon: https://www.patreon.com/diytech Youtube: https://www.youtube.com/user/daromeresperyd Webpage with more ways to contribute: http://diytechandrepairs.nu/ And the most important is to report any issues/bugs or features that you want to see sorted or fixed. All added contributions are much appreciated!

Authors

  • Daniel Römer - Initial work - daromer2

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone who's code was used
  • Inspiration
  • etc

watchmonudplistener's People

Contributors

dailymoose avatar daromer2 avatar jaronw avatar mchro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

watchmonudplistener's Issues

amd 64 version

hi this isn't running for me but my system isnt running on arm is there used to be a pc version but can't find it

DataStruckture Change with WachMon 2.15.10

With the Last WachMon 2.15.10 there is a change in UDP Data Structure, so some (a lot) of measurements are not longer function.

Most from Status Rapid. I will try to fix it by Myself, but would be nice to recive an update here!

Greetz
Michael

config/config.json not being created?

I'd copied config.json_dist and modified into config.json (as I did in the previous version) and it was not working.

Then checking the source code I saw that now is being read from the config directory and if doesn't exist, created there:
var config = JSON.parse(fs.readFileSync('config/config.json', "utf8"));

However this was not happening for me (I'm using a Raspberry Pi 4).

So I just changed the code to

var config = JSON.parse(fs.readFileSync('config.json', "utf8"));

and resolved the issue for my case.

DailySessionCumulShuntkWhCharge and DailySessionCumulShuntkWhDischg not being logged to influx

I've been using WatchMonUdpListener for several months and then having it displayed in a Grafana panel. Everything working fine.

After upgrading the WatchMon 4 to the latest firmware, I noticed that some parameters were not working. Then noticed that the github has been updated to I reinstalled it.

Now everything is working (see some other issues being reported after this one), however even if I'm using message 5432:
"54" : {
"mqtt" : false,
"influx" : true,
"tag" : "general",
"serie" : "daily"
},

DailySessionCumulShuntkWhCharge and DailySessionCumulShuntkWhDischg aren't being collected in the DB.

I did the update from github around noon today, and as you can see, previously they were available but not anynmore:

select DailySessionCumulShuntkWhCharge FROM "batrium".."generic" group by * order by desc limit 10
name: generic
tags: messageId=5432, messageType=generic, systemId=8162
time DailySessionCumulShuntkWhCharge


2021-03-07T11:16:55Z 1.8071395263671874
2021-03-07T11:16:05Z 1.7943203125
2021-03-07T11:04:32Z 1.5418182373046876
2021-03-07T10:57:07Z 1.4297069091796875
2021-03-07T10:53:49Z 1.339310791015625
2021-03-07T10:50:31Z 1.2914351806640625
2021-03-07T10:49:41Z 1.2800699462890626
2021-03-07T10:47:13Z 1.254539306640625
2021-03-07T10:46:23Z 1.24687158203125
2021-03-07T10:43:05Z 1.211105224609375

select DailySessionCumulShuntkWhDischg FROM "batrium".."generic" group by * order by desc limit 10
name: generic
tags: messageId=5432, messageType=generic, systemId=8162
time DailySessionCumulShuntkWhDischg


2021-03-07T11:16:55Z 7.61065234375
2021-03-07T11:16:05Z 7.61065234375
2021-03-07T11:04:32Z 7.61065234375
2021-03-07T10:57:07Z 7.61065234375
2021-03-07T10:53:49Z 7.61065234375
2021-03-07T10:50:31Z 7.61065234375
2021-03-07T10:49:41Z 7.61065234375
2021-03-07T10:47:13Z 7.61065234375
2021-03-07T10:46:23Z 7.61065234375
2021-03-07T10:43:05Z 7.61065234375

influx user/pwd

In the previous version, I've not created any specific user/password in influx, but it seems that this version assumes that root/root is there.

Before that I was getting no data and the error message:
A 401 Unauthorized error occurred: {"error":"authorization failed"}\n' }

I think it will be good to make sure that you can change in the config.json or another file the user and password, so it matches your own security policy.

What is the latest supported Batrium SW?

Hello,

I have recently updated to 2.15.11 and the corresponding firmware on my WM4 and I can see that the messages have changed quite a bit. One message that I use particularly was the StatusRapid at 3e32 or 3e5a, but my WM never transmits any of these. I am connected to WiFi and it is set to verbose (thinking this will transmit everything possible):
image

Setting my config to throw everything at the MQTT server I get a list of the following IDs after a while:
image

Anybody able to point me at the right direction in order to get the data delivered from StatusRapid?

Grafana crashes with mobile browser

Hi have the pre compiled image on a pi 3
Works great when accessing from a pc

The moment I use my phone to access grafana loose access from any external device

It's like networking stops can't even SSH to it without reboot

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.