cyijun / OpenZ3Gateway

An open source Zstack3 gateway powered by ESP8266 and CC2652 modules
Apache License 2.0
39 stars 13 forks source link

SUGGESTION] Switch to USB-to-UART bridge chip with programmable EEPROM so can add custom "Product Description String" string as unique identifier #3

Closed Hedda closed 2 years ago

Hedda commented 2 years ago

Please consider switching the design to a other USB-to-Serial converter chip with its own writable EEPROM as a hardware feature.

This would allow you to add your own custom "Product Description String" as a unique identifier for it via the USB interface, and the reason for wanting a unique identifier via the USB interface is in order to enable the possibility for it to support automatic USB discovery of Zigbee USB adapters.

The whole point of this is to make it possible for developers to make the initial installation of Zigbee solution plug-and-play friendly and easier for different home automation software to automatically USB discover and initiate a setup without end-user interactions.

Support for USB discovery was recently added to Home Assistant OS (formerly HASSIO) and the ZHA integration for it, see here:

https://community.home-assistant.io/t/unique-friendly-name-description-for-automatic-zigbee-usb-adapter-discovery-in-home-assistant-zha-using-dongle-vendor-product-ids/337077

That unique customized USB description string could be something like ex.; "cyijun OpenZ3Gateway v2 hardware revision 2.0.0"

The unique "description" string for each USB adapter can then be added to HA via a PR like this -> https://github.com/home-assistant/core/pull/56201

As I understand it, cheaper CH340 series (example CH340C and CH340E) by WCH which unfortunately does not support this feature.

I understand that more expensive chips like FT231 chips by FTDI and CP210x chips by Silicon Labs / Silabs do support this feature:

https://ftdichip.com/products/ft231xs/ https://ftdichip.com/products/ft231xq/

FT231X/FT231XS: "Key Hardware Features" "Fully integrated 2048 byte EEPROM for storing device descriptors and CBUS I/O configuration."

https://www.silabs.com/interface/usb-bridges/classic/device.cp2102 https://www.silabs.com/interface/usb-bridges/classic/device.cp2104 https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers https://www.silabs.com/documents/public/data-sheets/cp2102n-datasheet.pdf https://www.silabs.com/documents/public/application-notes/an197.pdf https://www.silabs.com/documents/public/application-notes/an978-cp210x-usb-to-uart-api-specification.pdf https://www.silabs.com/documents/public/application-notes/AN571.pdf

"The CP2102N devices have the following features" "Internal 960-byte programmable ROM for vendor ID, product ID, serial number, power descriptor, release number, and product description strings"

"The CP2102N includes an internal electrically erasable programmable read-only memory (EEPROM). This memory may be used to customize the USB Vendor ID (VID), Product ID (PID), Product Description String, Power Descriptor, Device Release Number and Device Serial Number as desired for OEM applications. If the EEPROM is not programmed with OEM data, the default configuration data shown in the table below is used."

"Product String The Product String is an optional string that describes the product. It is limited to 126 characters."

PS: I understand that a bonus feature in of chips like FT231 and CP210x is to add the ability to allow users to auto-reset and put the device in bootloader mode via the DTR/RTS pins exposed will enable much easier firmware upgrades for the end-users as they will no longer need to press any buttons to enter bootloader mode, and then bootloader mode could be activated via software from the firmware flasher program software which could make the OTW (Over-The-Wire) firmware upgrade procedure more user-friendly.

cyijun commented 2 years ago

Thanks for your time! But there is no USB-to-UART chip in this project🤪

Hedda commented 2 years ago

Ops, wrong request, meant to request Zeroconf support, will open new