I agree.
The datasheet [page 2-3] hasn’t changed since then. I’d check where the wires blue and yellow wire’s (next to the USB plug) are going to.
I guess that they just connected it on the CTS602 board and left it open on the other side.
If that’s the case, check the 12V on the same screw terminal. If that’s ok too I’d give it a go connecting it.
If that’s not the case you can do two things (as the RS485 port is an official one): Call your installing electrician for datasheets or ask at Nilan headquarters.
Got it all wired up now. Trying to setup the connection using nickma´s config file only changig the host IP. But end up with connection and refuse error. Now what?
Changed to use serial insted. Got a new problem. Seems like something hangs or something… baud rate is wrong. But according to my cfg, it´s set to 19200.
Will follow up tomorrow.
2018-02-09 00:55:22.536 [ERROR] [inding.modbus.internal.ModbusBinding] - Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
==> /var/log/openhab2/openhab.log <==
2018-02-09 00:55:22.542 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=367, bundle=234/mvn:org.openhab.binding/org.openhab.binding.modbus/1.11.0]: Updating property tcp.nilan.connection of configuration org.openhab.modbus caused a problem: Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
org.osgi.service.cm.ConfigurationException: tcp.nilan.connection : Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
at org.openhab.binding.modbus.internal.ModbusBinding.updated(ModbusBinding.java:702) [234:org.openhab.binding.modbus:1.11.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [7:org.apache.felix.configadmin:1.8.16]
at java.lang.Thread.run(Thread.java:748) [?:?]
Hi Kim,
you bought an USB->RS485 dongle right? If true you can NOT connect to that device via TCP/IP, you have to use the serial version!
I would recommend you give my bringup (via python). Ultimatelly you probably need a config like this.
Yeah, I bought the InCircut RS485 dongle. (simular to the one you have with the four dip-switches)
I figured out that it couldnt do the TPC/IP connection, så I changed the config to using serial insted. But that just gave me a new, another error.
I have no idea how to execute this .py script you referering to. I´m relative new to Rpi, Linux and OpenHab2. Infact I´m not even sure if the Rpi is plug&play ready regarding the RS485 dongle, and have no idea how to test it.
I just, wired the Nilan to the dongle according to the explanation, pluged in the dongle, installed the binding, and then trying to set it up ind the modbus.cfg with a few test items in the nilan.items file.
Number nilan_t0 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:0"}
Number nilan_t1 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:1"}
Number nilan_t2 "t2_tmp variable [%2.2f °C]" <temperature> (heat_nilan) {modbus="nilan:2"}
Number nilan_t3 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:3"}
Number nilan_t4 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:4"}
Number nilan_t5 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:5"}
Number nilan_t6 "temporary variable will be processed in .rules file[%2.2f °C]" <temperature> (heat_nilan) {modbus="nilan:6"}
Number nilan_t7 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:7"}
Number nilan_t8 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:8"}
Number nilan_t9 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:9"}
Number nilan_t10 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:10"}
Number nilan_t11 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:11"}
Number nilan_t12 "temporary variable will be processed in .rules file[%2.2f °C]" <temperature> (heat_nilan) {modbus="nilan:12"}
Number nilan_t13 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:13"}
Number nilan_t14 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:14"}
Number nilan_t15 "temporary variable will be processed in .rules file" <temperature> (heat_nilan) {modbus="nilan:15"}
Get some errors when trying to install pyserial minimalmodbus
[00:58:28] openhabian@openHABianPi:~$ sudo apt-get -y install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[00:58:49] openhabian@openHABianPi:~$ sudo pip install pyserial minimalmodbus
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
['__name__'])
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
Hmm still get this odd error… It looks like it´s still trying to establish an TCP/IP connection, even though I have changed the config file to be using serial insted.
2018-02-10 11:59:50.284 [ERROR] [inding.modbus.internal.ModbusBinding] - Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
2018-02-10 11:59:50.333 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=366, bundle=234/mvn:org.openhab.binding/org.openhab.binding.modbus/1.11.0]: Updating property tcp.nilan.connection of configuration org.openhab.modbus caused a problem: Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
org.osgi.service.cm.ConfigurationException: tcp.nilan.connection : Exception when parsing configuration parameter tcp.nilan.connection = 10.4.28.237:502:60:0:0:3 -- java.lang.IllegalArgumentException invalid baud rate: 502
at org.openhab.binding.modbus.internal.ModbusBinding.updated(ModbusBinding.java:702) [234:org.openhab.binding.modbus:1.11.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [7:org.apache.felix.configadmin:1.8.16]
at java.lang.Thread.run(Thread.java:748) [?:?]
Your USB dongle plus the connection is good, would be nice if you shared you wiring …
That doesn’t mean, that there is an error with the serial connection too.
openhab-cli console
#default password is habopen
# inside the openhab CLI (command line interface)
items list | grep nilan
# Strg+D to quit
Concerning your config:
Have you changed each and every entry in /etc/openhab2/services/modbus.cfg?
Please also take a look in the userdata directory /var/lib/openhab2/config/org/openhab/modbus.config
Picture is the InCircut USB RS485 dongle.
PINs from left to right: (Should be simular to the same in your InCircut dongle I found in your links).
PIN 1. (GND) - Blue
PIN 2 (A1) - Yellow
PIN 3 (B1) - Brown
Picture is the interface located on the outside (right side) of the Nilan Comfort 300LR (notic there are two cables. The lower is for the User Panel). Previous I´d supply a picture of the inside of the CTS 602 controller, noticing that all pins have been wired.
PIN 2 (A1) - Yellow
PIN 3 (B1) - Brown
PIN 6 (GND) - Blue
I´m using openhabian. For some reason, which I have not been able to understand, there is a difference using openhab or openhabian.
To enter the consol in openhabian, I use Putty and SSH and enter using openhabian username and its password.
The doc for openhab is not very specific regarding the openhabian/openhab user. Both are there, but i´m not able to login using openhab:habopen…So I have no idea how to
items list | grep nilan
This kind of linux stuff is really killing me
I have deleted all tcp.nilan in the /var/lib/openhab2/config/org/openhab/modbus.config
It didn´t really changed anything, except I guess I´m rid of the errors when rebooting the Rpi due to this change.