Comments (12)
Thank you, and wow that was fast.
from srne-solar-charge-controller-monitor.
Hi, sorry for the delayed response. I've been able to reproduce the problem on my PI also and I'll try to have a fix for it soon.
from srne-solar-charge-controller-monitor.
The correct setup is Raspberry pi GPIO14 goes to MAX3232 TX and GPIO15 goes to RX
While trying to reproduce it I had the wires backwards and got the behavior you mentioned. After flipping them to be correct I was able to read data. Also what python/pymodbus version are you using?
from srne-solar-charge-controller-monitor.
I just double checked the wiring photos in that directory and they are correct.
This one is probably the easiest to compare against:
https://github.com/cole8888/SRNE-Solar-Charge-Controller-Monitor/blob/main/RaspberryPi-Examples/RaspberryPi-Top-View.jpg
from srne-solar-charge-controller-monitor.
I'm using a USB connecter, and I did check and redo my wires. Pin 1 to my RX and pin 2 to my TX and pins 3 & 4 to ground. Pins 5 & 6 are power and not connected.
I just tried flipping the tx and rx to make sure and still the same.
FYI: Pins 5 & 6 give off battery voltage.
from srne-solar-charge-controller-monitor.
So I got a bit of an update. I have for my pc the Solar Station Monitor software. With it I can connect if I set the device ID to 255. Still not working with the python script. Any ideas?
from srne-solar-charge-controller-monitor.
Address 255 is a special address that all charge controllers respond to no matter what their current address is.
Your controller must have a different address than mine. Ran into a similar thing with the Arduino versions and I fixed it there by forcing address 255, but I didn't realize the python version would also have this problem.
Try replacing the line with read_holding_registers
with this:
response = modbus.read_holding_registers(256, 35, unit=1, slave=255)
from srne-solar-charge-controller-monitor.
So adding the "slave" parameters fixed it. I would like to note that the code works without the "unit" parameters and that the "slave" needs to be your device ID.
response = modbus.read_holding_registers(256, 35, slave=1)
Thank you for your help, hope this helps others.
from srne-solar-charge-controller-monitor.
@Shadow-Genesis Just wondering, did this work when you set slave to 255 instead of 1? If it worked with 255 I'll update the program since it should work for all controllers.
from srne-solar-charge-controller-monitor.
Both. My device is ID 1. And from what I read in the PDF that talks about how data is sent and received, 255 is a device ID that all respond to. Mostly for use with bluetooth adapters and remote displays. So in short from what I read, the device ID 255 is a plug and play ID
from srne-solar-charge-controller-monitor.
Ok, I'll update the script to use 255, should prevent issues in the future. Thanks!
from srne-solar-charge-controller-monitor.
I had been making since last night a python class that would handle the SRNE data, makes it cleaner for me. I just got a bit of code I think you may want to add.
deviceID=None response = self.modbus.read_holding_registers(26, 1, slave=255) deviceID = response.registers[0] response = self.modbus.read_holding_registers(256, 35, slave=deviceID)
its just a little auto device ID. I do not think it would work with more then one slave connected, but for one it should be fine
from srne-solar-charge-controller-monitor.
Related Issues (11)
- 1 Arduino only HOT 75
- Software srne ml2420 HOT 6
- pyModbus
- MobusIOException object has no attribute 'registers' HOT 35
- Problems with the modbus HOT 2
- <0°C temperatures dont work.
- [QUESTION] HOT 3
- Print out fault data in python version. HOT 1
- Very high VOC resistance readings cause display to glitch out and esp8266 to crash. HOT 1
- Publishing data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srne-solar-charge-controller-monitor.