-
Notifications
You must be signed in to change notification settings - Fork 5
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
Manual or Setup instructions #6
Comments
Be warned that this new zigpy-espzb is in very early development and before this is including in ZHA by default it will be very difficult to migrate away so do not use it for anything other than testing (not for your your primary/production network), and understand that at this point it is only usable for zigpy and ZHA developers for verifying functionality as well as for other developers interested in trying it out and reporting issues to this experimental repository, so do not expect this to be stable at all. Anyway, until merged it is unlikely that there be any step-by-step instructions unless you write it yourself, however you can find some some pointers on how to install and setup/configure a other expertimental third-party radio library for zigpy and ZHA here: Specifically this post by stolevegen (Stole) here: Note! Until merged this is depending on these changes to zigpy-cli which needs to be implmeneted as well in order to use it: A tip is that developers should even be able to test this with zigpy-cli as a stand-alone tool to test sending commands to radio via zigpy-espzb but understand that it is not meant to be used that way so it will be very slow, (as zigpy-cli is not meant to be a complete API for all zigpy functions, instead zigpy-cli is at this point more just a set of common development tools only for debugging and less commonly used tasks that is available and shared for all radios for zigpy), and as for the real implementation you really need to look at the ZHA integration component inside Home Assistant core: https://github.com/home-assistant/core/tree/dev/homeassistant/components/zha FYI, for reference also check out these related general instructions on how to install and update new released of libraries in HA: https://github.com/zigpy/zigpy/blob/dev/CONTRIBUTING.md#testing-new-releases https://github.com/zigpy/zigpy/blob/dev/CONTRIBUTING.md#setup https://github.com/zigpy/zigpy-znp/blob/dev/README.md#home-assistant PS: There is byw also a discussion thread about zigpy-espzb in Home Assistant community forum but it is targeting end-users: |
Two SoC solution is way it used in Espressif reference hardware design but it is not a must as zigpy only need a serial connection. You could for example instead design a new USB-only board adapter (similar to all other Zigbee Coordinator USB dongles available on the marker) that uses some kind of USB-to-UART (USB-to-Serial) communication, which is usually done by developers with an external debugger/programmer board with USB-to-UART interface, or on a production board meant for end-users using on-board USB-to-UART bridge/converter chip -> https://docs.espressif.com/projects/esp-idf/en/stable/esp32h2/get-started/establish-serial-connection.html ...preferably a USB-to-Serial converter/bridge chip with programmable EEPROM (such as example Silicon Labs CP210x series like the popular CP2102N and CP2102, FTDI FT231 series, or WCH CH340B) that also allow you to write a unique USB product identifier as that will allow the USB dongle to be automatically discovered via USB discovery -> https://community.home-assistant.io/t/community-help-wanted-to-whitelist-all-compatible-zigbee-and-z-wave-dongles-adapters-for-automatic-usb-discovery-in-home-assistant/344412 On-board USB-to-UART Bridge as for example used if designing ESP32-H2/ESP32-C6 based Zigbee Coordinator USB dongle: External USB-to-UART Bridge as for example used temporarily under the development of non-USB development boards: Alternativly you could instead design different kinds of ESP32-H2 to PHY Ethernet boards using a UART-to-Ethernet bridge/converter chip to basically make a network-attached serial adapter for connection using serial-over-IP (i.e. some kind of chip with Ethernet component -> https://docs.espressif.com/projects/esp-idf/en/stable/esp32h2/api-reference/network/esp_eth.html?highlight=ethernet which irronically can be a other ESP32 chip or something purpose build like a W5500 chip or other ESP32 Ethernet PHY chips) -> https://pcbartists.com/design/embedded/esp32-ethernet-phy-chips-supported-by-arduino-esp-idf/ Check out for example this DIY gateway project which aims to create a Serial-over-IP proxy-> zigpy/zigpy#584 That in essence replaces the second ESP32 board with some kind of SoC that can provide Ethernet PHY and run a serial server: https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_gateway Those type of network-attached Zigbee Coordinator adapters with Ethernet interface are popular among advanced users, and similar to USB discovery they instead offer ability for automatic Zeroconf network discovery -> https://www.home-assistant.io/integrations/zeroconf/ ( at least in the ZHA integration inside Home Assistant -> https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf ). Check out for example these different Ethernet based designs:
PS: Note that with the Zigbee Coordinator you absolutly want to use wired connection end-to-end, as in either a USB-to-UART connection or a Ethernet-to-UART based solution, (and not a WiFi-to-UART solution) for a production Zigbee network. I and most others strongly advise against using a WiFi connection for any serial-over-IP communcations with the ZHA integrations and similar Zigbee gateway host applications. With any serial connection going over WiFi you are sooner or later garanteed to get connection problems that are caused by dopped packages unless the serial protocol and application used has been specifically been built robust enough to handle dropped packages, and there are specific warnings about using Wi-Fi-based Zigbee-to-Serial bridges/gateways as remote Zigbee Coordinator adapters with the ZHA integration and Zigbee2MQTT, see example: https://www.zigbee2mqtt.io/advanced/remote-adapter/connect_to_a_remote_adapter.html
|
@lhespress Does ESP32-C6-DevKit and ESP32-H2-DevKit dev boards not provide such USB-to-UART Bridge interface for that? Key Component Description:
|
See that Espressif Thread Border Router / Zigbee Gateway (ESP Thread BR-Zigbee GW) board supports both Wi-Fi and Ethernet interfaces as backbone link: https://docs.espressif.com/projects/esp-thread-br/en/latest/hardware_platforms.html So if want to make it network-attached then do make it a Ethernet based (wired) like the ESP Thread Border Router/Zigbee Gateway Sub-Ethernet (which I believe is based on the mentioned W5500 chip for Ethernet PHY): PS: If designing a brand new board then check out Olimex's ESP32 gateway series for ideas on slimline Ethernet gateway designs: https://www.olimex.com/Products/IoT/ESP32/ESP32-GATEWAY/open-source-hardware https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO/open-source-hardware https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware https://www.olimex.com/Products/IoT/ESP32/ESP32-EVB/open-source-hardware |
Thanks for your extensive response @Hedda. If i get it the correct way, then to test basic functionality i should be able to connect an FTDI usb serial adapter (or any other usb to serial adapter) and connect its ground and rx/tx (reversed) to the esp32-c6 directly and it should just respond to commands as intended immediately given i configured the rx/tx pins correctly in the example ncp firmware? The second thing i understood is that it should also "just" work via it's usb-c port of the ch343, given i configured the firmware correctly. |
Yeah that is how understand it. Just note that since UART / Serial connections are exclusive you can not have more than a single connect to the same UART/Serial interfave, meaning that I believe that you can not have zigpy/ZHA trying to connect the same time you are connecting with for example a debugger? |
@ss89 Please check it as follows steps:
|
@Hedda Both development boards are two TYPE-C USB ports, one is connected to the chip USB port, and the other is USB-UART0 bridge. |
I am in fact receiving Here's the full output:
|
@ss89 |
I tried it with rebooting (now actually with an esp32-h2) and i still get an error that it failed to deserialize the command:
Is this expected with a fresh Out-of-the-box esp32-h2 that hasn't been used in any way for zigbee purposes yet? How do i get to get a similar result as you? |
@ss89 Which commit do you used? |
@ss89 can I suggest maybe consider starting a new issue as those latest posts are starting to get off-topic from the original issue? |
I did use the latest master back then, so likely it was this commit: dcecec5
I will check it out. Might take a bit, as every time i didn't use python related things for a bit homebrew updates break my idf setup. I'll report back once i got some results, thanks! |
Now this looks a lot better now (backup request):
My assumption is that it is (expectedly) failing due to me never having setup a network, however i do get a lot more successful responses from the device now. I'll try some more in the upcoming days! |
Doing a reset request seems to fail, even though it succeeds (not sure whether this is intended due to the mentioned command sequence + "crash" to reset implementation).
Forming a network succeeds from the command line side, but the logs state that the connection to the board would be lost. Manually backing up after
Energy-scanning seems to work just fine for me 👍 Permitting MIGHT work, not sure as i only have one device (IKEA At this point i wish switching channels was implemented, so i could test out whether any other channel would make it pair. So far: thanks @lhespress and @puddly! |
Hi @lhespress
thanks for this great addition to zigpy!
i would love to see a manual/setup instructions for the hardware and example zigpy commands to test whether the setup works in the README.md.
i am trying to make it work for me with a ESP32 devkit + a ESP32-C6 via UART and the unmodified host/ncb example sketch from here:
My assumption is the following:
With this in mind, i would still need to fight the esp32 (host) reboot upon serial connect.
Did you encounter this as well or do i need to set something special in the sketch?
I did read something about dtr settings that need to be applied to the usb hosts serial app (zigpy in my case).
Hardware setup:
ESP32 Pin 4 <-> ESP-C6 Pin 17
ESP32 Pin 5 <-> ESP-C6 Pin 16
ESP32 Ping Gnd <-> ESP-C6 Pin Gnd
ESP32 USB <-> PC USB
ESP32-C6 USB (both) <-> PC USB
Commands tried ‘zigpy radio --baudrate 115200 /dev/tty.usbserial-1001 eznp info‘ (writing these out of my head, as i'm on the go)
besides some timeout error i finally yesterday also got some other info printed by zigpy before that timeout error, i'll try to post output in ~12 hours.
I believe that the esp32 reboot is the only issue remaining for trying out some zigpy commands with success.
The text was updated successfully, but these errors were encountered: