Off-grid Solar / Battery monitoring and control freeware

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
For the charts Im making now, I understand most inverters that support the MT-50 remote display will work. Basically the Pi replaces the display and reads the raw values from the inverter using ModBus and Python. It then loads this ASCII data into a Prometheus database which is read by Grafana which shows all the graphical information. You then access the information with any web browser locally.
Optionally you can push the ASCII data into the cloud using SSH and load the DB/Grafana there. Then you can view the data from anywhere. I use a Centos cloud server at google which costs around $6 month, but they are offering 1 year free right now if you have a google email account.

Here is a selection of the data available on the Epever MPPT series inverters you can play with on the Pi. I read this every 5 seconds.

Device Description: {0: 'EPsolar Tech co., Ltd', 1: 'TriRon4210', 2: 'V01.54+V01.22'}
0x3100: pvVoltage: 73.2 v
0x3101: pvCurrent: 0.32 a
0x3102: pvPowerL: 23.46 w
0x3104: batteryChargeV: 27.28 v
0x3105: batteryChargeC: 0.86 a
0x3106: batteryChargePowerL: 23.46 w
0x310C: loadVoltage: 27.28 v
0x310D: loadCurrent: 0.0 a
0x310E: loadPowerL: 0.0 w
0x3110: batteryTemp: 22.85 c 73.13 f
0x3111: deviceTemp: 33.56 c 92.408 f
0x311A: Battery S.O.C: 100.0 %
0x3300: pvMaxInVolts: 82.36 v
0x3301: pvMinInVolts: 0.0 v
0x3302: batMaxVolts: 27.59 v
0x3303: batMinVolts: 26.47 v
0x3304: consumedEnergyTodayL: 80 w/h
0x330C: genEnergyTodayL: 750 w/h
0x3200: batteryStatus: 0000000000000000 bits
0x3201: equipStatus: 0000000000000111 bits
runningOk: 1
chargeStatus: 1 Float
pvError: 0
0x9000: batType: 0
0x9001: batCap: 160 ah
0x9002: batComp: 0
0x9003: hiVDiscon: 31.1 v
0x9004: chargeLimitV: 30.0 v
0x9005: overVRecon: 30.0 v
0x9006: eqVolts: 29.0 v
0x9007: boostV: 29.0 v
0x9008: floatV: 27.2 v
0x9009: boostReconV: 25.2 v
0x900A: loVRecon: 24.0 v
0x900B: underVRecover: 24.4 v
0x900C: underVWarn: 24.0 v
0x90OD: loVDiscon: 22.2 v
0x900E: dischargeLimitV: 22.0 v

Battery is Charging in Float mode at 23.46 Watts
Sun 26 Apr 2020 02:29:43 PM PDT

I will add support for balancers soon so you can chart cell voltages. I will start with the Chargery 8 units.
 

namesgolden

Solar Addict
Joined
Nov 30, 2019
Messages
239
Location
N Alabama
is your code optimized for SD storage? this probably isn't a big of a issue as it used to be.

many people running their NAS or embedded device on sd/usb storage do as much as possible to prevent writes to the SD. writing logs and such to memory only.

there are now SD cards/flash drives made to be less likely to fail is this situation, but I've roasted a regular SD card with a dashcam.
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
Storage is not a problem anymore, plus its so cheap < $10 for 32GB, I don't consider it an issue like it was when SD cards first came out.
My plan is to release an entire install module for the Pi so its an easy download and 1 line installation. This will be for a specific set of hardware like Epever MPPT inverters initially, but after we can start to add other popular devices that support data export.

Additionally I write heavily used transient files into a ramdisk, this helps performance and avoids SD IO issues.
 

Knighthawk

Solar Enthusiast
Joined
Mar 7, 2020
Messages
64
Storage is not a problem anymore, plus its so cheap < $10 for 32GB, I don't consider it an issue like it was when SD cards first came out.
My plan is to release an entire install module for the Pi so its an easy download and 1 line installation. This will be for a specific set of hardware like Epever MPPT inverters initially, but after we can start to add other popular devices that support data export.

Additionally I write heavily used transient files into a ramdisk, this helps performance and avoids SD IO issues.
When you are ready to offer this product I'm willing to pay for it! I have the Pi's in hand and the Epever!

