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.
- 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
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 do make
and sudo make install
.
The resulting xr_usb_serial_common.ko
driver file will be moved to /lib/modules/YOUR_LINUX_KERNEL_VERSION/tty/serial
.
Reboot and enjoy!
If all goes well you should see ttyXRUSB0
when listing ls -la /dev/ttyXR*
-
Protocol for Epsolar Tracer in this repository
-
Protocol for UPower charger/inverters in this repository
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
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".
-
First make
logupower.py
orlogtracer.py
orlogsdmtracer.py
executable:sudo chmod +x log*.py
-
Now add the cron job:
crontab -e
-
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
-
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
Some very basic knowledge of InfluxDB and Grafana is assumed here.
The grafana/ folder contains the dashboard(s) to monitor realtime and historical solar charging data.
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.
getTracerSettings.py
queries settings of the Tracer AN and displays all current voltagessetTracerSettings.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
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.