Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



QNAP - Determine co...
 
Share:
Notifications
Clear all

[Solved] QNAP - Determine communication device for USB Zigbee Dongle (Home Assistant)

2 Posts
1 Users
0 Likes
205 Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2692
Topic starter  

Based on the recommendations of the good folks behind Home Assistant, I did get myself a Zigbee 3.0 USB dongle.

This one:

All looked good, until I got the request to enter the Zigbee sierial port device ...

So, your QNAP runs a Linux variation and how am I supposed to detect this "com port" device?

Not knowing where to look, I first tried using "lsusb", which didn't help much besides seeing that the USB device is connected.

Before connection the USB dongle (removed some irrelevant lines):

[~] # lsusb
...
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 011: ID 1058:2667 Western Digital Technologies, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 1005:b155 Apacer Technology, Inc. 
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. 
...

After plugging the dongle in, it showed this:

[~] # lsusb
...
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 011: ID 1058:2667 Western Digital Technologies, Inc. 
Bus 002 Device 004: ID 1a86:55d4 QinHeng Electronics 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 1005:b155 Apacer Technology, Inc. 
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. 
...

The "QinHeng Electronics" device (Bus 002, Device 4) is the dongle - so it did get connected. No clue to the device name though.

From reading up on the topic, a device could show as /dev/ttyUSBx and /dev/ttyACMx. (x= number, starting with "0" - difference explained in this article if you're interested).

So here we did the "before-and-after" trick again, just by listing the devices that start with "/dev/tty", and comparing that with the lits of these devices after we connect the dongle.

With the dongle NOT plugged in, pulling a list of all tty devices:

[~] # ls /dev/tty* > /tmp/ttydevs_before.txt

To make sure I know how many there are, I did a count as well:

[~] # ls /dev/tty* | wc -l
69

Next I plugged in the dongle - give it a few seconds, maybe try with "lsusb" to see if the device appears.
Or try it with count "/dev/tty" devices (69 became 70! Woohoo!):

[~] # ls /dev/tty* | wc -l
70

Once the device appears, pull another list of "/dev/tty" devices asn:

[~] # ls /dev/tty* > /tmp/ttydevs_after.txt

No compare the lists:

[~] # diff /tmp/ttydevs_before.txt /tmp/ttydevs2_after.txt   
 --- ttydevs_before.txt
 +++ ttydevs_after.txt
@@ -63,6 +63,7 @@
 /dev/tty7
 /dev/tty8
 /dev/tty9
+/dev/ttyACM0
 /dev/ttyS0
 /dev/ttyS1
 /dev/ttyS2
[~] # 

Here we compare ttydevs_before.txt and ttydevs_after.txt and we see that in ttydevs_after.txt a line is added (in comparison to ttydevs_before.txt):

So the device we were looking for is ...

/dev/ttyACM0

 

 


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2692
Topic starter  

Tip: If you're running Home Assistant OS as a virtual machine:

1) Open VirtualizationStation

2) Click the cog to configure things (in this case its OK to keep the Virtual Machine running)

3) Click the little USB button in the USB section to add the Zigbee USB 3.0 dongle (QinHeng Electronics device in this case). Click OK and agree that the dongle is working for the VM now (and not QTS).

 

In Home Assistant the device will show now (/dev/ttyAMC0 in my case).


   
ReplyQuote
Share: