Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Modbus RS485 #626

Closed
fmabreu opened this issue Dec 6, 2013 · 7 comments
Closed

Modbus RS485 #626

fmabreu opened this issue Dec 6, 2013 · 7 comments
Labels

Comments

@fmabreu
Copy link

fmabreu commented Dec 6, 2013

When used in two or more slave RS485 bus of a read error of the serial since the poll and the same for all slave. Every poll the serial and opened and closed connection. I think the connection to be binding and not to the slave

@teichsta teichsta added the bug label May 30, 2014
@teichsta
Copy link
Member

is somebody currently working on this issue?

@nickma82
Copy link
Contributor

@fmabreu could you please post your openhab.config?
(the modbus relevant parts.. )

@kvakanet
Copy link

Hello!
OpenHAB 1.7.0
When I have one device on the bus rs485 uses the parameters 9600n2 openhab then sends the request, but the device does not respond.

modbus:serial.seapp_version.connection=/dev/rs485bus:9600:8:none:2:rtu
modbus:serial.seapp_version.id=11
modbus:serial.seapp_version.start=46152
modbus:serial.seapp_version.length=2
modbus:serial.seapp_version.type=holding

When I query the device via the parameter modpoll 9600n2 the device responds. (If I check with parameter 9600n1 is not responsible). When I change the settings of the device on the 9600n1 openhab normally works with device with config.

modbus:serial.seapp_version.connection=/dev/rs485bus:9600:8:none:1:rtu
modbus:serial.seapp_version.id=11
modbus:serial.seapp_version.start=46152
modbus:serial.seapp_version.length=2
modbus:serial.seapp_version.type=holding

When I add the bus to another device 9600n2 parameters, then writes openhab read errors.

2015-07-16 17:01:32.085 [ERROR] [w.m.io.ModbusSerialTransaction] - execute try 1 error: I/O exception - failed to read
2015-07-16 17:01:37.643 [ERROR] [i.modbus.io.ModbusRTUTransport] - Last request: 09 01 00 00 00 08 3c 84
2015-07-16 17:01:37.644 [ERROR] [i.modbus.io.ModbusRTUTransport] - failed to read: Error reading response
2015-07-16 17:01:37.645 [ERROR] [w.m.io.ModbusSerialTransaction] - execute try 1 error: I/O exception - failed to read
2015-07-16 17:01:43.199 [ERROR] [i.modbus.io.ModbusRTUTransport] - Last request: 09 01 00 00 00 08 3c 84
2015-07-16 17:01:43.200 [ERROR] [i.modbus.io.ModbusRTUTransport] - failed to read: Error reading response
2015-07-16 17:01:43.201 [ERROR] [w.m.io.ModbusSerialTransaction] - execute try 1 error: I/O exception - failed to read
2015-07-16 17:01:48.755 [ERROR] [i.modbus.io.ModbusRTUTransport] - Last request: 09 01 00 00 00 08 3c 84

My config:

modbus:serial.senka_out_01.connection=/dev/rs485bus:9600:8:none:2:rtu
modbus:serial.senka_out_01.id=9
modbus:serial.senka_out_01.start=0
modbus:serial.senka_out_01.length=8
modbus:serial.senka_out_01.type=coil
#
modbus:serial.seapp_version.connection=/dev/rs485bus:9600:8:none:1:rtu
modbus:serial.seapp_version.id=11
modbus:serial.seapp_version.start=46152
modbus:serial.seapp_version.length=2
modbus:serial.seapp_version.type=holding

@nickma82
Copy link
Contributor

I'm not quite sure about that but I think this is the problem I mentioned a couple of weeks ago here.

IMHO there is a need to change the ModbusSerialSlave.java, such that connection specific variables (baud, dataBits, parity, stopBits, serialEncoding) are instance variables of ModbusSerialSlave but not static. Because now every instance of ModbusSerialSlave is overriding the setup from every other instance.

Further the variables mentioned above should be bound to the actual physical port (ModbusSerialSlave.port) which should be a list of opened ports with their current setup. Depending on whether there is a new setup needed for the next transceive on a very port or not, it should be set up if needed only (e.g. if there is just one .connection setup for a .port there is no need to change anything after the initial setup).

If one is willing to implement that changes with me, please contact me.

@teichsta
Copy link
Member

If one is willing to implement that changes with me, please contact me.

it might be a good idea to ask for help at https://community.openhab.org. What is about you are you willing to help out @nickma82 and create a PR yourself?

@nickma82
Copy link
Contributor

I'm willing to help out, but if I'm doing this all by myself its gonna be mid 2016 until I pulled myself together.

Just to note that, it potentially affects the following problems:
https://community.openhab.org/t/modbus-binding-multiple-serial-masters/3383
https://community.openhab.org/t/modbus-serial-failed-to-read/3430
https://groups.google.com/d/topic/openhab/0BtLVPpta9U

@ssalonen
Copy link
Contributor

Please test with the expiremental version, linked to this forum thread

@9037568 9037568 closed this as completed Aug 7, 2016
hubermi pushed a commit to hubermi/openhab that referenced this issue Jan 10, 2017
fixes openhab#626

Signed-off-by: Kai Kreuzer <kai@openhab.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants