corbinbs / solarshed Goto Github PK
View Code? Open in Web Editor NEWA Python library to help monitor solar charge controllers typically used in off the grid applications.
License: MIT License
A Python library to help monitor solar charge controllers typically used in off the grid applications.
License: MIT License
Hi, thanks for this project. I have 60A MPPT Renogy Rover and am trying to communicate with a MacOS via RS232 cable <-> DB9 connector. When I run renogy_rover.py I get this error:
"/Users/ed/Desktop/solarshed-master/solarshed/controllers/modbus/minimalmodbus.py", line 1699, in _extract_payload
MINIMAL_RESPONSE_LENGTH_RTU, response
modbus.minimalmodbus.InvalidResponseError: Too short Modbus RTU response (minimum length 4 bytes). Response: 'ÿ'
I double checked my wiring, and am not sure what to do next. Does 60A Mppt controller work on a different protocol than 20A/40A version?
Add this special RJ12 RS232 to USB cable which is specific to the Renogy Rover to the Amazon parts list.
I'm currently trying to use this library but I'm getting this error:
>> from solarshed.controllers.renogy_rover import RenogyRover
>>>
>>> controller = RenogyRover('/dev/ttyUSB0', 1)
>>>
>>> controller.battery_voltage()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nexus/.local/lib/python3.10/site-packages/solarshed/controllers/renogy_rover.py", line 86, in battery_voltage
return self.read_register(257, numberOfDecimals=1)
File "/home/nexus/.local/lib/python3.10/site-packages/minimalmodbus.py", line 258, in read_register
return self._genericCommand(functioncode, registeraddress, numberOfDecimals=numberOfDecimals, signed=signed)
File "/home/nexus/.local/lib/python3.10/site-packages/minimalmodbus.py", line 697, in _genericCommand
payloadFromSlave = self._performCommand(functioncode, payloadToSlave)
File "/home/nexus/.local/lib/python3.10/site-packages/minimalmodbus.py", line 795, in _performCommand
response = self._communicate(request, number_of_bytes_to_read)
File "/home/nexus/.local/lib/python3.10/site-packages/minimalmodbus.py", line 930, in _communicate
raise IOError('No communication with the instrument (no answer)')
OSError: No communication with the instrument (no answer)
>>>
Basically, I'm using this cable to connect the Renogy Rover controller to my Raspberry Pi. I'm not sure if my wire is at fault here. I also tried to create my own homemade cable but I can't figure out the pinout of the RJ12 connector since Renogy doesn't share that information (my controller didn't come with the proper RJ12 to USB cable that seems to be included according to some blogs I read).
If someone could help me, it would be really appreciated. Thanks :)
I’m completely off grid and use Macs, Raspberry Pis and Arduinos for a variety of things. One of them is controlling my solar powered well pump located about 1,500 feet downhill from my cabin. I don’t want the pump running unless there is sufficient solar power being generate to get water up the well bore and then push it up the hill to my storage tank. So, I’m rigging up a Pi to monitor the output from my panels and when a specific volt/amp level is reached I’ll turn on the well pump using a heavy duty DC relay. I was having to setup a variety of sensors to monitor all this but with your code it looks like I can directly query my Renogy Rover 40Amp controller. So, THANK YOU for this code base.
One other problem I have is that the Renogy provided software is WinDoze only, so configuring my controllers is a pain unless I spring for their extra control/display panel.
With the work you’ve done do you think it’s possible to build a config file that could be pushed to the Rovers via the APIs you’ve identified? It would be very useful if the various charging parameters could be configured via a text file and then “flashed” back to the controller. Just wondering if that’s even doable?
Anyway, thank you for this code base...very helpful!
Hello, this sounds like a great little project for monitoring Renogy performance. However I was wondering what did you use for connecting RJ12 to USB port of pi? I searched online but did not find any standard rs232 cable built for this purpose. It would be great if you can add the cable used to the part list.
Please introduce a simulator for the Renogy Rover so that we can begin to run automated tests as part of PR reviews
Trying to figure out how to use this, would like to monitor my solar panels and send the data back to a grafana server at my house. i figured out how to run the setup.py build and install but i cant figure out what to do after that. please provide some setup instructions.
Odd thing, I installed the packages using the standard process (pip install solarshed, and pip3 install solarshed), and originally things worked fine. Was able to start the server process and then use your curl example to grab values from the Renogy control.
Now, I'm writing a small python program to try and access the values using the methods you provide (sample in your readme file).
I have an import as follows:
from solarshed.controllers.renogy_rover import RenogyRover
when I try and run the code I get:
File "/home/pi/renogytest.py", line 2, in
from solarshed import *
ImportError: No module named 'solarshed'
I just reran the pip installs, which seem to have worked, but still have the same problem.
Any ideas? I'm currently looking at my paths and am also trying to find the installed packages, not any feedback would be appreciated...
I am using a Renogy Wanderer.
I have a Raspberry Pi on ethernet with its own ip address and port. When it is running
python -m solarshed.server
I can verify it is giving stats by visiting its url ("http://ipaddress:port/"). I have imported the dashboard on Grafana using the json file.
My issue is setting the data source on Grafana I believe because I cannot get any data from queries. I am using the Raspberry Pi url as the data source. Am I missing a step?
the load output enable/disable feature exists in bluetooth but not for the uart
for the bluetooth driver file RoverClient.py, the statement might be this:
def parse_set_load_response(self, bs):
data = {}
data['function'] = FUNCTION.get(bytes_to_int(bs, 1, 1))
data['load_status'] = bytes_to_int(bs, 5, 1)
self.data.update(data
additional question, is there a document indicating the register mapping?
in particular, is register 5 the load register?
if so, I could probably code this up myself
Include systemd set up script and instructions for the solarshed server
I know in the documentation only the rover series has been tested, but has anyone been able to interface this with a wanderer?
There are several things that are currently constants within the project.
It would be helpful to allow folks the ability to easily override these things via environment variables and/or a solarshed configuration file. Please introduce support to adjust configuration settings for things like:
I am all but certain that this is not an issue with Solar Shed. That being said, I had a perfectly working system running on a Raspberry Pi, everything was being stored in Prometheus, charted with Grafana. Then today, I reconnected my Renogy Bluetooth module just to see what the Renogy DC Home app could offer, just out of curiosity. Since I've done that, when I reconnect the Raspberry Pi Solar Shed server (and more specifically the MinimalModbus) library is reporting errors to the effect of:
Nov 03 13:22:19 raspberrypi python[445]: File "/home/pi/.local/lib/python2.7/site-packages/minimalmodbus.py", line 930, in _communicate
Nov 03 13:22:19 raspberrypi python[445]: raise IOError('No communication with the instrument (no answer)')
Nov 03 13:22:19 raspberrypi python[445]: IOError: No communication with the instrument (no answer)
The software version on the charge controller is reporting device version V3.0.1 (I'm seeing this through the Renogy BT app on my phone). I'm starting to think that running the Renogy DC Home app might have updated the firmware on the device so that it somehow blocks requests over the serial port from unknown sources. Also just curious what the software version on your charge controller indicates?
Hello,
Currently I am trying to make this work with a test setup of the Renogy Rover MPTT 40A controller. I have only a Mighty Max 12V 100Ahr connected to Bat (+) and Bat (-). PV(+), PV(-), Load(+), and Load(-) are all disconnected.
I can successfully use solarshed on '/dev/ttyUSB4', and I am confident this is the port that the Rover uses (see below). However there is no response from the Rover, why would that be? Do I need to make an adjustment to my test setup?
`
from solarshed.controllers.renogy_rover import RenogyRover
controller = RenogyRover('/dev/ttyUSB4', 1)
controller.charging_status()
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/radioconda/lib/python3.10/site-packages/solarshed/controllers/renogy_rover.py", line 163, in charging_status
return self.read_register(288) & 0x00ff
File "/home/ubuntu/radioconda/lib/python3.10/site-packages/minimalmodbus.py", line 258, in read_register
return self._genericCommand(functioncode, registeraddress, numberOfDecimals=numberOfDecimals, signed=signed)
File "/home/ubuntu/radioconda/lib/python3.10/site-packages/minimalmodbus.py", line 697, in _genericCommand
payloadFromSlave = self._performCommand(functioncode, payloadToSlave)
File "/home/ubuntu/radioconda/lib/python3.10/site-packages/minimalmodbus.py", line 795, in _performCommand
response = self._communicate(request, number_of_bytes_to_read)
File "/home/ubuntu/radioconda/lib/python3.10/site-packages/minimalmodbus.py", line 930, in _communicate
raise IOError('No communication with the instrument (no answer)')
OSError: No communication with the instrument (no answer)
`
Hi
great project.
I am wondering if this will be enhanced by other Renogy products?
I understood that the DCC50S uses a different version RS485 and is not compatible with the ROVER
Thanks for checking
T
To help folks get started more quickly, please include a basic grafana dashboard JSON export that includes graphs for all of the major metrics that can be collected from the solarshed library
Hi,
i would like to install this and enable a Grafana Dashboard for it.
Can you support me ?
Regards
Hi,
I'd like to have a bluetooth independent discovery method to determining the id
Is this possible?
Is there any way to disable or enable the load output like with the Renogy Bluetooth device/app?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.