Giter Club home page Giter Club logo

epever-upower-tracer's Introduction

Monitoring EPsolar UPower and Tracer devices from Raspberry Pi with Python via RS-485

EPSolar Tracer AN/BN devices have been around for a while so this is just another attempt to establish a good monitoring package.

EPSolar UPower hybrid inverters are great at what they do, however it is difficult to get them monitored if you have a Linux machine as they are still new and the protocol is not publicly available. Out of my communication with EPSolar I managed to obtain the list of registers and develop a UPower Python module.

Requirements

  • Python 3 (UPower scripts are still running 2.7 as I had no chance to test on UPower device recently)
  • Influx DB and its Python 3 modules (use pip3 to install)
  • Grafana - latest, whatever is availabe in your Raspbian
  • To communicate with the devices you will need Minimal Modbus module for Python
  • SDM230 device is read using nmakel/sdm_modbus

Make sure you install the Linux driver for Exar USB UART first

The xr_usb_serial_common-1a directory contains the makefile and instructions that will compile properly on Rasbian OS with Linux kernels up to v3.5.

Another xr_usb_serial_common-1a-linux-3.6+ directory has the drive for Linux kernels v3.6 and over.

Before compiling be sure to install the linux headers with sudo apt-get install raspberrypi-kernel-headers

After installing the headers be sure to sudo bundle then sudo make and sudo make install. The resulting xr_usb_serial_common.ko file will then be moved to /lib/modules/YOUR_LINUX_KERNEL_VERSION/tty/serial.

If all goes well you should see ttyXRUSB0 when listing ls -la /dev/ttyXR*

Reboot and enjoy!

Device communications protocols

Python modules

Install minimalmodbus first: pip install minimalmodbus

SolarTracer.py is the module to communicate with Tracer AN/BN controller UPower.py is for communication with UPower inverters

Logging scripts

The file logtracer.py will query the Tracer AN/BN controller for relevant data and store into Influx DB. The file logupower.py will query the UPower inverter for relevant data and store into Influx DB.

By default these scripts write the output into the console (as well as the database). Use > /dev/null to make them "silent".

Setting up a cron job to run this script regularly:

  1. First make logupower.py or logtracer.py or logsdmtracer.py executable:

    sudo chmod +x log*.py

  2. Now add the cron job:

    crontab -e

  3. add the line to log the values every minute (this is for the Tracer model, choose another logger that suits you):

    * * * * * cd /home/pi/epever-upower-tracer && python3 logtracer.py > /dev/null

  4. you can add another line if you want it every half a minute:

    * * * * * cd /home/pi/epever-upower-tracer && sleep 30 && python logtracer.py > /dev/null

Grafana Dashboard

Some very basic knowledge of InfluxDB and Grafana is assumed here.

Img The grafana/ folder contains the dashboard(s) to monitor realtime and historical solar charging data.

Grafana/InfluxDB installation

Use this guide to install InfluxDB and Grafana on Raspberry Pi

Run http://raspberrypi.local:3000 (or whatever your name for the Raspberry Pi is) to configure the Grafana console

When you add InfluxDB as a Data Source. Influx DB should be set up with the following parameters:

  • user = "grafana"
  • pass = "solar"
  • db = "solar"
  • host = "127.0.0.1"
  • port = 8086

At this point you can also import SolarDashboard from grafana/ folder.

Use "solar" dataset to import the values from when setting up the console.

Additional scripts

  • getTracerSettings.py queries settings of the Tracer AN and displays all current voltages
  • setTracerSettings.py will rewrite Tracer AN/BN voltages to support LiFePO4 batteries.

Current settings in the script are for 24V LiFePO4 (300Ah), however the script can be easily changed to set values for 12V and also other types of batteries. There is a pre-filled array for LiFePO4 and a Lead-Acid flooded battery in the script. See the comments on how to choose it.

See Battery voltage settings in this repository For example,

`up.setBatterySettings(batteryLiFePO4, 300, 12)`

will set your battery to 300Ah, 12V LiFePO4

  • ivctl.py may be used to switch the UPower's internal inverter off/on for the night

Tracer with Eastron SDM230

SDM230 support

Eastron SDM230 is a simple meter that measure AC if you have an external inverter. The sdm239/ directory contains scripts to query the device.

logsdmtracer - is the script that queries both Epever Tracer and the SDM 230 and records into InfluxDB It adds the Inverter values such as IVvolt, IVwatt and IVison (=1 if the meter is on) into the same solar measurement.

epever-upower-tracer's People

Contributors

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