Not so sure I'm fit to test anything. Unless you want to see if a total dumba$$ can use it. In that case I'm your man. I will pay for it tho!
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
You can buy me a few beers if it does what you want. You can help me with your feedback and new feature requests. I intend to make it fully public domain. Its so damn useful.

Right now Im comparing resting voltages of my 24v LifePO4 bank after using different charging profiles. Watching the voltages drop on a graph in realtime makes it so much easier to understand.

Here I compare 3 days of data overlayed on the same graph. The shaded voltage is now and the dotted lines are the voltages at the same time yesterday and the previous day. I charged for longer today and increased my battery capacity.

voltages.jpg

You can imagine how useful this will be when it can plot individual cell voltages and compare them at different charge levels and loads. In addition to having a permanent record of all the data from your power system that you can view in any way imaginable.
 
Last edited:

pierre

Somewhere down South
Joined
Dec 21, 2019
Messages
808
For the Pi4 I chose this model with 4GB. https://www.amazon.com/gp/product/B07VYC6S56/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
Get a 32GB card (2 for $20), this makes for a fast development machine that can do anything.

For deployment get the Pi Zero, way cheaper .. https://www.amazon.com/gp/product/B0748MPQT4/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

again use the 32GB card, storage is so cheap now just a few dollars more than 16GB, allows for future expansion and other projects.

Use this USB adapter to power your Pi Zero, plugs right into the Epever Triton series... https://www.amazon.com/gp/product/B07NKNBZYG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Then you run a usb/rs485 cable straight into the Epever data port and your up and running. https://www.amazon.com/gp/product/B081JW5M4L/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I will post a cheat sheet on how to get the charts all up and running as soon as its ready. For now post any questions here.
Thanks Spiderman , have just ordered the Pi Zero W for now - want to first see if I can get my head around the coding etc. ;)
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
Don't forget to include storage, if its not specifically included in your kit. This 2 pack is a good deal, but you only need one. https://www.amazon.com/PNY-Elite-microSDHC-Memory-P-SDU32GU185GW-GE/dp/B01MY8WGV7/ref=sr_1_12?crid=2L2CRB2OOAP4X&dchild=1&keywords=32gb+micro+sd+card&qid=1587993513&s=electronics&sprefix=32GB+micro,electronics,214&sr=1-12&th=1

Once you have built your Pi, you need to install the operating system Raspian (a Linux variant).

Mount the SD card on your PC using a USB adaptor.
Format the disk to a 32GB PC filesystem. You may have to download a free tool to do this.
Download and copy the latest NOOBs image onto it, you literally unzip NOOBs and drag and drop the NOOBs files onto your SD card.

Then insert the SD card into your Pi. You need to connect an HDMI monitor, keyboard and mouse to start the installation. You will need a USB hub to include a mouse, but if you dont, just use a keyboard and use TAB to select menus.

On the install screen, first join your Wifi network so it can connect to the internet and it gives you more install options.

You want to install the light version of Raspian when you finally run my software system to save resources, but install Full Raspian (Comes with the graphical interface) if you want to play with it first. You will just have to reinstall the light version later.

Once its installed and booted, at the login prompt, login as user pi, password raspberry.

To enable SSH do the following commands:

% sudo bash
# raspi-config

and under #5 - Interfacing options, you can enable SSH so you can login to the Pi remotely.

Have fun! There are tons of howto videos and help on the internet if you get stuck ....
 
Last edited:

pierre

Somewhere down South
Joined
Dec 21, 2019
Messages
808
Don't forget to include storage, if its not specifically included in your kit. This 2 pack is a good deal, but you only need one. https://www.amazon.com/PNY-Elite-microSDHC-Memory-P-SDU32GU185GW-GE/dp/B01MY8WGV7/ref=sr_1_12?crid=2L2CRB2OOAP4X&dchild=1&keywords=32gb+micro+sd+card&qid=1587993513&s=electronics&sprefix=32GB+micro,electronics,214&sr=1-12&th=1

Once you have built your Pi, you need to install the operating system Raspian (a Linux variant).

