Modbus stops responding after a while

Started by stephendv, September 23, 2012, 02:45:30 AM

Previous topic - Next topic

boB

Rosebudd, just stick with the firmware you have.  The network portion should be the same
as what we are presently shipping I think.

Thanks !
boB
K7IQ 🌛  He/She/Me

stephendv

Mine is running on a static IP address, always has been.

Since the classic can only talk to 1 device at a time, perhaps when it stops responding, it's actually still trying to talk over the previous connection?  Both steve's and my logger make a new TCP connection every minute (or 2 minutes) to grab the modbus values, it could be that one of the previous TCP connections haven't closed properly so the classic doesn't respond to any new requests.  The default tcp keepalive timeout on linux is 2 hours, so I've just changed this to 5 minutes to see if it makes a difference...

stephendv

Looking good so far!  I turned off the midnight reset on the classic yesterday, and with the new TCP keepalive timeout of 5 minutes on the linux box, the logger has been running every minute for 24 hours no problems.  Fingers crossed. 

boB

Quote from: stephendv on October 02, 2012, 02:58:19 AM
Looking good so far!  I turned off the midnight reset on the classic yesterday, and with the new TCP keepalive timeout of 5 minutes on the linux box, the logger has been running every minute for 24 hours no problems.  Fingers crossed.


Interesting !

It appears to not disconnect gracefully some times.

boB
K7IQ 🌛  He/She/Me

rosebudd

boB,

Good news at my end also...

Modbpoll has been running for three days, without a hitch, since I switched over to STATIC.

I inadvertently mislead you on how many registers I read....really, the way it is written, I only read one at a time. Kinda clunky programming, but it works for now.

many thanks,
steve
MS Classic 150, ~1.6kw pv, 500 ah , OB3524, ListerSL1/3kwgenAC .....so far
"retirement projects"

stephendv

6 days later and mine is still ticking away, no connection problems  :D

Steve, have you by any chance tried writing to any of the modbus values?  Would be interested if you got it right!  http://midnitesolar.com/smf_forum/index.php?topic=721.0

boB

Quote from: stephendv on October 07, 2012, 04:46:35 AM
6 days later and mine is still ticking away, no connection problems  :D

Steve, have you by any chance tried writing to any of the modbus values?  Would be interested if you got it right!  http://midnitesolar.com/smf_forum/index.php?topic=721.0


Stephen, are you doing a modbus  write multiple register  command with one register  or write single register command ?

boB
K7IQ 🌛  He/She/Me

stephendv

Write multiple registers command using just 1 register.
To try and set the absorb voltage I'm writing 580 to register 4148.  (Reading 4148 returns 582 which is what i currently have it set as).

To force EQ I'm writing 0x80 to register 4159.


boB

#38
Quote from: stephendv on October 07, 2012, 04:08:03 PM
Write multiple registers command using just 1 register.
To try and set the absorb voltage I'm writing 580 to register 4148.  (Reading 4148 returns 582 which is what i currently have it set as).

To force EQ I'm writing 0x80 to register 4159.


Ah! I think I know what it is!


The latest classic code requires a password which is the serial number and not including the.  Leading zeros.  I'm sure that is not in our documentation as that is very new.

However, with the absolute latest firmware, you should be able to bypass the serial number password by installing the jumper on the lock jumper behind the main terminal block.

That's gotta be it.

K7IQ 🌛  He/She/Me

stephendv

Thanks bob!  I'll give that a try.  I did try sending the serial number first, but now I see that the library was disconnecting the connection between sending the serial number and sending the writeRegister command. 
Will try the jumper method instead.

stephendv

No dice  :(
I installed the lock jumper, then turned the classic on again- but am still getting the "illegal function" error when trying to write.  I'm using firmware 6-29-12.


media@media:~$ modbus read 192.168.0.16 %MW4148 1
%MW4148       581

media@media:~$ modbus write 192.168.0.16 %MW4148 580
/var/lib/gems/1.8/gems/rmodbus-1.1.5/lib/rmodbus/slave.rb:262:in `query': The function code received in the query is not an allowable action for the server (ModBus::Errors::IllegalFunction)

stephendv

Strange, setting the lock jumper seems to have had the opposite effect, now I can't change any settings through the local app either.

boB

Quote from: stephendv on October 09, 2012, 12:30:48 PM
Strange, setting the lock jumper seems to have had the opposite effect, now I can't change any settings through the local app either.


What is your exact Classic version and date again ???    We were changing that lock jumper definition around some
just recently.  Originally, when the jumper was installed, it was supposed to keep ANY changes from the TCP/IP
port from happening....  THEN, since some customers do not want to have to send that password/serial number
every time a Classic boots, we reversed the logic.   You may have an older version.
The version I posted should have the logic reversed to the way you want it.  Jumper = UNlocked...
It's a semi-beta version of code but you should probably try it.  You can always go back to an older
version if there is a problem.

http://fusion.midnitesolar.com/MidNiteSolarSetup_10-2-2012_v3.01.exe

boB

K7IQ 🌛  He/She/Me

stephendv

You beauty!

With the new firmware and the jumper connected, modbus writes work a charm  ;D

Some notes: Previously was using the latest released firmware 6-29-12 which had the jumper-connect = no writing whatsoever setting.

Also think there's a bug with the new firmware, did the VMM then set the charging parameters, but when I checked the settings again, it had somehow put the absorb voltage at the EQ voltage.

I've got some programming to do  ;D  ;D  ;D

boB

Are you sure it did not do the other way around and maybe haveto set the equalization voltage to the absorb voltage?
K7IQ 🌛  He/She/Me