diy solar

diy solar

Renogy Devices and Raspberry Pi - bluetooth/WiFi

Here is the systemd service that's been working for me now for a few days:

Bash:
$ cat /etc/systemd/system/solar-monitor.service
[Unit]
Description=Solar Monitor
After=network.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/solar-monitor
ExecStart=/usr/bin/python3 /home/pi/solar-monitor/solar-monitor.py
RestartSec=13
Restart=always

[Install]
WantedBy=multi-user.target

You will want to change your path, find out the python path with which python or which python3 and point it to where you cloned the solar-monitor project.

Start by making the changes to your solar-monitor.service in the solar-monitor project folder, check to make sure you can run the ExecStart command first to make sure everything is correct then sudo copy it to your etc/systemd/system folder




Bash:
sudo cp solar-monitor.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable solar-monitor.service
sudo systemctl start solar-monitor.service
systemctl status solar-monitor.service
journalctl -u solar-monitor.service

If you want to tail the logs use journalctl -u solar-monitor.service -f

Also in the solar-monitor.ini there's a debug = False line, switch that to True if you want to see the additional debug logs.
 
Last edited:
thanks for the updates all. I've ordered that Pi Zero 2 W should be gettung hopefully before christmas so I can troubleshoot/improve with you.

Just wondering, how is the connectivity between the Pi and BT-1? Is better than the connectivity between your phone and the BT-1?
 
One last update, it doesn't seem like I can connect with the app while connected with the Pi. Also stopping the service does not appear to release the connection so I just sent a reboot over SSH to the Pi and was able to connect before the Pi finished rebooting. Once I was done changing some parameters I restarted the service with
Code:
systemctl restart solar-monitor.service
and it connected right back up.
 
thanks for the updates all. I've ordered that Pi Zero 2 W should be gettung hopefully before christmas so I can troubleshoot/improve with you.

Just wondering, how is the connectivity between the Pi and BT-1? Is better than the connectivity between your phone and the BT-1?
The distance seems about the same. It's far more reliable in terms of easily establishing a connection than the DC Home app. I don't mind the Renogy BT app because you're forced to choose the device name when connecting so I know for sure I'm in range. It feels about the same as the Renogy BT app except that I don't have to force kill and start the app back up to re-establish a connection.
 
With debug logs on I'm seeing some unknown values:
DEBUG: mUnkown 246 243 => 63219
DEBUG: mUnkown 43 50 => 11058
DEBUG: mUnkown 59 242 => 15346
DEBUG: mUnkown 43 50 => 11058
DEBUG: mUnkown 77 50 => 19762

Compared to something known like:
mVoltage 0 219 => 21.90000000000000

I know there are some extra values I'm interested in like the charge mode (MPTT, Boost). I'd like to get this because I just realized this morning I had my parameters set so that I'm only getting MPTT (bulk?) and never Boost. I honestly haven't been able to figure out what the difference is except for the tiny little blurb from the Rover documentation that indicates it boosts the amps :confused:. Not to hijack the conversation but if anyone knows the basic settings for a LiFEPO4 battery with these I feel like my configuration is probably wrong.
 
hmmm....to help figure out the numbers, what exactly to do you have for your solar system?

These are Renogy's standard/default LFP settings

High Voltage Disconnect: 16.4 V
Charge Limit Voltage: 15.5 V
Equalize Charge Volt: 14.4 V
Boost Charge Volt: 14.4 V
Float Charge Volt: 14.4 V
Boost Charge Return Volt: 13.2 V
Over Disc Return Volt: 12.6 V
Low Voltage Alarm: 12.0 V
Over Discharge Volt: 11.1V
Discharge Limit Volt: 10.6 V
Over Disc Delay Time (S): 5
Equalize Charge Time (min): 0
Boost Charge Time (min): 0 (or 10)
Equalize Charge Interval: 0
Temp Comp: 0
 
Thanks for posting those numbers, I definitely see a couple of things I'm interested in changing; dropping boost time to 0, setting the temp coeff to 0, and changing my Boost Charge voltage back to 14.4v like it was this morning.

Edit: Confirmed with the multimeter that the panels were producing around .04 amps in direct sun with the charge controller as the load. I switched the temp coeff to 0 and immediately saw my amps jump up to .8. It's not much but it's a hell of a lot better than I was before. Thanks @SolarShed! I went ahead and unplugged the sensor for now just in case. I'm going to monitor it for now and see if anything changes long term.

