How to connect Nilan CTS602 modbus interface

Nilan connected to Openhabian and USB is online in Paperui. So far so good :slight_smile: However, it’s a steep learning curve for me if I have to edit and add files using Linux (via SSH), but I can see that others are able to see their Openhabian file structure via windows file explorer. How can this be done? I can of course connect to Openhabian via SSH into it via it’s ip-address (192.168.0.232 in my case), but trying to put the same ip-address into windows file explorer, being under “Network”, results in Chrome opening a windows saying “Not able to connect” (translated from danish “Ude af stand til at oprette forbindelse”).
Is this done via the WSL distro?

You´ll have to use samba which can be a bit of a pain in windows 10. I dont use that myself.
Insted I use WinScp. A nice program, which looks abit like file explorer in windows. It has an internal editor, which is suitable for creating and editing manual files.
Winscp: https://winscp.net/eng/download.php

PS. watch out for all the commercials on the site… It may confuse people into downloading the wrong program…

1 Like

Many thanks Kim. That worked straightaway, but I’m seeing openhabian@192.168.0.232 with a nearly empty directory structure (only a readme.txt). I guess the Openhabian files are placed elsewhere - possibly under “root”. However root does not seem to have “openhabian” as login pw.
Apart from that it seems to be what I am after :slight_smile:

Alle the files you need are under /root/etc/
There you will see the openhab folder structure.

Thanks for your help Kim! Winscp worked but I ran into a permission error trying to select the folder “root”. The error is “Permission denied. Error code: 3. Error message from server: Permission denied”
Should say that I have not changed the default pw, so I am logging in with openhabian/openhabian.

Then I tried to go the Samba way, first installing the share via openhabian-config option 66, and easily connected via Windows File explorer using \192.168.0.232\openhabian, but here I am unable to go up in the file hierarchi. The only thing visible is a “README.txt” with this content “This is your linux user’s “home” folder. Place personal files, programs or scripts here.”
As far as I understand it is not possible to log in via “root”, so I do not understand what I am missing here.

openhabian is a user associated with your openhab install.
The install lives in folders with /openhab/ naming, somewhere else.

To use a Windows analogy, you’re looking in My Documents instead of Program Files.

There has to be something else wrong then, cause I´m using Winscp just fine, and have been ever since start, even with default password. (openhabian/openhabian is the default allright).
I wonder what may be the cause. Did you activate SSH on your openhab system?

This is how the login shows on Winscp:
winscp login

As for Samba/Windows… Sorry cant be much help… I gave that up long time ago, and havn´t tried since :smiley:

I can SSH into the PI, so I assume the answer is yes. AFAICS there are no further settings related to SSH in openhabian-config?

Earlier, after having found out I had this problem, I tried to run 14 “Fix Permissions” but that didn’t change anything.

Weird - I’ll try searching on :slightly_smiling_face:

It is weird… Please let us know if you find the cause. I´m possitive this is one tiny simple thing preventing it from working…

Sorry, I believe (hope) I misunderstood you :blush: The folder is in the “root directory”, ie /etc/openhab2/ , not /root/etc/openhab2/ right? I can easily access this folder and here are all the items, things subfolders.

To move on, I have not been able to see from the thread what the names for the files should be. Could I just give for example the things file a name “Nilan.txt”

Many thanks in advance for your excellent guidance helping a complete beginner like me :smile:

Nope. Docs -

1 Like

Great to hear… And actually it was a rather stupid path I gave you… The correct one is ofocuse /etc/openhab2/ But you sorted that out…

I can give you a hint, and with Rossko´s link, I´m sure you can figure this out as well :slight_smile:

What you call a file is all up to you for prefix. The suffix is however important. .things goes into /things/ folder, .items into the /items/ folder etc…

Now go read the doc as rossko so kindly suggested :smiley:

Thanks for your patience :slight_smile: I managed to get your nilan.things, nilan.items, sitemap and the translations files placed in the appropriate folders and now I’m - sort of - in business :triumph: However, one slight problem: 99.9% of the entries in my log viewer are errors or warnings (see a small arbitrary extract below). Does that give you guys any indications on where to look for what is missing in my config? My device has a heater/cooler, but assume this has nothing to do with this flood of errors.

2020-04-07 13:38:01.864 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6d2e95[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1910,length=4,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID d161a055-3463-412d-939e-8a04f04d0afc]

2020-04-07 13:38:03.463 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 1e 03 07 76 00 04 a6 c8

2020-04-07 13:38:03.465 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2020-04-07 13:38:03.469 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@a4e630 (unit id 30 & transaction 324). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:03.471 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@a4e630 (unit id 30 & transaction 324). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:03.474 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6d2e95[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1910,length=4,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID 2a0e583e-aa7a-4c70-8287-c76b0a574d31]

2020-04-07 13:38:05.083 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 1e 03 07 76 00 04 a6 c8

2020-04-07 13:38:05.086 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2020-04-07 13:38:05.091 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@15d264b (unit id 30 & transaction 325). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:05.094 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@15d264b (unit id 30 & transaction 325). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:05.098 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6d2e95[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1910,length=4,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID ebe4978b-6092-4f31-a557-53746d59674c]

2020-04-07 13:38:06.693 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 1e 03 04 b0 00 08 46 b4

2020-04-07 13:38:06.695 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2020-04-07 13:38:06.699 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@1d81798 (unit id 30 & transaction 326). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:06.702 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@1d81798 (unit id 30 & transaction 326). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:06.705 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@825cc1[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1200,length=8,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID 6d45009b-a6d2-48e6-8e1d-8c0945f05018]

2020-04-07 13:38:06.760 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1200 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:06.767 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1201 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:06.776 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1202 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:06.784 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1203 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:06.793 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1204 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:06.801 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1205 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.320 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 1e 03 04 b0 00 08 46 b4

2020-04-07 13:38:08.322 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2020-04-07 13:38:08.326 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@12679f6 (unit id 30 & transaction 327). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:08.329 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@12679f6 (unit id 30 & transaction 327). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:08.332 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@825cc1[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1200,length=8,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID 4b42b007-3bc7-4045-b03d-57b39a07ea52]

2020-04-07 13:38:08.385 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1200 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.394 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1201 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.401 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1202 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.408 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1203 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.415 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1204 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:08.423 [ERROR] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:myNilan:AirTempRegisters:hold1205 ‘Modbus Data’ had ModbusSlaveIOExceptionImpl error on read: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message=‘I/O exception: IOException Error reading response (EOF)’, cause2=null)

2020-04-07 13:38:09.935 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 1e 03 07 76 00 04 a6 c8

2020-04-07 13:38:09.937 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)

2020-04-07 13:38:09.941 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@1a902c0 (unit id 30 & transaction 328). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:09.944 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@1a902c0 (unit id 30 & transaction 328). Serial parameters: SerialParameters@1c1775e[portName=/dev/ttyUSB0,baudRate=19200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=even,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

2020-04-07 13:38:09.947 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6d2e95[slaveId=30,functionCode=READ_MULTIPLE_REGISTERS,start=1910,length=4,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID d161a055-3463-412d-939e-8a04f04d0afc]

Assuming at least some of your Items are working?

One of your pollers is “blackholing”, that’s to say it gets no answer. I’m not sure if the Nilan would actively reject requests with “bad” combinations. many devices just don’t answer.

This one -

Well… First of all… Which devices is it you´r having? I believe its a Nilan. It is a Nilan CTS602 interface, right? If it is, there should be no issue with the heating/cooling, as these are using different registers than the one I use in my Device (Nilan Comfort 300). You´ll have to add these registers, if you want to monitor/control those as well.

Sometimes it´s needed to restart openhab to sort out these things, (specially with modbus). Perhaps even clearing cache and tmp as well. That could be worth a try. Start by restarting openhab.
I can not recommend restarting the binding. That use to make things alot worse cause the serial binding gets screewed up totally. Thats why its better to just restart openhab.
Make sure your modbus poller and data is online in PaperUI, and ofcouse the Serial Slave.

Thanks Rossko. Everything with modbus fails, but other things work, for example my phone is connected and responds.
I wonder, could it be that the +/- wires are reversely connected on the USB-stick? Pretty sure that it is correct, but that nothing works could indicate this…?

At the risk of adding something else to the mix, it is almost always easier to investigate and test basic connectivity outside of openHAB using a dedicated tool like modbus.py. Once you’ve figured baud rates and wire crossing out etc. you can know you’d that part of OH config right.

I’m using the USB-stick Kim suggested in the first post. I wonder if you or Kim could confirm that your settings matches mine under Things > Modbus Serial Slave

I use a .things file for the USB stick…
This is how the connection looks:

Bridge modbus:serial:myNilan [ port="/dev/ttyUSB0", id=30, baud=19200, stopBits="1.0", parity="even", dataBits=8, encoding="rtu" ]

It seems to be the same settings.

EDIT - Did you set the dip switches on the USB stick the same as my picture from post 1?

Yes, exactly the same. Just tried to unplug and reinsert the USB-key, and for a while most of the many “Modbus data” instances under Configuration > Things changed from “Offline - communication-error” to “online”. But shortly after back to “Offline - communication-error”.
The only instances online now are three “Modbus Serial Slaves”, one has a serial of “myNilan” and the others “1457a8d7” and “b0a4e06f”. myNilan has correct settings 19200 and id 30 whereas the two others have 9600 baud and id 1. They all have a green online indicator.