ModBus values

Started by stephendv, September 14, 2012, 06:38:10 AM

Previous topic - Next topic

stephendv

Hi All,

I've been using PHP to read values over modbus, but I think the table provided in the classic manual doesn't match up with the actual values stored. (I'm using the latest firmware downloaded from website).

For example, the manual says that register 4149 contains the Absorb set point, but when reading 4149 it contains the float set point.  The absorb point is in 4148.
The same is true for the batt temperature, which is supposed to be at 4132, but is actually at 4131; so it seems the whole table is shifted off by one, but I don't know exactly where this happens; it seems to be quite early on because 4121 is supposed to be PVinputcurrent, but this is actually at 4120.  So it must happen somewhere before 4121.

I tried an external modbus probe application in case there was something wrong with my code, but it also gives the same results.

Is there a more up to date list of modbus registers available?

Attached is a print out of all the registers and their converted values.

EDIT: in case it's something on my side, attached are the settings I used to connect and query.

boB

The modbus specification adds 1 to every address for some reason for ( 0 is the first ???)...
So that's why the offset.  Modscan does this for example. I personally use your method.  We'll get a newer document done very soon.  Please feel free to ask questions before then though.
boB
K7IQ 🌛  He/She/Me

stephendv

Thanks boB. 

I'm trying to force EQ through modbus and have captured the traffic from the local app and then traffic from my own app to compare the two.  The modbus portions are identical, but when I send the command from my app I get an Illegal function response. 

I also tried sending through the serial number first, because the local app seems to do that as soon as you click on "config", just in case the controller needs to see that request before accepting modbus changes, but no luck.

Is there any special sequence of commands I need to send through before setting values?



stephendv

Hi guys,

I've also tried to set the absorb voltage through modbus and get the same error as when trying to set EQ: "Illegal funcion".  I get the same error using 2 different modbus libraries.  Not sure what I'm missing... is anyone able to write to the classic using modbus?


crunnells

Hey stephendv,

Any chance I can get a copy of your code? I've been wanting to hack something together to put on my local server and pull data off of my Classic, but I haven't started yet and would appreciate the jump start.

stephendv

You can find it here: https://github.com/stephendv/IslandManager/tree/master/www/classic 
It's part of a larger project to grab data from the SMA sunny island, so you might have to delete some bits, but I think the Classic stuff is self contained.
I'd like to expand on the MidniteClassic class, so that useful features can be called as methods on that class, e.g.  midniteClassic->forceEQ();
So if you'd like to add anything, please feel free to add it  :)

boB


I recently used the compiled version of modpol to read values from the Classic.

There is source code for modpol but I could not get it to compile successfully because there were
some files missing that I could not find.  Maybe somebody here can get that to compile.
But there are a few different compiled versions that seemed to work for generic comm.

There is also a java modbus interface called jamod.  We got that to work at one point too.


boB
K7IQ 🌛  He/She/Me

stephendv

I've also used modbus-cli (Ruby implementation) to successfully talk to the classic: https://github.com/tallakt/modbus-cli

boB, with the latest pre-release firmware I'm getting lockups with modbus again.  I've checked all my local TCP connections and there are no open connections to the classic, but it won't respond over modbus anymore, the local app says "Connecting..." but never connects.  Would it be possible to be more aggressive in tearing down timed-out connections on the classic's side?  So that if it hasn't received any requests in 5 minutes (for example), then drop the connection.

boB

Quote from: stephendv on October 14, 2012, 10:35:47 AM
I've also used modbus-cli (Ruby implementation) to successfully talk to the classic: https://github.com/tallakt/modbus-cli

boB, with the latest pre-release firmware I'm getting lockups with modbus again.  I've checked all my local TCP connections and there are no open connections to the classic, but it won't respond over modbus anymore, the local app says "Connecting..." but never connects.  Would it be possible to be more aggressive in tearing down timed-out connections on the classic's side?  So that if it hasn't received any requests in 5 minutes (for example), then drop the connection.

I had a crazy thought today...  I wonder if the Classic starts communicating again if you let it sit for a day or two ??  Not acceptable I know.

We're working hard on this problem so I am optimistic we will have a fix soon.

Your Classic is a long ways away from your computer, right ?  Otherwise maybe you could talk to it via RS-232 modbus.

Thanks for the Ruy link.

boB


K7IQ 🌛  He/She/Me

stephendv

Raspberry pi computer is right next to the classic in the energy bunker, then 300m wifi link back to the house.  So yes, RS-232 modbus is a possibility!  In fact I have a spare usb-RS232 adapter so will give this a try.  Thanks boB.

Passed a milestone today, got the classic to end absorb based on the end amps measured from the sunny island's shunt :)

boB

Quote from: stephendv on October 14, 2012, 04:10:35 PM
Raspberry pi computer is right next to the classic in the energy bunker, then 300m wifi link back to the house.  So yes, RS-232 modbus is a possibility!  In fact I have a spare usb-RS232 adapter so will give this a try.  Thanks boB.

Passed a milestone today, got the classic to end absorb based on the end amps measured from the sunny island's shunt :)

This is excellent, Stephen !

Our SMA <---> MN Solar system will also communicate with the Sunny Island but interfaces like yours will also be a wonderful addition !

boB
K7IQ 🌛  He/She/Me