Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Ability to auto-detect known dongles based on information provided in info USB-to-UART bridge/converter chip #122

Open
Hedda opened this issue Feb 28, 2022 · 2 comments

Comments

@Hedda
Copy link
Contributor

Hedda commented Feb 28, 2022

Request ability to automatically discover known dongles based on information provided in ex. USB-to-UART bridge/converter chip.

A somewhat similar feature has as POC been implemented in Electrolama 's llama-bsl (which is a fork of JelmerT's cc2538-bsl):

Koenkk/Z-Stack-firmware#310

Koenkk/Z-Stack-firmware#311

(Electrolama 's llama-bsl depends on index.json https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/master/index.json ).

The idea is to use VID (Vendor Identification), PID (Vendor Identification), in combination with "Product Description" that manufacturers have the option to write if using a USB-to-UART bridge / USB-to-Serial converter chip model with writable EEPROM.

USB-to-UART chips with writable EEPROM includes; WCH CH340B, FTDI FT231 series, and Silicon Labs CP210x series.

Zigbee USB dongle manufacturers will normally not change VID or PID for different Zigbee USB dongles that use the same model of USB-to-UART bridge/converter chip (as changing the VID or PID then also require the manufacturer to provide a custom device driver), but what they will change is write a custom "Product Description" string to the writable EEPROM in the USB-to-UART bridge / USB-to-Serial converter chip. Applications can then use that custom "Product Description" string to detect a unique product, such as for example a specific Zigbee USB dongle.

A similar auto-discovery feature was recently added to Home Assistant's for its ZHA integration for discovering USB adapters:

https://www.home-assistant.io/blog/2021/09/01/release-20219/#usb-discovery

ZHA integration component now already support automatic discovery of the most popular Zigbee USB dongles:

https://www.home-assistant.io/integrations/zha/#discovery-via-usb-or-zeroconf

The integration in turn rely on the USB Discovery integration which watches host for USB devices:

https://www.home-assistant.io/integrations/usb/

You can find some examples of known Zigbee adapters in Home Assistant's ZHA components and USB discovery code:

https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json

  "usb": [
   {"vid":"10C4","pid":"EA60","description":"*2652*","known_devices":["slae.sh cc2652rb stick"]},
   {"vid":"10C4","pid":"EA60","description":"*tubeszb*","known_devices":["TubesZB Coordinator"]},
   {"vid":"1A86","pid":"7523","description":"*tubeszb*","known_devices":["TubesZB Coordinator"]},
   {"vid":"1A86","pid":"7523","description":"*zigstar*","known_devices":["ZigStar Coordinators"]},
   {"vid":"1CF1","pid":"0030","description":"*conbee*","known_devices":["Conbee II"]},
   {"vid":"10C4","pid":"8A2A","description":"*zigbee*","known_devices":["Nortek HUSBZB-1"]},
   {"vid":"10C4","pid":"8B34","description":"*bv 2010/10*","known_devices":["Bitron Video AV2010/10"]}
  ],

https://github.com/home-assistant/core/blob/dev/homeassistant/generated/usb.py

# match https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json and https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave_js/manifest.json

This USB discovery method is also supported by Z-Wave JS integration in Home Assistant for discovering Z-Wave USB adapters:

https://www.home-assistant.io/integrations/zwave_js/#discovery-via-usb

https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave_js/manifest.json

  "usb": [
    {"vid":"0658","pid":"0200","known_devices":["Aeotec Z-Stick Gen5+", "Z-WaveMe UZB"]},
    {"vid":"10C4","pid":"8A2A","description":"*z-wave*","known_devices":["Nortek HUSBZB-1"]},
    {"vid":"10C4","pid":"EA60","known_devices":["Aeotec Z-Stick 7", "Silicon Labs UZB-7", "Zooz ZST10 700"]}
  ]

More discussion about that feature here:

https://community.home-assistant.io/t/community-help-wanted-to-whitelist-all-compatible-zigbee-and-z-wave-usb-adapters-for-automatic-discovery-in-home-assistant-os/344412

PS: Again, the that if customers can ask manufacturers to add this as a feature for new USB devices but remember that a manufacturer should only configure a custom “Product Description String”, and not change the original VID or PID (as doing so would require providing custom drivers for the operating system).

@Hedda
Copy link
Contributor Author

Hedda commented Feb 28, 2022

Owers of the popular ITead Sonoff Zigbee 3.0 USB Dongle Plus adapters should know that the first few batches were shipped without a custom “Product Description" written to its CP2102N chip and that will prevent discovery of it as a unique adapter.

ITead has released this script/application (for Windows OS) which should write the same “Product Description" to its CP2102N chip as is written in the factory on later shipped adapters (which I, unfortunately, could not get to work myself on my dongle):

https://www.facebook.com/SONOFF.official/posts/2927251720919807

Personally, I wish that ITead would instead have released a script based on this open-source cp210x-program by VCTLabs:

https://github.com/VCTLabs/cp210x-program

If anyone does make a cp210x script based on that open-source cp210x-program by VCTLabs please let me know for testing. See:

VCTLabs/cp210x-program#19

@Hedda
Copy link
Contributor Author

Hedda commented Mar 2, 2022

I guess this could more easily be developed/tested using the official Silabs official CP2102N USBXpress Bridge Development Kits?

https://www.silabs.com/development-tools/interface/cp2102n-development-kit

https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant