SuperOok / openhab-vallox

Openhab interface to a vallox central venting unit
Eclipse Public License 1.0
1 stars 1 forks source link

How to compile... #1

Closed majherek closed 7 years ago

majherek commented 7 years ago

Hi,

I am new to openhab developement.

If I understand org.eclipse.smarthome.binding.vallox is binding for openHAB 1? How can I compile it? Howto add this binding to openhab top directory?

I successfully compile openHAB from https://github.com/openhab/openhab.git under my Ubuntu.

[INFO] openHAB Features .................................. SUCCESS [0.001s] [INFO] openHAB Feature Addons External ................... SUCCESS [7.011s] [INFO] openHAB Feature Addons ............................ SUCCESS [9.030s] [INFO] openHAB Feature Legacy Addons ..................... SUCCESS [6.130s] [INFO] openHAB Feature Verification ...................... SUCCESS [7:24.815s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 13:06.838s [INFO] Finished at: Sun Nov 20 14:37:01 CET 2016 [INFO] Final Memory: 188M/1657M [INFO] ------------------------------------------------------------------------

What is direcotry vallox? Is this standalone JAVA program for Vallox? And again -> how to compile it?

I have trouble with using Eclipse IDE ;-( Normally I use vim + gcc ;-)

And I really want to run this binding.

Thanks in advanced.

majherek commented 7 years ago

Hi,

after some work with eclipse I realise that this is openHAB2 addon.

Program "vallox" use tcp connection to server, which acts as TCP<->RS485 converter? It can't be used with local RS485 com port?

SuperOok commented 7 years ago

The vallox binding is heavy work in progress. Just in experimental state. I test it by running it from Eclipse with the Eclipse Smart Home in workspace. So far it works fine. Creating a headless build (via Maven Tycho) is one of the next steps.

And yes, I use a Ethernet↔RS485 converter as stated in the readme. I'm not familiar with doing serial (and especially RS485) from within Java. If you provide some code in the "serialWrite" method for accessing the serial interface, I could integrate it and make it a configuration property in the web-configuration. I have no device to test RS485 directly. What device do you want to use?

SuperOok commented 7 years ago

I now added some stuff (target platform and maven build files) such that a headless build is working:

  1. In src directory execute on commandline mvn package
  2. On success there should be some target directory within the bundle directory; it should contain one .jar file like org.eclipse.smarthome.binding.vallox-1.0.0-SNAPSHOT.jar
  3. It is supposed to get installed by throwing it to the OpenHab2 deploy directory; however, it fails for me with some exception, see forum post. Hope to get some hint there
majherek commented 7 years ago

Yesterday, at the evening, I successufully compiled your's project ;-) But I didn't test it yet.

In eclipse installation, I choose: Eclipse IDE for Java Developers. And after that: Github Project -> openHAB -> OpenHAB 2 Add-ons and Eclipse SmartHome Extensions.

Import your's project, and after that export it nito jar file, as described in: https://github.com/openhab/openhab/wiki/How-To-Implement-A-Binding#building-and-packaging.

After I find some soft to convert RS485 to ethernet in linux, I will test the my build and your's build. I successfully compiled it now. (mvn clean install -U).

[INFO] Reactor Summary: [INFO] [INFO] org.eclipse.smarthome.binding.vallox.parent ....... SUCCESS [0.223s] [INFO] org.eclipse.smarthome.binding.vallox .............. SUCCESS [2.199s] [INFO] org.eclipse.smarthome.binding.vallox.target ....... SUCCESS [0.014s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 54.394s [INFO] Finished at: Mon Nov 21 21:15:55 CET 2016 [INFO] Final Memory: 59M/515M [INFO] ------------------------------------------------------------------------

I use cheapest USB converter from aliexpress. https://www.aliexpress.com/item/new-USB-to-RS485-485-Converter-Adapter-Support-Win7-XP-Vista-Linux-Mac-OS-WinCE5-0/32540188656.html I test it with valloxserial.net on win10. Its work.

Why now in src direcotry there are two dirs: org.eclipse.smarthome.binding.vallox and org.eclipse.smarthome.binding.vallox.target?

SuperOok commented 7 years ago

I added some more hints in the readme how to compile. You now can compile from commandline via 'mvn package' and copy the resulting *.jar file to the OH2 karaf 'deploy' directory.

The .target directory contains one file, the "target" definition. This XML file contains all dependencies to Openhab and Eclipse Smart Home bundles such that the headless build can download the dependent jars and build the bundle against them. So you do not need to manually setup an eclipse workspace at all. Hope it works for you.

majherek commented 7 years ago

Thanks,

now I can do everything headless linux ;-) There is mistake (should be RS485): Host name or IP address of RS483-to-Ethernet gateway.

I hope, that I write something in java to use local RS485. I will be back ASAP ;-)

majherek commented 7 years ago

Hi,

I finally run the plugin.

==> /var/log/openhab2/openhab.log <== 2016-11-24 09:58:54.665 [INFO ] [g.vallox.service.ValloxSerialHandler] - dispose() 2016-11-24 09:58:54.693 [INFO ] [g.vallox.service.ValloxSerialHandler] - initialize() 2016-11-24 09:58:54.694 [INFO ] [g.vallox.service.ValloxSerialHandler] - Connected to localhost:1026 ==> /var/log/openhab2/events.log <== 2016-11-24 09:58:54.696 [ThingUpdatedEvent ] - Thing 'vallox:kwl90se:3ab9e516' has been updated. ==> /var/log/openhab2/openhab.log <== 2016-11-24 09:58:54.696 [INFO ] [g.vallox.service.ValloxSerialHandler] - Start listening to vallox telegrams! ==> /var/log/openhab2/events.log <== 2016-11-24 09:58:54.697 [hingStatusInfoChangedEvent] - 'vallox:kwl90se:3ab9e516' changed from OFFLINE (COMMUNICATION_ERROR): Failed to start connection to Vallox serial interface: java.net.ConnectException: Connection refused (Connection refused) to INITIALIZING 2016-11-24 09:58:54.898 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_FanSpeed changed from 4 to 8 2016-11-24 09:58:55.899 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_OutEfficiency changed from 0 to 100 2016-11-24 09:58:56.299 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_TempOutside changed from 11 to 14 2016-11-24 09:58:56.500 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_InEfficiency changed from 100 to -700 2016-11-24 09:58:56.700 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_OutEfficiency changed from 100 to 800 2016-11-24 09:58:57.101 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_OutEfficiency changed from 800 to 0 2016-11-24 09:58:57.302 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_AverageEfficiency changed from 50 to -350 2016-11-24 09:58:57.302 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_InEfficiency changed from -700 to 100 2016-11-24 09:58:57.303 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_AverageEfficiency changed from -350 to 50 2016-11-24 09:58:57.501 [hingStatusInfoChangedEvent] - 'vallox:kwl90se:3ab9e516' changed from INITIALIZING to ONLINE 2016-11-24 09:59:09.658 [ItemCommandEvent ] - Item 'vallox_kwl90se_3ab9e516_FanSpeed' received command 4 2016-11-24 09:59:09.658 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_FanSpeed changed from 8 to 4 2016-11-24 09:59:11.603 [ItemCommandEvent ] - Item 'vallox_kwl90se_3ab9e516_PowerState' received command ON 2016-11-24 09:59:11.604 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_PowerState changed from OFF to ON ==> /var/log/openhab2/openhab.log <== 2016-11-24 09:59:11.604 [WARN ] [g.vallox.service.ValloxSerialHandler] - Trying to send set-command to read-only channel: PowerState Ignoring. 2016-11-24 09:59:11.710 [WARN ] [g.vallox.service.ValloxSerialHandler] - Received Telegram has no Domain byte, ignoring telegram: 73 2016-11-24 09:59:11.710 [WARN ] [g.vallox.service.ValloxSerialHandler] - Received Telegram has no Domain byte, ignoring telegram: DF

I use ser2net package: ser2net - Serial port to network proxy with configuration: 1026:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT

1) Is it possible, to implement reconnect in plugin? If i restart ser2net daemon, java lost communication channel to RS<->Ethernet proxy:

==> /var/log/openhab2/events.log <== 2016-11-24 09:58:20.168 [ItemCommandEvent ] - Item 'vallox_kwl90se_3ab9e516_FanSpeedMin' received command 2 2016-11-24 09:58:20.168 [ItemStateChangedEvent ] - vallox_kwl90se_3ab9e516_FanSpeedMin changed from 5 to 2 ==> /var/log/openhab2/openhab.log <== 2016-11-24 09:58:20.168 [ERROR] [g.vallox.service.ValloxSerialHandler] - Failed to handle command to Vallox serial interface: java.net.SocketException: Broken pipe (Write failed)

2) Is this really true? 2016-11-24 11:15:06.196 [WARN ] [g.vallox.service.ValloxSerialHandler] - Trying to send set-command to read-only channel: PowerState Ignoring. Where can I find which items/channel are read-only?

SuperOok commented 7 years ago

this issue is closed. you should create a new issue for each new topic

SuperOok commented 7 years ago

re-connect issue see #2

SuperOok commented 7 years ago

read-only issue see #3