DIYOnXBee (oh1-addon) binding does not generate event for incoming packet on OpenHab2

Hi,

We installed DIYOnXBee binding on OH2 as below and it is sending packet to END DEVICE as configured in items.cfg file but when we send a packet from END DEVICE it is not getting received at OH2 Event Bus, since we could not see any incoming packet event in Karaf log.

###Install DIYOnXBee on OH2:

  1. Download a nightly build of the binding here.

  2. Add that(org.openhab.binding.diyonxbee-1.10.0-SNAPSHOT.jar) jar file in addons directory.

  3. Create openhab.cfg file in conf/services directory and add below lines (I am using Ubuntu).

    diyonxbee:serialPort=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AI036OKB-if00-port0
    diyonxbee:baudRate=9600

  4. Add below line to items/demo.items file
    Switch Living_Motion “Bewegung [MAP(de.map):%s]” (GF_Living,GPresence) { diyonxbee="<0013A20040E7782D:MOTION" }

  5. We configured the item to the switch created at Habpanel UI.

  6. Click on the Switch to ON and it sent command MOTION=ON to END DEVICE which is captured using XCTU as below

  1. From XCTU if we send Transmit Request packet with COORDINATOR DEVICE address, it is getting received which we verified using “cutecom” app using /dev/ttyUSB0. But it is not getting informed to OH2 event bus, since we could not see any message in Karaf log.

###Please find the Karaf log details below:

openhab> log:tail
15:44:42.118 [ERROR] [org.apache.felix.fileinstall ] - Failed to install artifact: /home/fabritronix/Openhab_diyonxbee/addons/org.openhab.binding.diyonxbee-1.10.0-SNAPSHOT.jar
org.osgi.framework.BundleException: A bundle is already installed with the name “org.openhab.binding.diyonxbee” and version “1.10.0.201703020211”
at org.eclipse.osgi.container.ModuleContainer.install(ModuleContainer.java:254)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.storage.Storage.install(Storage.java:517)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:146)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1036)[4:org.apache.felix.fileinstall:3.5.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:952)[4:org.apache.felix.fileinstall:3.5.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)[4:org.apache.felix.fileinstall:3.5.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)[4:org.apache.felix.fileinstall:3.5.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.6]
15:44:43.462 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘demo.items’
15:44:43.611 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘rrd4j.persist’
15:44:44.660 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘demo.rules’
15:44:44.991 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘demo.script’
15:44:45.447 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘demo.sitemap’
15:44:45.590 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Weather_Temperature-yahooweather:weather:berlin:temperature’ has been added.
15:44:45.595 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Sun_Azimuth-astro:sun:home:position#azimuth’ has been added.
15:44:45.597 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Moon_Azimuth-astro:moon:home:position#azimuth’ has been added.
15:44:45.599 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Sunset_Time-astro:sun:home:set#start’ has been added.
15:44:45.600 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Sun_Elevation-astro:sun:home:position#elevation’ has been added.
15:44:45.601 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Moon_Phase-astro:moon:home:phase#name’ has been added.
15:44:45.603 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Sunrise_Time-astro:sun:home:rise#start’ has been added.
15:44:45.605 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘Moon_Elevation-astro:moon:home:position#elevation’ has been added.
15:44:45.606 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘CurrentDate-ntp:ntp:demo:dateTime’ has been added.
15:44:45.686 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘demo.things’
15:44:46.329 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
15:44:46.784 [INFO ] [smarthome.event.ThingAddedEvent ] - Thing ‘ntp:ntp:demo’ has been added.
15:44:46.842 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘ntp:ntp:demo’ changed from UNINITIALIZED to INITIALIZING
15:44:46.974 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
15:44:47.037 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
15:44:47.070 [INFO ] [smarthome.event.ThingAddedEvent ] - Thing ‘yahooweather:weather:berlin’ has been added.
15:44:47.120 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘yahooweather:weather:berlin’ changed from UNINITIALIZED to INITIALIZING
15:44:47.323 [INFO ] [.diyonxbee.internal.DiyOnXBeeBinding] - opening XBee communication on ‘/dev/ttyUSB0’
15:44:47.326 [INFO ] [smarthome.event.ThingAddedEvent ] - Thing ‘astro:sun:home’ has been added.
Stable Library

Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2
15:44:47.411 [INFO ] [smarthome.event.ThingAddedEvent ] - Thing ‘astro:moon:home’ has been added.
15:44:47.421 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘astro:sun:home’ changed from INITIALIZING to ONLINE
log4j:WARN No appenders could be found for logger (com.rapplogic.xbee.api.InputStreamThread).
log4j:WARN Please initialize the log4j system properly.
15:44:47.746 [INFO ] [ulation.internal.HueEmulationServlet] - Started Hue Emulation service at /api
15:44:47.828 [INFO ] [ome.event.GroupItemStateChangedEvent] - GF_Living changed from NULL to UNDEF through Heating_GF_Living

15:44:52.106 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber ‘org.eclipse.smarthome.core.thing.link.ThingLinkManager@7a3361b5’ takes more than 5000ms.

15:44:52.107 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘yahooweather:weather:berlin’ changed from INITIALIZING to ONLINE

##Note

For windows we if configure serial port as COM3, it is saying as “Could not find port COM3”

Installed RXTX library for ubuntu

@juergen_richtsfeld, please have a look at this issue. Thanks.

Not for OH2? Don’t you want a file diyonxbee,cfg?

Hi @rossko57,

Do you think the issue is because of cfg file ?

If it is the case then first of all when I did switch ON or OFF from App (Habpanel) command(MOTION=ON or MOTION=OFF) should not have reached the END DEVICE.

Thanks.

We followed openhab doc

It says there
http://docs.openhab.org/tutorials/migration.html#configure-add-ons

Unlike in openHAB 1.x where all the binding configurations are placed in the one openhab.cfg file, openHAB 2 has a separate .cfg file for each binding. Transfer the settings for each binding from openhab.cfg to its new .cfg file, removing the binding name from the parameter.

Similar advice here
http://docs.openhab.org/addons/bindings/diyonxbee1/readme.html#binding-configuration

I don’t know whether thats got anything to do with your issue or not,but you have not configured as recommended.

I believe the section you referred is for OH2 addons and our’s is OH1 addon.

So we referred the below section in that document.

Anyways, I will rename file openhab.cfg to diyonxbee.cfg and let you know.

Installing Unofficially Supported openHAB 1.x Add-ons

Skip this section if all the add-ons you need have been installed already.

First check the list of add-ons that are known not to work in openHAB 2 and make sure yours is not among them.

Next install the openHAB 1.x compatibility layer using the Karaf Console instructions above.

Copy your openhab.cfg file to <openHAB 2 conf>/services. If you are running an apt-get installed openHAB 1.x openhab.cfg is located in /etc/openhab/configurations. For an apt-get installed openHAB 2 the <openHAB 2 conf> folder is located in /etc/openhab2. For manually installed openHAB 1.x this file is located in /configurations and in manually installed openHAB 2 it is /conf.

This file will have a lot of redundant configuration information in it that you have already moved over to individual binding .cfgs. Make sure to comment those out and just leave the config parameters for the bindings you are manually installing.

Now copy the add-on’s jar files that you want to install to the /addons folder for openHAB 2. For example:

cp /usr/share/openhab/addons/org.openhab.binding.astro-1.8.3.jar /usr/share/openhab2/addons

There are a number of issues with the section of the documentation you quoted. For one, it was written before all 1.x add-ons had proper documentation at docs.openhab.org. The subject of migrating from 1.x runtime is intertwined with configuring OH2, but I think those things should be separated better in the docs. The preferred approach for all add-ons that need a configuration file is to have a separate file as @rossko57 says.

Each add-on’s documentation at docs.openhab.org should be considered the primary guidance to follow for that add-on.

This means you have a bundle needs to be uninstalled first. Use bundle:list to find it and bundle:uninstall to uninstall it.

hi,
I’ve read through the comments but I don’t understand what you actually want
from me. could you please re-phrase?

best,
juergen

Hi,

I would like you to verify your binding with OH2, to make sure that why OH2 is not receiving or generating any event for incoming packet from Xbee.

Thanks.

Hi,

Since the announcement of OH2, @Kai, has mentioned that there is no more maintenance of OH 1.8 runtime and only the openHAB 1 compatible add-ons will be further maintained, based on blog.

So, it is better to verify the existing 1.8 DiyOnXbee binding with OH2.

Thanks,
Kiran.