openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.69k forks source link

Modbus Interface #2148

Closed Horst1960 closed 9 years ago

Horst1960 commented 9 years ago

Hi, I am trying to integrate my heating system (SAMSON TROVIS 5576) via the seriell modbus connection into a openHab system. I am experiences a lot of issues, which I would like you to help me and hopefully to improve the modBus interface. The target is, to install a complete Energy Management System for my house.

Here are the details:

1.) Operating system: WIN 7 2.) Connection to modbus device: RS232 (works stable)

Setup of the system: 3.) Openhab.cfg modbus:poll=2000

Anlagenkennungen : Anlagenkennziffer, Firmwarversion, Hardwareversion

modbus:serial.5576Anlagenkennungen.connection=COM6 modbus:serial.5576Anlagenkennungen.id=32 modbus:serial.5576Anlagenkennungen.start=0 modbus:serial.5576Anlagenkennungen.length=4 modbus:serial.5576Anlagenkennungen.type=holding modbus:serial.5576Anlagenkennungen.valuetype=uint16

  1. items /* Trovis 5576 */

Number Anlagenkennziffer "Anlagenkennziffer [%d]" (Status_5576) {modbus="5576Anlagenkennungen:1"} Number Firmwareversion "Firmwareversion [%d]" (Status_5576) {modbus="5576Anlagenkennungen:2" } Number Hardwareversion "Hardwareversion [%d]" (Status_5576) {modbus="5576Anlagenkennungen:3" }

5.) first issue error messages see attachement trovis_5576 although the values get read from the slave device

6.) second issue even if you say start=0 the real read values start (for holding) at 40002 which is wrong. A start=0 should give you the value of register 40000.

7.) third issue

If you want to read a value with start=100 you don't get any values from the system it seems that the request to the salve device is wrong.

It would be helpfull if some can investigate this issues. I can offer some help for testing and debugging.

Regards Horst

nickma82 commented 9 years ago

Hi Horst, Ad first issue: Which settings does your serial connection use: Speed, DataBits, Stopbits, Parity, Frame format (RTU,ASCII)?? If you got the possibility to sniff the bus: are those parameters the same for send/receive?

In any case the Log-outputs has to get better... I scheduled to do this in the next couple of weeks.

Ad second problem & third problem: After checking the parameters (mentioned above) could you please confirm if those failures still exists?

Best, Nick

nickma82 commented 9 years ago

Ad second problem again: As your "attachement" tells me, the request sent out is requesting the register 0, which is what you set up with "modbus:serial.5576Anlagenkennungen.start=0" and should be correct IMHO. Debug below:

[
 20,     //slaveID ... 5576Anlagenkennungen.id=32 (in hex equals 0x20)
 03,     //Functioncode ... 5576Anlagenkennungen.type=holding
 00, 00, //Address ... 5576Anlagenkennungen.start=0
 00, 04, //Quantity ... 5576Anlagenkennungen.length=4
 42, b8  //CRC
]

There is also another request, of some additioinal setup in the openhab.config: [20, 03, 00, 64, 00, 03, 42, a5] which is requesting id=32, start=100, length=3. Which also seems correct.

If you want to start the readout at 40000, you are able to do so by setting the .start=40000. Best, Nick

Horst1960 commented 9 years ago

Hi Nick,

sorry for responding so late.

add1: 9600,N,8;1; none Same for send and receive

Modbus RTU

add2: "There is also another request, of some additional setup in the openhab.config: [20, 03, 00, 64, 00, 03, 42, a5] which is requesting id=32, start=100, length=3. Which also seems correct." That's correct, I tried a second parameter readout

What do you mean by "please set labels "awaiting-feedback" and "bug"". I don't know what you mean, as I am just starting again with using such tools.

The Problem still exists as I haven't changed something in the meantime: Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 2015-03-01 16:48:34.552 [INFO ] [.b.modbus.internal.ModbusSlave] - ModbusSlave error getting responce from slave Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read 2015-03-01 16:48:37.614 [INFO ] [runtime.busevents ] - Hardwareversion state updated to 4 2015-03-01 16:48:37.614 [INFO ] [runtime.busevents ] - Firmwareversion state updated to 171 2015-03-01 16:48:37.614 [INFO ] [runtime.busevents ] - Anlagenkennziffer state updated to 21 2015-03-01 16:48:37.614 [INFO ] [runtime.busevents ] - Geraetekennung state updated to 5576 Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read 2015-03-01 16:48:40.424 [INFO ] [runtime.busevents ] - Hardwareversion state updated to 4 2015-03-01 16:48:40.424 [INFO ] [runtime.busevents ] - Firmwareversion state updated to 171 2015-03-01 16:48:40.424 [INFO ] [runtime.busevents ] - Anlagenkennziffer state updated to 21 2015-03-01 16:48:40.424 [INFO ] [runtime.busevents ] - Geraetekennung state updated to 5576

Horst1960 commented 9 years ago

upps ... wrong button

nickma82 commented 9 years ago

Hi Horst, Ad "please set labels": this is meant for github managers, there are categories for github-issues.

Can you please check if changing the serial encoding resolves the problem. The default modbus encoding should be set to ASCII not RTU.

To change your setting you need to do two things:

  1. provide a openHAB version as new as it includes the commit https://github.com/openhab/openhab/commit/eedc36d7507394297d6b3b47a8a45cb77802ba21 (if there's none availably at the moment check out the project and build your own version)
  2. Set up the openhab.cfg as following:
# .connection=<devicePort>[:<baudRate>:<dataBits>:<parity>:<stopBits>:<encoding>]
modbus:serial.<yourLabel>.connection=COM6:9600:8:none:1:rtu

please let us know if that helped.

Horst1960 commented 9 years ago

Hi Nick,

I am not experienced with building my own version, indeed I have no glue. I need a couple of days in trying to compile my own version.

Are there any other possibilities? Maybe you can drop me some guidance.

nickma82 commented 9 years ago

Hi Horst, actually there are other possibilites. You can simply grab the most recent addon snapshot from the automatic build server: https://openhab.ci.cloudbees.com/job/openHAB/

For all others coming this way and wanted to compile their own version, the source to look for information is the github wiki and especially the IDE Setup page.

Horst1960 commented 9 years ago

Hi Nick,

thanks for the replay. I will try both ways. I will download the recent snapshot form the link above.

I parallel, I have installed the IDE and I am able to compile the actual version. I got the following message:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Also I have downloaded from the named source the files, but I am not able to incorporate this in my project. This is just because I am not familiar with this IDE. I would be nice to give me an hit how to do so.

By the way: The compiled version runs on my PC

Horst1960 commented 9 years ago

FYI: in the 80's I started my prof. career as a programmer of process computers in Assembler and later in Pascal, but never have written a program since 20 years. So I would like to understand at least from a principal point of view how the concepts of JAVA and how it works. Knowing I will never reach a very high experienced level. ;-)

Horst1960 commented 9 years ago

Hi Nick, here is the update and results:

1.) The modbus interface is still trying (or is believing) to send out requests to the modbus device, but didn't get a feedback. I have put a trace to this comment: http://weather.yahoo.com

http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif

Conditions for Berlin, DE at 8:18 pm CET geo:lat52.52/geo:lat geo:long13.38/geo:long http://us.rd.yahoo.com/dailynews/rss/weather/Berlin__DE/*http://weather.yahoo.com/forecast/GMXX0007_c.html Wed, 04 Mar 2015 8:18 pm CET
Current Conditions:
Mostly Cloudy, 1 C

Forecast:
Wed - Cloudy. High: 6 Low: 2
Thu - AM Clouds/PM Sun. High: 8 Low: -2
Fri - Mostly Cloudy. High: 9 Low: 2
Sat - Partly Cloudy. High: 12 Low: 2
Sun - Mostly Sunny. High: 14 Low: 1

Full Forecast at Yahoo! Weather

(provided by The Weather Channel)
]]>
GMXX0007_2015_03_08_7_00_CET

