Zwave and Bluetooth Blugiga (marketbinding) not working together

Someone has reported that there was an issues with his virtualization environment. Are you running your OH in a container (VMWare, VirtualBox, Docker)?

Yes, but i ran it before on a raspberry and had the same problems

Iā€™m quite serious, someone on my thread reported that his vertualization environment steals/confuse serial ports, he switched back to host and looks like it was resolved.

OK, i will check that during the xmas holidays

Hi Thomas,
I do have the same situation here in combination of Bluegiga transport and Zigbee (not zwave).
@vkolotov has filed an issue about it:

I circumvent the issue currently by starting Zigbee first and then installing the Bluetooth binding.
Well - quite ugly. But I havenā€™t found any other solution so farā€¦

It was me :wink:

FTR: This is the post in which I describe the issue on my side:

Yes, it seems like this. But maybe by chance the serial ports had a different order on the bare metal system and/or the bindings started in a ā€œbetterā€ order.

Back on the ESXi, the issue re-appeared instantly.

1 Like

Unfortunately i have no zigbee so that i cannot check if the same problem occurs between zigbee and zwave.

In addition i am not aware of the mechanism to get a list of serial ports and then select one.

Iā€™ve tried with both: zwave controller and/or zigbee coordinator in combination with Bluegiga/Bluetooth.

Could you de-install the (yet configured) Bluetooth binding and the Bluegiga transport.
Then restart openhab and let the zwave open itā€™s serial port.

Then re-install Bluetooth and Bluegiga (it is still configured and should work instantly).

Check, if this more reliable than before?

What was the result with zwave and zigbee without bluegiga?

I will check that

It is working, but i did not see the zwave network in Habmin and all Battery devices ar in the Request_NIF state after a restart. I quit for today

IIRC, both have worked as expected as long as the Bluegiga transport wasā€™nt enabled.
Unfortunately, I canā€™t re-check this right now.

I did some more testing this morning:

  1. removed the (virtual) USB-ports from the openHAB VM
  2. re-added in a different order (first zigbee, then the Bluegigas)
  3. re-startet openHAB
  4. rebooted whole VM

After Step #3, I have all four serial adapters running. But after reboot (Step #4) is zigbee missing itā€™s adapter again.

So the most promising way to get all the serial adapters accessible from the different bindings at the same time is:

  1. de-install Bluetooth and Bluegiga.
  2. restart openHAB and let the other bindings open their respective serial adaptor
  3. install Bluetooth and Bluegiga (using the yet-existing configuration)

Well, this is just a workaround and not suitable for ā€œdaily operationā€.

@vkolotov: May I ask you to provide some option for a ā€œdelayed startā€ of the Bluegiga transport? As long as we donā€™t really understand the root cause of the issue, this might be a way of mitigating the hurt for nowā€¦

From the user point of view the main difference ist that zwaver presents a drop down list to select a serail port and the bluetooth binding selects the serial ports using a regex. So both binding need to read all available ports.

Currently i am setting up a new Raspi 3 and see what come. Maybe i try to understand the code for selecting the ports

1 Like

Just had another thought:

When we are running openHAB in a VM, we are on a much more powerful system than when we are testing on SBCā€™s (Raspberry Pi etc.).

So the question is:
When (in time) do the bindings collect the available serial ports? Is it during start of the binding or when we open the configuration dialog in PaperUI?

In the first case ALL bindings could ask the same bundle/library at almost the very same point in time especially on very fast hardware. If the specific library/function (ā€œgive me all available serial portsā€) is not safe for beeing called reentrantly - this might cause the odd/incomplete output.

Have to admit: Iā€™m not a developer and I do not understand how the underlaying libs are working. So please be tolerant with me if this complete nonsense :wink:

I just moved from a vm to a raspi, now i am setting up everything. maybe tomorrow i am able to check if thing are happen on the raspi as in the VM

I did another test: Iā€™ve moved the usb/serial dongles from the ESXi to a separate system (tiny SBC with Armbian Stretch). This guy runs ser2net to provide remote access to the four serial ports which I currently have in this test setup (three Bluegigaā€™s and one Zigbee CC2531).

In the openHAB VM on the ESXi Iā€™ve startet a couple of socatā€™s to provide local serial ports as /dev/something* which in is in turn redirected to the remote SBC running ser2net. So itā€™s now a typical socat/ser2net setupā€¦

Surprisingly, this setup shows almost the same behaviour as with the ā€œvirtualā€ local USB ports on the ESXi host: When I start the configuration page for the Zigbee coordinator, just one single serial port is listed (instead of four existing ports). Same as Thomas had with the Zwave and I had with my former tests on the ESXi with locally attached USB2Serial dongles. So I still cannot configure the Zigbee stuff while the Bluetooth binding(Bluegiga transport is running because the right dongle is just not listed. :frowning:

BUT: Once configured (e.g. while Bluetooth was deinstalled) the Bindings can open all their respective ports. Thatā€™s different to the local setup. Both Bindings are happy with their dongles now. I can restart openHAB and the Bindings initialize well again.

So beside the configuration quirk, this could work for me.

Nevertheless, there is some oddity in some used serial library, some timing and/or reentrance issue etc. which is worth to look after. :slight_smile:

Ok, now i moved from my VM to a Raspberry pi 3. And get the same behavior. Without bluegiga all serial ports are shown in zwave binding. The after installing the blugiga binding only one port is show, but this port ist not the zwave port. Uninstalling bluegiga does not change anything, but after a restart all ports ar shown for zwave.

So i would say that that has definitly has nothing to do with a VM :triumph: by the way i do not use ESX for virtualisation i use the Synology virtualisation

Wow. Thatā€™s interesting. Thankā€™s for checking!

And: Have you checked the behaviour when

  1. Zwave controller has been configured to use itā€™s port (while Bluetooth/Blugiga is removed)
  2. installing Bluetooth/Blugiga and configure it too
  3. restart openHAB

Are both bindings able to open all their ports or is zwave unable to open the controller?

Checked it both binding are able to open the ports. Seems that the is a Problem in paper ui?

I am having the same issue with z-wave binding, Bluetooth Binding binding-bluetooth - 2.5.0.M1, and Bluetooth Binding TinyB Transport market:binding-3769218 - 1.0.

If I have the z-wave binding by itself with no bluetooth it works. If I have both bluetooth bindings installed with no z-wave they work. The second I install both bindings and reboot, everything goes crazy and neither of them seem to work correctly. I assume they are both trying to use the /dev/ttyACM0 port. Thatā€™s what I have configured for z-wave but bluetooth doesnā€™t seem to let you configure a port. It seems when the machine comes up, it does iterate through what is connected and assigns ports randomly.