Mount the SD card on your PC using a USB adaptor.
Format the disk to a 32GB PC filesystem. You may have to download a free tool to do this.
Download and copy the latest NOOBs image onto it, you literally unzip NOOBs and drag and drop the NOOBs files onto your SD card.

Then insert the SD card into your Pi. You need to connect an HDMI monitor, keyboard and mouse to start the installation. You will need a USB hub to include a mouse, but if you dont, just use a keyboard and use TAB to select menus.

On the install screen, first join your Wifi network so it can connect to the internet and it gives you more install options.

You want to install the light version of Raspian when you finally run my software system to save resources, but install Full Raspian (Comes with the graphical interface) if you want to play with it first. You will just have to reinstall the light version later.

Once its installed and booted, at the login prompt, login as user pi, password raspberry.

To enable SSH do the following commands:

% sudo bash
# raspi-config

and under #5 - Interfacing options, you can enable SSH so you can login to the Pi remotely.

Have fun! There are tons of howto videos and help on the internet if you get stuck ....
Thank you , you are a star. Watching videos on BOOBS ;) I mean NOOBS and Pi Zero W . I have lots to learn !! The storage I will get from the Chinese store up the road - he stocks all the good brands at low prices and got some for my Garmin Dashcam there and working 100%. With our current exchange rate US goods are very pricey but in some instances we do not have any other options like with the Pi.
 

vk2emp

Solar Enthusiast
Joined
Mar 2, 2020
Messages
87
Nice work. The raspberry pi is such a versatile little SBC. I use a few of them around here myself - one runs the victron venus software (found on their colour control GX), another is the services hub of my apartment (VPN, Pi-Hole content filter, NetBoot server etc). I have a third that runs Alexa and Google, its rather amusing to get it talking to itself :p

A fourth controls my ham radio setup, allowing me to jump on the radio from my iPad or laptop simply by logging into it. Once logged in, I can tell it which device I am using (iPad or Macbook) and it sets the radio audio up so it sounds just as good as if I am sitting in front of my microphone when transmitting. At logout, it conveniently turns the radio stack off, useful as they draw over 2 amps just on standby!

Will your software poll victron gear? As I mentioned I have a Pi running Venus, but the data shown is very basic, nothing like what you have written.

A good way to keep a cell modem from going to sleep due to no data flow (some of them do this), is to have it sync time periodically - I'd set it to do so every n-5 minutes where n is the time the modem waits before it goes to sleep. The data used to sync time is small so it will have negligable effects on small data plans.
 

pierre

Somewhere down South
Joined
Dec 21, 2019
Messages
808
Nice work. The raspberry pi is such a versatile little SBC. I use a few of them around here myself - one runs the victron venus software (found on their colour control GX), another is the services hub of my apartment (VPN, Pi-Hole content filter, NetBoot server etc). I have a third that runs Alexa and Google, its rather amusing to get it talking to itself :p

A fourth controls my ham radio setup, allowing me to jump on the radio from my iPad or laptop simply by logging into it. Once logged in, I can tell it which device I am using (iPad or Macbook) and it sets the radio audio up so it sounds just as good as if I am sitting in front of my microphone when transmitting. At logout, it conveniently turns the radio stack off, useful as they draw over 2 amps just on standby!

Will your software poll victron gear? As I mentioned I have a Pi running Venus, but the data shown is very basic, nothing like what you have written.

A good way to keep a cell modem from going to sleep due to no data flow (some of them do this), is to have it sync time periodically - I'd set it to do so every n-5 minutes where n is the time the modem waits before it goes to sleep. The data used to sync time is small so it will have negligable effects on small data plans.
Awesome ! I have so far to go with all the above .
 

pierre

Somewhere down South
Joined
Dec 21, 2019
Messages
808
Nice work. The raspberry pi is such a versatile little SBC. I use a few of them around here myself - one runs the victron venus software (found on their colour control GX), another is the services hub of my apartment (VPN, Pi-Hole content filter, NetBoot server etc). I have a third that runs Alexa and Google, its rather amusing to get it talking to itself :p

A fourth controls my ham radio setup, allowing me to jump on the radio from my iPad or laptop simply by logging into it. Once logged in, I can tell it which device I am using (iPad or Macbook) and it sets the radio audio up so it sounds just as good as if I am sitting in front of my microphone when transmitting. At logout, it conveniently turns the radio stack off, useful as they draw over 2 amps just on standby!

Will your software poll victron gear? As I mentioned I have a Pi running Venus, but the data shown is very basic, nothing like what you have written.

A good way to keep a cell modem from going to sleep due to no data flow (some of them do this), is to have it sync time periodically - I'd set it to do so every n-5 minutes where n is the time the modem waits before it goes to sleep. The data used to sync time is small so it will have negligable effects on small data plans.
i am gobsmacked at what you guys do with the Raspberry :oops: !
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
I got the Chargery serial interface reading the Cell voltages and plotting them over time. Crazy to see what happens to the cell voltages and how they diverge so quickly when they are fully charged. You can see the Inverter shut off charging in the center of the image and the voltage spread converge. You can see how this can cause problems if you have one bad cell run rogue. I apply a load at the end and they pull back into line very quickly, but diverge again when the solar charger starts again.
Joe.
BMS-2.jpg
 

400bird

Solar Enthusiast
Joined
May 23, 2020
Messages
328
Wow,
That looks great. I would love the be a part of something similar. But, my hardware is nothing like what you have. Also, my programming skills is lacking to say the least.

I have a Solaredge Inverter and am working towards adding a Schneider Conext 6848 XW Pro with lithium.
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
HI, thanks for the feedback, I will continue to add hardware support as soon as I can get hold of, or borrow a piece of equipment I can test. They are all very similar so it doesnt take long. Whats interesting is when you can combine the output of multiple parts and see really cool data. Here I am using data from an Epever combined with a Chargery BMS to get power direction flow info.
You can also get it to email you when the battery is full, which is really useful for me when I want to use the excess power for other projects.
All this on a $25 Pi Zero and free software (beer optional)
Joe.
F52E77CA-8B88-41AF-81AF-0637C6D7D018.png
 

400bird

Solar Enthusiast
Joined
May 23, 2020
Messages
328
If I could provide the test ground and modbus map? Does the equipment you have used this far use RS485?


However, I'm not sure how well FedEx would do with the beer. They just rescheduled a delivery from yesterday to Thursday...

Edit: just reread that you said modbus earlier, so nevermind on that part of the question...
 

pierre

Somewhere down South
Joined
Dec 21, 2019
Messages
808
HI, thanks for the feedback, I will continue to add hardware support as soon as I can get hold of, or borrow a piece of equipment I can test. They are all very similar so it doesnt take long. Whats interesting is when you can combine the output of multiple parts and see really cool data. Here I am using data from an Epever combined with a Chargery BMS to get power direction flow info.
You can also get it to email you when the battery is full, which is really useful for me when I want to use the excess power for other projects.
All this on a $25 Pi Zero and free software (beer optional)
Joe.
View attachment 13857
This is amazing ! Must take a heck of a load of coding to do all this . The graphics are stunning ! Looks more impressive than a Boeing control panel display.
 

vk2emp

Solar Enthusiast
Joined
Mar 2, 2020
Messages
87
@BarkingSpider do you have any victron gear - if not I could send you a victron smart solar 100/20 to experiment with and get the protocol off, although most of victron stuff is very open source, you'd find the data availble on the product pages. Also it might take some time to get to you from the land down under where I live :)
 

upnorthandpersonal

Administrator
Joined
Dec 25, 2019
Messages
2,251
Location
63 degrees North, Finland
This is amazing ! Must take a heck of a load of coding to do all this . The graphics are stunning ! Looks more impressive than a Boeing control panel display.

Check out Graphana: https://grafana.com/grafana/ if you want to play with those kinds of graphs for data plotting. I use it myself for all kinds of data visualization requirements.
 

BarkingSpider

Carbon Lifeform
Joined
Apr 14, 2020
Messages
373
Location
Silicon Valley, CA
As soon as I get some more spare time I will put up a website with the full instructions/howto.
So far the solar equipment I have working has been using a mix of RS232 / TTL and RS485 modbus protocols. Then the data is loaded into a database so its easy to query and combine with other information. Grafana then takes care of the data plotting.
This is what I did for my career and business, visualizing real-time data.
Im glad Ive found a practical use for it outside the corporate world. This info makes living off grid easier.
 
Last edited:
Top