A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => Raspberry PI => Topic started by: Pac0 on May 22, 2019, 09:17:40 AM

Title: Classic does not accept modbus write commands
Post by: Pac0 on May 22, 2019, 09:17:40 AM
Hi to all the forum members,

I own two Classics 150 since 2013, both worked very well... for now. Last year I started to monitor my PV system, and after ponder several options, I choose to program the project in Python, based in a work of two spanish people nikkito & Mleon who had developed PVControl+ for Raspberry PI. I forked their work to accommodate it to my system: 2 Classics + 2 Victron Multiplus. For this I designed a Python Class that query the Classics via modbus TCP and a Python program that read the data and save it in a MysQL database.
The problem appeared when I decided to upgrade the program in order to send commands to the Classics to change their status, or simply change de absortion time. Nevertheless I'm stuck in the process because despite having try several ways the Classics reply denying the command.
I was looking for the answer in the forum, but it seems that does not go with my equipment. Could be that the firmware in the Classics, very old, has some problem to accept modbus write commands. The version for both Classics is: 1.0.19.

In the search for a solution I found newmodbus utility for Raspberry PI, and for my surprise it works when I send a write command. This means that something is wrong in my program but I don't know what is this.

For your information previously to send te write command I send the serial number the registers: 20492 and 20493, and the Classics reply ok to this command and with modbus error 1 in thew next command.

for the new test I'm using pymodbusTCP, but the original development use sockets and anyone who wants to see it has it in my GitHub page: https://github.com/JanusHL/pvcontrol

I hope someone could help my and thank you in advance
Pac0


Title: Re: Classic does not accept modbus write commands
Post by: Pac0 on May 22, 2019, 11:39:16 AM
Well after a new "raw" test I've done with the problem: ::)
pymodbusTCP closed the connection in every call because the param auto_close=True  :o

Thanks also...

Title: Re: Classic does not accept modbus write commands
Post by: boB on May 22, 2019, 01:25:54 PM
There is also a jumper, 1 of those 4 behind the larger terminal block that, if installed across the 2 pins, allows you to write without having to send the serial number.  You might try that.

I think it is the 2nd from the left when looking at the wiring compartment/Ethernet jack end of the Classic.
I think I remembered that right !

boB