I have two 215w Nature Power mono panels wired in parallel going to a Renogy Rover 40. Battery is a Chins LiFePO4 12v 300AH. Wire is 14 guage ran about 12 feet to the charge controller. Currently using the stock connectors on the solar panels (https://naturepowerproducts.com/products/sae-bare-end/), and I took a couple of extra that came with the panels to wire them up in parallel into a single cable. I also have an inverter but I haven't used it lately because the inverter low voltage disconnect is too low and will cause my battery to go into a protect state. Currently the Renogy doesn't wake the battery up, I have to drag a charger out to do that.

I'm currently set the number below, values I've changed from default are unbolded. Some I changed after talking with Chins and the only thing I've changed was this morning I set the Boost Charge voltage from 14.4 to 13.2 because I'm still very confused about what it is.
High Voltage Disconnect: 15 V
Charge Limit Voltage: 14.6 V
Equalize Charge Volt: 14.4 V
Boost Charge Volt: 13.2V (was 14.4 v a few hours ago, I wanted to see if Boost changed anything)
Float Charge Volt: 13.8 V
Boost Charge Return Volt: 14.2 V
Over Disc Return Volt: 11.6 V
Low Voltage Alarm: 12.4 V
Over Discharge Volt: 11.0V
Discharge Limit Volt: 10.8 V
Over Disc Delay Time (S): 5
Equalize Charge Time (min): 0
Boost Charge Time (min): 120 (or 10)
Equalize Charge Interval: 0
Temp Comp: 3 - I'm going to try setting this to 0, I didn't realize I shouldn't even be using the sensor with a Lithium battery until today.

What I've seen is that on cloudy days I get up to around 1.5 amps input current and it stays there most of the day but on sunny days like today I only hit around 1 amp if any, the past few sunny days I stayed at 0. Now that I'm logging the data it makes it easier to troubleshoot. Per Renogy I reset the charge controller this morning by unplugging it from battery and solar for 5 minutes and reconnecting. Earlier this morning I hit .8 amps but as soon as I hit direct sunlight that dropped to nearly 0 (Battery voltage has been at 13.2v for a week). My panel placement is garbage in terms of getting maximum output, but I'm very limited in location and am working to improve it by building a better custom ground mount. I suspect my issues could be one of a few things:

1. The wiring job I did was always supposed to be temporary. I've ran 10 gauge wire but am waiting on a few more RC4 connectors to come in the mail to finish up the panels. I'm about to go outside now and check the amps from my DMM from the panels to do some more troubleshooting on this.

2. My battery parameters are incorrect. Some of the ones specific to the battery like charge limit, over disc, over voltage and that sort of thing I'm going to leave alone.

Partial direct sunlight resulting in 0 amps vs some current on indirect sunlight makes me feel like I'm hitting some wall, could be that temperature coefficient; it seems like as soon as the Renogy battery sensor it 73 degrees my input and output current dropped to nothing. I'm still highly suspicious of my cable and wiring; I'm hoping switching to MC4 and higher gauge wire makes a difference if I can't find anything else.

I haven't ran the inverter since it over discharged the battery last week, it's completely disconnected from the battery so the only load is the Renogy controller + BT-1 adapter.

I've attached a screenshot of some of what I'm charting in Grafana after logging this info to InfluxDB. That blip at 10AM was when I reset the charge controller and you can see at around noon was when the panels hit direct sunlight and charge current started stepping down. Just before 14:00 I set the temp coeff to 0.

I'm now getting a whopping .7 amps from the panels, which isn't exactly where I need to be but better than I've been for the last month. I've only had the panels up for a couple of months and I expected to have better numbers late fall vs December but didn't expect it to be this bad. I'm going to finish my wire upgrade this weekend and hope that helps some more.
 

Attachments

  • chrome_tDLNTvI0s0.png
    chrome_tDLNTvI0s0.png
    394.5 KB · Views: 17
Last edited:
With debug logs on I'm seeing some unknown values:
DEBUG: mUnkown 246 243 => 63219
DEBUG: mUnkown 43 50 => 11058
DEBUG: mUnkown 59 242 => 15346
DEBUG: mUnkown 43 50 => 11058
DEBUG: mUnkown 77 50 => 19762

Compared to something known like:
mVoltage 0 219 => 21.90000000000000

I know there are some extra values I'm interested in like the charge mode (MPTT, Boost). I'd like to get this because I just realized this morning I had my parameters set so that I'm only getting MPTT (bulk?) and never Boost. I honestly haven't been able to figure out what the difference is except for the tiny little blurb from the Rover documentation that indicates it boosts the amps :confused:. Not to hijack the conversation but if anyone knows the basic settings for a LiFEPO4 battery with these I feel like my configuration is probably wrong.
I wonder if having access to Renogy's modbus documentation help in this regard. Here is the document:


According to a programer i spoke to, it may not be depedent on the bluetooth module (and Renogy confirmed that even the built-in bluetooth battery communicates via modbus on BT) as its just an interface making modbus requests to the the device so inverters, batteries and charge controllers have different modbus codes and this document might help.
 
Last edited:
Thanks for posting those numbers, I definitely see a couple of things I'm interested in changing; dropping boost time to 0, setting the temp coeff to 0, and changing my Boost Charge voltage back to 14.4v like it was this morning.

Edit: Confirmed with the multimeter that the panels were producing around .04 amps in direct sun with the charge controller as the load. I switched the temp coeff to 0 and immediately saw my amps jump up to .8. It's not much but it's a hell of a lot better than I was before. Thanks @SolarShed! I went ahead and unplugged the sensor for now just in case. I'm going to monitor it for now and see if anything changes long term.

I have two 215w Nature Power mono panels wired in parallel going to a Renogy Rover 40. Battery is a Chins LiFePO4 12v 300AH. Wire is 14 guage ran about 12 feet to the charge controller. Currently using the stock connectors on the solar panels (https://naturepowerproducts.com/products/sae-bare-end/), and I took a couple of extra that came with the panels to wire them up in parallel into a single cable. I also have an inverter but I haven't used it lately because the inverter low voltage disconnect is too low and will cause my battery to go into a protect state. Currently the Renogy doesn't wake the battery up, I have to drag a charger out to do that.

I'm currently set the number below, values I've changed from default are unbolded. Some I changed after talking with Chins and the only thing I've changed was this morning I set the Boost Charge voltage from 14.4 to 13.2 because I'm still very confused about what it is.
High Voltage Disconnect: 15 V
Charge Limit Voltage: 14.6 V
Equalize Charge Volt: 14.4 V
Boost Charge Volt: 13.2V (was 14.4 v a few hours ago, I wanted to see if Boost changed anything)
Float Charge Volt: 13.8 V
Boost Charge Return Volt: 14.2 V
Over Disc Return Volt: 11.6 V
Low Voltage Alarm: 12.4 V
Over Discharge Volt: 11.0V
Discharge Limit Volt: 10.8 V
Over Disc Delay Time (S): 5
Equalize Charge Time (min): 0
Boost Charge Time (min): 120 (or 10)
Equalize Charge Interval: 0
Temp Comp: 3 - I'm going to try setting this to 0, I didn't realize I shouldn't even be using the sensor with a Lithium battery until today.

What I've seen is that on cloudy days I get up to around 1.5 amps input current and it stays there most of the day but on sunny days like today I only hit around 1 amp if any, the past few sunny days I stayed at 0. Now that I'm logging the data it makes it easier to troubleshoot. Per Renogy I reset the charge controller this morning by unplugging it from battery and solar for 5 minutes and reconnecting. Earlier this morning I hit .8 amps but as soon as I hit direct sunlight that dropped to nearly 0 (Battery voltage has been at 13.2v for a week). My panel placement is garbage in terms of getting maximum output, but I'm very limited in location and am working to improve it by building a better custom ground mount. I suspect my issues could be one of a few things:

1. The wiring job I did was always supposed to be temporary. I've ran 10 gauge wire but am waiting on a few more RC4 connectors to come in the mail to finish up the panels. I'm about to go outside now and check the amps from my DMM from the panels to do some more troubleshooting on this.

2. My battery parameters are incorrect. Some of the ones specific to the battery like charge limit, over disc, over voltage and that sort of thing I'm going to leave alone.

Partial direct sunlight resulting in 0 amps vs some current on indirect sunlight makes me feel like I'm hitting some wall, could be that temperature coefficient; it seems like as soon as the Renogy battery sensor it 73 degrees my input and output current dropped to nothing. I'm still highly suspicious of my cable and wiring; I'm hoping switching to MC4 and higher gauge wire makes a difference if I can't find anything else.

I haven't ran the inverter since it over discharged the battery last week, it's completely disconnected from the battery so the only load is the Renogy controller + BT-1 adapter.

I've attached a screenshot of some of what I'm charting in Grafana after logging this info to InfluxDB. That blip at 10AM was when I reset the charge controller and you can see at around noon was when the panels hit direct sunlight and charge current started stepping down. Just before 14:00 I set the temp coeff to 0.

I'm now getting a whopping .7 amps from the panels, which isn't exactly where I need to be but better than I've been for the last month. I've only had the panels up for a couple of months and I expected to have better numbers late fall vs December but didn't expect it to be this bad. I'm going to finish my wire upgrade this weekend and hope that helps some more.
Def turn off equalize and temp comp = 0 for LFP batteries.
In direct sunlight, your panel should be producing close to the rated short circuit amp rating (Isc) if you have your multimeter connected directly to the pos/neg wire and not connected to anything else. Could be a problem with your diodes if not. If your battery is full, current flow will be low to none.
 
Last edited:

According to a programer i spoke to, it may not be depedned on the bluetooth module as its just an interface making modbus requests to the the device so inverters, batteries and charge controllers have different modbus codes and this document might help.
I think you're right about the modbus part, from what I can tell they're using a Texas Instruments Bluetooth to serial chip and just shipping that out over some of the defaults the TI chip offers. This is good documentation though, I think I can add some more debug lines into the script to try to figure out what is what.
 
Def turn off equalize and temp comp = 0 for LFP batteries.
In direct sunlight, your panel should be producing close to the rated short circuit amp rating (Isc) if you have your multimeter connected directly to the pos/neg wire and not connected to anything else. Could be a problem with your diodes if not. If your battery is full, current flow will be low to none.
Looking more into it, I think it's 95% my panel placement. I did an Isc test earlier and it was close enough to what I saw at the SCC.

When I say direct sun I mean I have sun shining 75% on one of my panels, maybe 30% on the other one. I'm new to this whole thing and I didn't realize what a massive difference having 10-30% shade over part of the panel has. I think I can get at least one panel producing significantly better by switching the placement from vertical to horizontal. If I do that though I expect the other panel to be 75-80% in shade during the peak sunlight (vs maybe 50%) in the wintertime so I don't even know if I should hook it up or not. Switching to MC4 connectors will help me play with single panel vs double panel much more though so I'll play around with everything.

I'm also beginning to realize that I would probably be better off with a pair of smaller panels with better placement than I am with the larger 215w panels in the wintertime when the sun is behind my fence. I think the 215 watt panels do decent in the summertime when the sun is not so far south.
 
Hi @oedo808, I've been trying to be successful like many others in getting this working on my PIZero.
I had to do a lot of things with Python on my vanilla bulldog install, - like install python3-disttools etc but I eventually got there thanks to google

I can run solar-monitor.py with just the controller in the .ini file and I get the messages from my BT-2 but if I try to add the [mqtt] section I get errors I just cant debug. I wonder if you would understand whats going on?

Traceback (most recent call last):
File "/usr/lib/python3.9/configparser.py", line 789, in get
value = d[option]
File "/usr/lib/python3.9/collections/__init__.py", line 941, in __getitem__
return self.__missing__(key) # support subclasses that define __missing__
File "/usr/lib/python3.9/collections/__init__.py", line 933, in __missing__
raise KeyError(key)
KeyError: 'hostname'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/solarpi/solar-monitor/solar-monitor.py", line 48, in <module>
datalogger = DataLogger(config)
File "/home/pi/solarpi/solar-monitor/datalogger.py", line 184, in __init__
self.mqtt = DataLoggerMqtt(config.get('mqtt', 'broker'), 1883, prefix=config.get('mqtt', 'prefix'), username=config.get('mqtt', 'username'), password=config.get('mqtt', 'password'), hostname=config.get('mqtt', 'hostname'))
File "/usr/lib/python3.9/configparser.py", line 792, in get
raise NoOptionError(option, section)
configparser.NoOptionError: No option 'hostname' in section: 'mqtt'


If I see this last line - it suggests no option for hostname, but this is not in the .ini for either your example or on the original git page.
Did you ever come across this?
 
Hi oedo808, I've been trying to be successful like many others in getting this working on my PIZero.
I had to do a lot of things with Python on my vanilla bulldog install, - like install python3-disttools etc but I eventually got there thanks to google

I can run solar-monitor.py with just the controller in the .ini file and I get the messages from my BT-2 but if I try to add the [mqtt] section I get errors I just cant debug. I wonder if you would understand whats going on?
<snip>
configparser.NoOptionError: No option 'hostname' in section: 'mqtt'

If I see this last line - it suggests no option for hostname, but this is not in the .ini for either your example or on the original git page.
Did you ever come across this?
I added hostname="" and it seems to solve it. I get mutiple publishes on the MQTT broker "Home Assistant->regulator and the one I created solar->regulator"
Not sure why I get two with only the one SolarLink in my ini file.
 
I added hostname="" and it seems to solve it. I get mutiple publishes on the MQTT broker "Home Assistant->regulator and the one I created solar->regulator"
Not sure why I get two with only the one SolarLink in my ini file.
This started happening after I pulled the latest merge by Olen. Add an empty hostname value (like my username and password on MQTT) and it'll work.
 
you got farther than me, im not sure what happening with mine, can't get it to run, after running sudo python3 solar-monitor.py

Traceback (most recent call last):
File "/home/pi/solar-monitor/solar-monitor.py", line 52, in <module>
device_manager = SolarDeviceManager(adapter_name=config['monitor']['adapter'])
File "/usr/lib/python3.9/configparser.py", line 960, in __getitem__
raise KeyError(key)
KeyError: 'monitor'
.
followed your reddit instructions, almost the same. Pi is zero 2 W new with bullseye. Any ideas?
 
you got farther than me, im not sure what happening with mine, can't get it to run, after running sudo python3 solar-monitor.py

Traceback (most recent call last):
File "/home/pi/solar-monitor/solar-monitor.py", line 52, in <module>
device_manager = SolarDeviceManager(adapter_name=config['monitor']['adapter'])
File "/usr/lib/python3.9/configparser.py", line 960, in __getitem__
raise KeyError(key)
KeyError: 'monitor'
.
followed your reddit instructions, almost the same. Pi is zero 2 W new with bullseye. Any ideas?
You shouldn't need to run as sudu, unless you sudu pip3 installed the requirements.

If you did install the requirements with sudu, try reinstalling without and running the script without.
 
The 'monitor' section is the first in the ini file, I believe I got this error because you need to rename the solar-monitor.ini.dist to just solar-monitor.ini
the 'dist' I believe stands for distribution and its intended you CP this to solar-monitor.ini and then edit it for your own system.

This is my .ini file

[monitor]
adapter = hci0
debug = False
temperature = C
# C = Celsius
# K = Kelvin
# F = Farenheit

[regulator]
type = SolarLink
mac = 80:6F:B0:10:4D:C6
reconnect = False

[mqtt]
broker = 192.168.1.34
hostname =
prefix = rover_mppt
username = test
password = test
 
You shouldn't need to run as sudu, unless you sudu pip3 installed the requirements.

If you did install the requirements with sudu, try reinstalling without and running the script without.
thanks, I tried resinstalling via

pip3 install -r requirements.txt

I commened out the ones it says are already present, but there a couple of them that it doesn't like

json
threading

do I have install these manually?

it says this for both

ERROR: Could not find a version that satisfies the requirement json
ERROR: No matching distribution found for json
 
The 'monitor' section is the first in the ini file, I believe I got this error because you need to rename the solar-monitor.ini.dist to just solar-monitor.ini
the 'dist' I believe stands for distribution and its intended you CP this to solar-monitor.ini and then edit it for your own system.

This is my .ini file

[monitor]
adapter = hci0
debug = False
temperature = C
# C = Celsius
# K = Kelvin
# F = Farenheit

[regulator]
type = SolarLink
mac = 80:6F:B0:10:4D:C6
reconnect = False

[mqtt]
broker = 192.168.1.34
hostname =
prefix = rover_mppt
username = test
password = test
is broker the IP address of your Pi and mac is mac address of BT-1, right?
 
Back
Top