XBee S2D with openHAB2

Hi all,

Thank you in advance for your advice. I’m very new to openHAB and I’m still learning how to use OH.

I have a XBee S2D module mounted onto the XBee SMT Grove Development Board. I’m trying to use OH 2.5.3 Release Build to connect with a Philips Hue Motion Sensor. I have installed the OH in Ubuntu 18.04 (Guest OS in Virtualbox with native Host OS Windows 10, my project requires me to work with Linux OS).

On Windows 10, I’m able to discover the motion sensor using the XBee DIGI XCTU software. However, I have issue discovering the motion sensor using openHAB in Ubuntu.

I have done the following so far:

  1. Paper UI > Add-ons > BINGINGS > ZigBee Binding 2.5.3 installed
    The settings for the XBee S2D module are:
    Port: /dev/ttyUSB1
    Baud Rate: 9600
    Flow Control: Hardware
  2. Paper UI > Things > XBEE Coordinator (Status ONLINE)

However, when I go to Inbox and Scan for Things, I could not discover the motion sensor. Are there any steps which I might have missed out or have done incorrectly?

Thank you.

J

Are you resetting the device after starting join in PaperUI? If so I’m not really sure what else could be wrong. I don’t use the S2 here, but it was previously tested when I developed it and I’m sure others are using it.

Hi Chris,

Thank you for your reply.

If I understand you correctly, then the answer is no, I didn’t reset the device after getting the Online status. I go straight to Inbox and click on the Scan icon to start scanning for devices.

However, I did notice something weird, when I disable the S2D module by clicking on the “alarm” icon in Paper UI > Configuration > Things, I couldn’t get it back Online again by clicking on the “alarm” icon again. I did not disconnect the S2D module nor press on the Reset button while doing this.

The only way to get it back online is to flash the S2D module using XCTU back to its default settings. It happen every time I tried to disabled and enabled the module.

J

In general it’s a good idea to reset the device for 2 reasons. Firstly, if the device has been used in the past then it will need to be reset to remove it from the previous network before it can be joined to a new network, and secondly as this is a battery device, it will probably not be permanently trying to join the network so needs waking.

I’m not 100% sure what that does. I thought it should simply remove the handler so it would have been the same as removing or restarting the binding. Can you provide a debug log showing this?

Below is the error log that I have.

2020-04-01 21:53:41.057 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2020-04-01 21:53:41.543 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://10.0.2.15:8080
2020-04-01 21:53:41.548 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://10.0.2.15:8443
2020-04-01 21:53:41.852 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2020-04-01 21:53:41.906 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2020-04-01 21:53:41.978 [INFO ] [openhab.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2020-04-01 21:53:43.860 [ERROR] [.zigbee.dongle.xbee.ZigBeeDongleXBee] - Unable to open XBee serial port
2020-04-01 21:53:43.862 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.initialiseZigBee(ZigBeeCoordinatorHandler.java:417) ~[?:?]
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.lambda$2(ZigBeeCoordinatorHandler.java:535) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2020-04-01 21:53:44.910 [ERROR] [.zigbee.dongle.xbee.ZigBeeDongleXBee] - Unable to open XBee serial port
2020-04-01 22:19:31.052 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.initialiseZigBee(ZigBeeCoordinatorHandler.java:417) ~[?:?]
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.lambda$2(ZigBeeCoordinatorHandler.java:535) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

There are some activities which I’ve done after seeing the serial port error.

I deleted the XBee Coordinator and manually add the XBee Coordinator again. This time, I didn’t see any additional error log, even though the status is “offline”. Thinking that openHAB is unable to open the serial port, I tried to send the ASCII characters “+++” to the XBee to go into command mode using my own C++ serial port program. However, I didn’t get a response from the XBee. When I re-open the port after I deleted the XBee Coordinator, I’m able to get a response from the XBee after sending the ASCII characters “+++” to it.

Another thing that I have tried is, even though the XBee Coordinator status shows that the XBee is “offline”, when I go to Inbox > Scan for Things > XBee bindings, I saw the RX/TX LEDs on the S2D module blinking. So I believe that openHAB is able to talk to XBee even though the status is “offline”.

If the above is correct, then what steps am I missing from discovering end-devices.

Before the scanning of devices in the steps I mentioned above, I did both a short reset (reset less than 5 seconds) and a long reset (more than 10 seconds), but both times, I still can’t discover the motion sensor.

J