Open Hedda opened 2 years ago
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:
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
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):
https://github.com/Koenkk/Z-Stack-firmware/issues/310
https://github.com/Koenkk/Z-Stack-firmware/pull/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
https://github.com/home-assistant/core/blob/dev/homeassistant/generated/usb.py
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
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).