Off-grid Solar / Battery monitoring and control freeware

nigel16494

New Member
I used the JBlance Python Mpp solar package from github to get my remote monitoring on my 2424LV, it's made for a 4048. I have a Raspberry PI 4, 64G bought for the purpose via a direct USB connection to my inverter. The USB cable came with it. Screen Shot 2020-05-25 at 13.44.37.png
A bit of messing around to stop python 2 getting in the way of python 3 was required. You get weird error messages like STR() only has one argument. That means that you are accidentally running in python 2 (raspberry pi default) instead of python 3. I haven't got the code working for the output in watts of the PV panels but this package has a debug option which will allow me to go figure it out. I hope this inspires folks to go do likewise, it's fun stuff if you have a bit of time.
 

BarkingSpider

Carbon Lifeform
If you want a cheap monitoring solution, I can now get great stats from the Renogy Wanderer 10a Li using a Python script.

The little Renogy is under $20.

You will need a $25 Pi Zero and make a special USB-RJ6 cable. Everything else is freeware.

# renogy.py
Reading Renogy Wanderer data...
Battery SOC: 100.0 %
Battery Voltage: 26.6 v
Charging Amps: 0.08 a
controller temp: 9.472 C
Load watts: 4 w
PV volts: 27.4 v
PV amps: 0.03 a
PV watts: 2 w
bat min volts: 26.6 v
todays charge power: 80.0 w
todays discharge power: 42.0 w

RenogyWandererLi10a.jpg
P_20200530_124856.jpg
Im connected to a small 24v A123 LifePO4 bank I use for testing, and also monitoring cell voltages with a 8s Chargery BMS. The PiZero plugs into the USB ports of the Renogy for power only. All the data comes from the RS232 port.

What's exciting is you can parallel these 10a Renogy units to make a cheap 40amp charger and get the full features of a unit that costs $200.

I'll clean up the code and post the howto ASAP. Joe.
 
Last edited:

Thermodynamical

:̸̢̤̩̹͙̞̲̫̓̽
Fantastic work Barkingspider. I am a huge fan of this maker-type stuff. I strongly encourage you to keep doing what you're doing. Awesome.
 

BarkingSpider

Carbon Lifeform
Thanks for the positive feedback, I cleaned up the display and now get this realtime report on my tiny $20 Renogy Wanderer charge controller. This is fantastic value in my opinion. I can easily see that Cell 1 is failing and reducing the capacity of my battery bank.

7A45BCFD-2823-43E9-B27F-DB9C3C20AF61.png

Fantastic work Barkingspider. I am a huge fan of this maker-type stuff. I strongly encourage you to keep doing what you're doing. Awesome.
 

BarkingSpider

Carbon Lifeform
Is mostly using python on a raspberry pi zero running linux.
You can set it all up in about an hour and buy the pi and serial cable hardware at amazon.
Look at earlier posts in this thread for more info. Joe.
 

heimlich

New Member
I like it. It's very good looking. I was hopeful it was .NET based but with PI and Linux I figured you'd be doing it in Java. Nice to see how far along Python has come with how easy it is too hook in libraries.

I assume you come from finance/banking/etc?
 

BarkingSpider

Carbon Lifeform
You can make a windows only version, should not be too much trouble if your ok working with USB/serial interfaces.
My background was remote sensing, network management and Information security, thats where all the graphs and logging experience comes from!
 

heimlich

New Member
I might do that and plug it into a windows server. Good idea.

What you've done is impressive. I'll definitely have to take a look.
 

BarkingSpider

Carbon Lifeform
You need to install Grafana and Prometheus for windows, then work out a way to insert the data you read from your COM port to Prometheus with a script. I use node_exporter on Linux, maybe you can use that in Windows too. If you can get node_exporter working on windows, your almost there. Ill try here when I get time. I just dont like using windows as a server, A PiZero is so much more efficient and the size of your thumb.

Here is a guide ...
 
Last edited:

silgen

Solar Enthusiast
These look great. Here is my view for the last 7 days. As of today, I generated 1 Megawatt hours of solar.

1591379654604.png
 

BarkingSpider

Carbon Lifeform
If your running my Grafana setup, but its giving you errors saying 'no data'
You need to check both prometheus and node_exporter programs are running. Do

# ps -ax | grep prometheus
# ps -ax | grep node_exporter

Both should return valid programs with process id's

If its not running, check prometheus starts ok. Look at my install script for details and what to look for. It's configuration file prometheus.yml must be in the same directory you start it in.

Also check node_exporter runs correctly and is configured to look in the folder /ramdisk you created. Look in /ramdisk, are any files being created there?

Reread my install script. Every command most be run with no errors. Check it twice and once again!
 

BarkingSpider

Carbon Lifeform
This is what your looking for when it runs correctly, this Graphana display is showing my real time AC power usage at my house. Very useful for understanding your power needs when moving off grid.

Screenshot_20200612-222508.jpg
 

kxy

New Member
My comments followed by ### for your how to document.

select Raspian minmal install only - this is key on the Pi Zero to save precious resources.
###I would say Raspian minmal install only without the desktop version
=======================
after install and reboot login at the console as pi:raspian
###default username on Raspbian is pi and the default password is raspberry.
===============
exit from raspi-config when done
#when asked to reboot, select ok
====================
-- modify Wifi settings if needed ...
# vi /etc/wpa_supplicant/wpa_supplicant.conf

-- restart wifi network if you made changes
# wpa_cli -i wlan0 reconfigure

### I would skip this, I didn't have to reset my wifi settings. Might be confusing for the new users. Maybe we an have the user do a ping test, if ping is back then refer to this section somewhere in the appendix
==========================

-- enable sudo for user solar with no password - copy the line for user pi
-- and change pi to solar
# vi /etc/sudoers.d/010_pi-nopasswd
###"solar ALL=(ALL) NOPASSWD: ALL"

===================================
-- check ramdisk is mounted correctly
# mount -a
# df
### expect to see
### tmpfs 1024 0 1024 0% /ramdisk
======================================

# wget https://dl.grafana.com/oss/release/grafana_7.0.3_arm7.deb
### wrong url should be: wget https://dl.grafana.com/oss/release/grafana_7.0.3_armhf.deb

===========================================
# /bin/systemctl status grafana-server
### you should exect to see
### Active: active (running) in green text

===========================================
-- Optional - Add prometheus to systemctl so it starts automatically at boottime
### steps?

=============================================
First reboot machine with 'init 6' and confirm everything still works after a restart.
### How do we know everything works?
 

BarkingSpider

Carbon Lifeform
Thanks, I'll update my howto as soon as i get a chance. Did you get it all working ok?

My comments followed by ### for your how to document.

select Raspian minmal install only - this is key on the Pi Zero to save precious resources.
###I would say Raspian minmal install only without the desktop version
=======================
after install and reboot login at the console as pi:raspian
###default username on Raspbian is pi and the default password is raspberry.
===============
exit from raspi-config when done
#when asked to reboot, select ok
====================
-- modify Wifi settings if needed ...
# vi /etc/wpa_supplicant/wpa_supplicant.conf

-- restart wifi network if you made changes
# wpa_cli -i wlan0 reconfigure

### I would skip this, I didn't have to reset my wifi settings. Might be confusing for the new users. Maybe we an have the user do a ping test, if ping is back then refer to this section somewhere in the appendix
==========================

-- enable sudo for user solar with no password - copy the line for user pi
-- and change pi to solar
# vi /etc/sudoers.d/010_pi-nopasswd
###"solar ALL=(ALL) NOPASSWD: ALL"

===================================
-- check ramdisk is mounted correctly
# mount -a
# df
### expect to see
### tmpfs 1024 0 1024 0% /ramdisk
======================================

# wget https://dl.grafana.com/oss/release/grafana_7.0.3_arm7.deb
### wrong url should be: wget https://dl.grafana.com/oss/release/grafana_7.0.3_armhf.deb

===========================================
# /bin/systemctl status grafana-server
### you should exect to see
### Active: active (running) in green text

===========================================
-- Optional - Add prometheus to systemctl so it starts automatically at boottime
### steps?

=============================================
First reboot machine with 'init 6' and confirm everything still works after a restart.
### How do we know everything works?
 

Colonel.lp

Solar Enthusiast
Great work here. New to the forum and just came across this. At some point in the next month or two am going to get a couple of pi's for the camper, my intention was to use one for victron Venus(to interface with inverter and solar controller) and the other to run signalK on, but I'm going to look into your work as it looks interesting.

Have you or anyone interfaced with victron stuff?

Also I have simarine battery/tank/temp monitoring, I do know there is a python script on gitlab (early work) to interface it's modified modbus into signalk. I'd really like to get this working.

Just wondering if these things are possible before I take the plunge?
 

BarkingSpider

Carbon Lifeform
The beauty of this system is that once your have the base system working, you can monitor and graph virtually anything.

If your device has any sort of output, that's all you need. Just check if you have serial, RS232, modbus, ethernet interfaces etc that you can tap into.

Failing that, you can always monitor its AC or DC power usage, temperature, etc.

Joe.

Just wondering if these things are possible before I take the plunge?
 

mapguy525

Solar Addict
Great work here. New to the forum and just came across this. At some point in the next month or two am going to get a couple of pi's for the camper, my intention was to use one for victron Venus(to interface with inverter and solar controller) and the other to run signalK on, but I'm going to look into your work as it looks interesting.

Have you or anyone interfaced with victron stuff?

Also I have simarine battery/tank/temp monitoring, I do know there is a python script on gitlab (early work) to interface it's modified modbus into signalk. I'd really like to get this working.

Just wondering if these things are possible before I take the plunge?
_
Seems like integrating Signal K is very possible. Signal K is aimed at the Marine world. All kinds of info on Signal K is here:
http://signalk.org/index.html
 
Top