' by the function 'javax.xml.transform.stream.StreamSource@73c7eaba' 21:00:52.106 [DEBUG] [.i.s.XsltTransformationService:89 ] - transformation resulted in '1' 21:00:52.109 [DEBUG] [.o.b.http.internal.HttpBinding:194 ] - transformed response is '1' 21:00:52.136 [INFO ] [runtime.busevents :26 ] - Weather_Temperature state updated to 1 21:00:52.263 [DEBUG] [JpaPersistenceServiceActivator:31 ] - JPA persistence bundle has been started. 21:00:52.279 [DEBUG] [.o.p.j.i.JpaPersistenceService:59 ] - Activating jpa binding... 21:00:52.290 [DEBUG] [.o.p.j.i.JpaPersistenceService:60 ] - Activating jpa binding...done 21:00:52.300 [DEBUG] [.p.internal.PersistenceManager:146 ] - Initializing jpa persistence service. 21:00:52.301 [DEBUG] [c.internal.ModelRepositoryImpl:63 ] - Configuration model 'jpa.persist' can not be found 21:00:52.426 [DEBUG] [xDBPersistenceServiceActivator:27 ] - InfluxDB persistence bundle has been started. 21:00:52.446 [DEBUG] [i.i.InfluxDBPersistenceService:93 ] - influxdb persistence service activated 21:00:52.446 [DEBUG] [.p.internal.PersistenceManager:146 ] - Initializing influxdb persistence service. 21:00:52.457 [DEBUG] [c.internal.ModelRepositoryImpl:63 ] - Configuration model 'influxdb.persist' can not be found 21:00:52.463 [DEBUG] [.a.internal.bus.AstroActivator:32 ] - Astro binding has been started. 21:00:52.507 [DEBUG] [o.o.b.w.i.bus.WeatherActivator:32 ] - Weather binding has been started. 21:00:52.622 [DEBUG] [.w.internal.gfx.WeatherServlet:72 ] - Starting up weather servlet at /weather 21:00:52.696 [DEBUG] [.p.db4o.internal.Db4oActivator:24 ] - db4o persistence bundle has been started. 21:00:53.313 [INFO ] [.o.i.t.xpl.XplTransportService:67 ] - xPL transport configuration 21:00:53.314 [INFO ] [.service.AbstractActiveService:169 ] - Modbus Polling Service has been started no sigar-amd64-winnt.dll in java.library.path org.hyperic.sigar.SigarException: no sigar-amd64-winnt.dll in java.library.path at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172) at org.hyperic.sigar.Sigar.(Sigar.java:100) at org.openhab.binding.systeminfo.internal.SysteminfoBinding.initializeSystemMonitor(SysteminfoBinding.java:390) at org.openhab.binding.systeminfo.internal.SysteminfoBinding.updated(SysteminfoBinding.java:384) at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) 21:00:53.399 [INFO ] [b.s.internal.SysteminfoBinding:397 ] - Using Sigar version 1.6.4.129 21:00:53.401 [ERROR] [b.s.internal.SysteminfoBinding:416 ] - System monitor error: {} org.hyperic.sigar.SigarException: java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getNetInterfaceList()[Ljava/lang/String; at org.hyperic.sigar.SigarProxyCache.invoke(SigarProxyCache.java:220) ~[sigar-1.6.4.jar:na] at com.sun.proxy.$Proxy78.getNetInterfaceList(Unknown Source) ~[na:na] at org.openhab.binding.systeminfo.internal.SysteminfoBinding.initializeSystemMonitor(SysteminfoBinding.java:400)

[bundlefile:na] at org.openhab.binding.systeminfo.internal.SysteminfoBinding.updated(SysteminfoBinding.java:384) [bundlefile:na] at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)

[org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na] at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)

[org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na] 21:00:53.437 [INFO ] [.service.AbstractActiveService:169 ] - Systeminfo Refresh Service has been started 21:00:53.455 [DEBUG] [o.p.d.i.Db4oPersistenceService:217 ] - Scheduled Commit-Job with interval 5sec. 21:00:53.459 [DEBUG] [.p.m.i.MysqlPersistenceService:434 ] - mySQL configuration starting 21:00:53.460 [DEBUG] [.jpa.internal.JpaConfiguration:41 ] - Update config... 21:00:53.460 [ERROR] [.jpa.internal.JpaConfiguration:44 ] - Got a null properties object! 21:00:53.469 [INFO ] [.service.AbstractActiveService:169 ] - NTP Refresh Service has been started 21:00:53.477 [DEBUG] [o.p.d.i.Db4oPersistenceService:230 ] - Scheduled Backup-Job with cron expression '0 0 1 * * ?' 21:00:53.487 [DEBUG] [.p.internal.PersistenceManager:146 ] - Initializing db4o persistence service. 21:00:53.488 [DEBUG] [c.internal.ModelRepositoryImpl:63 ] - Configuration model 'db4o.persist' can not be found 21:00:53.523 [INFO ] [runtime.busevents :26 ] - Hardwareversion state updated to 4 21:00:53.526 [INFO ] [runtime.busevents :26 ] - Firmwareversion state updated to 171 21:00:53.526 [INFO ] [runtime.busevents :26 ] - Anlagenkennziffer state updated to 21 21:00:53.529 [INFO ] [runtime.busevents :26 ] - Geraetekennung state updated to 5576 21:00:53.535 [DEBUG] [xecPersistenceServiceActivator:33 ] - Exec persistence bundle has been started. 21:00:53.546 [DEBUG] [.p.internal.PersistenceManager:146 ] - Initializing exec persistence service. 21:00:53.549 [DEBUG] [c.internal.ModelRepositoryImpl:63 ] - Configuration model 'exec.persist' can not be found 21:00:53.651 [DEBUG] [inding.ntp.internal.NtpBinding:83 ] - Got time from ptbtime1.ptb.de: Mittwoch, 4. Mõrz 2015 21:00 Uhr MEZ 21:00:53.655 [INFO ] [runtime.busevents :26 ] - Date state updated to 2015-03-04T21:00:53 21:00:53.698 [INFO ] [runtime.busevents :26 ] - Jahr state updated to 2015 21:00:53.698 [INFO ] [runtime.busevents :26 ] - Datum state updated to 103 21:00:53.698 [INFO ] [runtime.busevents :26 ] - Uhrzeit state updated to 536 21:00:54.328 [INFO ] [runtime.busevents :26 ] - Hardwareversion state updated to 4 21:00:54.328 [INFO ] [runtime.busevents :26 ] - Firmwareversion state updated to 171 21:00:54.328 [INFO ] [runtime.busevents :26 ] - Anlagenkennziffer state updated to 21 21:00:54.328 [INFO ] [runtime.busevents :26 ] - Geraetekennung state updated to 5576 Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:00:56.194 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:00:56.276 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:00:56.776 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one 21:00:57.137 [INFO ] [runtime.busevents :26 ] - Hardwareversion state updated to 4 21:00:57.137 [INFO ] [runtime.busevents :26 ] - Firmwareversion state updated to 171 21:00:57.137 [INFO ] [runtime.busevents :26 ] - Anlagenkennziffer state updated to 21 21:00:57.137 [INFO ] [runtime.busevents :26 ] - Geraetekennung state updated to 5576 Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:00:58.938 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:00:59.029 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:00:59.539 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:01.741 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:01.911 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:01.911 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:01:04.139 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:04.253 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:04.763 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:07.038 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:07.188 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:07.198 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:01:09.340 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:09.460 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:09.960 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:12.215 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:12.355 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:12.355 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:01:14.599 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:14.759 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:15.259 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:17.474 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:17.574 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:17.584 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:01:19.749 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:19.889 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:20.399 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:22.592 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:22.692 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:22.692 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 63 00 04 b2 a6 CRC Error in received frame: 1 bytes: 20 21:01:24.963 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:25.060 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:25.570 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 1 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 execute try 2 error: I/O exception - failed to read Error: looking for 10 bytes, received 0 Last request: 20 03 00 00 00 04 42 b8 CRC Error in received frame: 1 bytes: 20 21:01:27.687 [DEBUG] [.b.modbus.internal.ModbusSlave:336 ] - ModbusSlave:I/O exception - failed to read 21:01:27.777 [INFO ] [.b.modbus.internal.ModbusSlave:304 ] - ModbusSlave error getting responce from slave 21:01:27.787 [DEBUG] [b.m.internal.ModbusSerialSlave:111 ] - connection was null, going to create a new one 21:01:28.129 [INFO ] [runtime.busevents :26 ] - Jahr state updated to 2015 21:01:28.139 [INFO ] [runtime.busevents :26 ] - Datum state updated to 103 21:01:28.139 [INFO ] [runtime.busevents :26 ] - Uhrzeit state updated to 537

Horst1960 commented 9 years ago

Part two:

I have changed the all the definitions according to your feedback. It seems that is working. In fact I believe I mad a mistake. To get the address 40100 from a modbus device you have to declare:

Uhrzeit, Datum, Jahr

modbus:serial.5576Datum.connection=COM6:9600:8:none:1:rtu modbus:serial.5576Datum.id=32 modbus:serial.5576Datum.start=99 modbus:serial.5576Datum.length=4 modbus:serial.5576Datum.type=holding modbus:serial.5576Datum.valuetype=uint16

You have to type .start=99 because 40001 +99 = 40100 !

Sorry

Als I have changed the modbus.binding to 1.7.x snapshoot

nickma82 commented 9 years ago

Hi Horst, Ad your IDE specific problems: They are out of scope of this issue and I haven't any idea what's the problem there.

It seems that is working

Well done! The support for serial-RTU communication is available since snapshot 1.7.x. Please close the ticket.

Horst1960 commented 9 years ago

Hi Nick, thanks for the help. For the error messages I will open a new one. Regards Horst