Tube's ZB Coordinators and Routers (was Zigbee router on steroids?)

okay, lets backup, the static IP ESPHome FW was for the esp32 part of the device. it looks like you flashed it to the cc2652. (amazing this even worked was allowed by the tool and the cc2652)

The cc2652 should be reflashed with the fw:

https://github.com/Koenkk/Z-Stack-firmware/releases/download/Z-Stack_3.x.0_coordinator_20240710/CC1352P7_coordinator_20240710.zip

For the ESP32 the reason it is still sending the DHCP is the fw did not change.

I recommend using the usb port and connecting to a computer with chrome (disconnect poe or it will fry the usb controller or the device) then use web.esphome.io and flash factory.bin firmware.

Sorry, I caught my error and in my haste to correct my post I didnā€™t proofread it enough just plain butchered it. The ESPHome update worked once I figured out where I went wrong and itā€™s no longer asking for a DHCP address, so we should be static.

I reflashed the CC2652 and rebooted everything and weā€™re back up and running.

Thank you for the awesome support! Now, to wait and see if it drops off againā€¦

1 Like

@tube0013 A few Years ago I purchased 2 Routers/Coordinators from you (tube_zb_gw_cc2652p2_version_2) and unfortunately never had Time to set them up. I hope I can get this done this Winter finally :smiley:. Upgrading the Firmware is most likely the first Thing I will need to do ā€¦

I was also looking forward to buy some (maybe 10) more Routers to use as Repeaters (especially the Basic Router which is very Cheap, but unfortunately they are sold out. I also read the Announcement that Production is paused for the Time being. Any idea on when that would resume ? Thanks :smiley:

Youā€™re a life saver. I blindly copied the filename from the guide, which says ā€œFirmware - use the **CC1352P2_CC2652P_launchpad_.zip** based firmware available here:ā€¦*ā€

But my device is also the P7. Itā€™s been so long since I got this running, I forgot pretty much everything I had. I didnā€™t look closely at the filename/hardware name I had.

Just finished flashing, and it came up in HA and (as of 20 seconds or so) itā€™s looking good!

Whenever my tubeszb-efr32-mgm24-2023 reboots, Zigbee2MQTT - running in HA as addon - crashes and I need to manually restart it. Is that expected with this setup? Is there a way to have it automatically restart? I do have the watchdog enabled:

image

Hi @tube0013

Can you please update the yaml for mgm24 device?
Trying to upgrade to latest ESPHome and is throwing error:

[hw_flowctrl] is an invalid option for [uart]. Did you mean [hw_flow_control]?

Seems to be on line 99 in the yaml file (tubeszb-mgm24.yaml):

hw_flowctrl: CTS_RTS  

Need to update static IP and latest ESPHome on a few devices but this error is stopping me.

this has been done. you can also use this github repo which has an issue template and action set up to build firmware for static IPs:

Thanks for fixing it so fast. Updating now. I have my static IP configured in my yaml so not really need the new site.

Generally I donā€™t advise updating with every esphome release. itā€™s not necessary unless there is a known improvement or bugfix. essentially if it is working just leave it be. To this end Iā€™ve started to remove the dashboard links in the yaml so you shouldnā€™t be prompted to adopt. anyone can still grab the yaml from github and add to esphome if desired. unfortunately it just ends up causing more questions and issues right now.

yeah just updating so I can get new IP

Will look at creating a fully local config sometime in the future

1 Like

I posted a poll yesterday, and am trying to get feed back. a lot of this is driven by trying to plan for incoming tariffs. so any feedback is welcom. thanks.

Howdy folks, @tube0013 thanks for all your work here, I have some more for you :smiley:

My issue is very frequent (~1min) disconnects of the adapter.
The zigbee network and HA integration seems to work perfectly well while prior to the disconnect and restart. Iā€™ve been able to add devices, rename them, control them via HA etc. Obviously because the z2m server frequently restarts itā€™s hard to determine if there are any other issues, but a prerequisite is a stable coordinator.

I have a ā€˜tubeszb-cc2652p7-poe-2023ā€™ running the ā€˜CC1352P7_coordinator_20240710.hexā€™ firmware.
Because Iā€™m running opnsense as my DHCP server I used the firmware builder mentioned above to deploy and flash a static IP and confirmed that Iā€™m no longer able to change the IP of my device using my static DHCP mappings so Iā€™m pretty sure I flashed it correctly (done as part of troubleshooting, not prior to bad device behaviour)!

Iā€™ve tried using PoE sourced from a switch, as well as an inline injector in multiple locations with multiple cables.
ICMP/ping requests do not drop at all when the logs show the disconnect happening.

I purchased this over a year ago and it sat on a shelf until this Christmas break where I found time to dive back in to the project. Point being Iā€™ve never confirmed if this device was functional in the past so am stuck wondering if this is a hardware fault or some other configuration/firmware bug I havenā€™t been able to determine.

Excerpt of z2m debug log disconnection:

[2025-01-25 13:34:26] error: 	zh:zstack:znp: Socket error Error: read ETIMEDOUT
[2025-01-25 13:34:26] info: 	zh:zstack:znp: Port closed
[2025-01-25 13:34:26] debug: 	zh:controller: Adapter disconnected
[2025-01-25 13:34:26] info: 	zh:zstack:znp: closing
[2025-01-25 13:34:26] error: 	z2m: Adapter disconnected, stopping
[2025-01-25 13:34:26] debug: 	z2m: Saving state to file /app/data/state.json
[2025-01-25 13:34:26] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
[2025-01-25 13:34:26] info: 	z2m: Disconnecting from MQTT server
[2025-01-25 13:34:26] info: 	z2m: Stopping zigbee-herdsman...
[2025-01-25 13:34:26] debug: 	zh:controller:database: Writing database to '/app/data/database.db'
[2025-01-25 13:34:26] info: 	z2m: Stopped zigbee-herdsman
[2025-01-25 13:34:26] info: 	z2m: Stopped Zigbee2MQTT

And the cc2652p7 logs, this repeats forever.

13:25:03	[D]	[stream_server:081]	

New client connected from 10.1.20.16

13:25:03	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state ON

13:25:30	[D]	[stream_server:163]	

Client 10.1.20.16 disconnected

13:25:30	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state OFF

13:25:33	[D]	[stream_server:081]	

New client connected from 10.1.20.16

13:25:33	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state ON

13:26:00	[D]	[stream_server:163]	

Client 10.1.20.16 disconnected

13:26:00	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state OFF

13:26:03	[D]	[stream_server:081]	

New client connected from 10.1.20.16

13:26:03	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state ON

13:26:30	[D]	[stream_server:163]	

Client 10.1.20.16 disconnected

13:26:30	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state OFF

13:26:33	[D]	[stream_server:081]	

New client connected from 10.1.20.16

13:26:33	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state ON

13:27:00	[D]	[stream_server:163]	

Client 10.1.20.16 disconnected

13:27:00	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state OFF

13:27:03	[D]	[stream_server:081]	

New client connected from 10.1.20.16

13:27:03	[D]	[binary_sensor:036]	

'TubesZB Serial Connected': Sending state ON

Thanks again for the help, and will send any other logs/configuration on request.

Did you flash the coordinator firmware successfully over the network connection?

How are you running HA? And Z2M?

Yep script reported flash was successfully verified:

PS F:\Projects\cc2538-bsl> python cc2538-bsl.py -p socket://zigbee-coord.xxx:6638 -evw .\CC1352P7_coordinator_20240710.hex
Opening port socket://zigbee-coord.xxx:6638, baud 500000
Reading data from .\CC1352P7_coordinator_20240710.hex
Your firmware looks like an Intel Hex file
Connecting to target...
CC1350 PG2.0 (7x7mm): 704KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x000AFFD8
Primary IEEE Address: 00:12:4B:00:2A:7B:53:00
    Performing mass erase
Erasing all main bank flash sectors
    Erase done
Writing 720896 bytes starting at address 0x00000000
Write 208 bytes at 0x000AFF300
    Write done
Verifying by comparing CRC32 calculations.
    Verified (match: 0xb54e9900)

Running HA, Z2M, and mosquitio as podman containers on a single host.

CONTAINER ID  IMAGE                                         COMMAND               CREATED       STATUS         PORTS                                                     NAMES
c4e180930719  docker.io/library/eclipse-mosquitto:latest    /usr/sbin/mosquit...  10 days ago   Up 2 days      0.0.0.0:1883->1883/tcp, 0.0.0.0:9001->9001/tcp, 1883/tcp  eclipse-mosquitto
ee2d70f87212  ghcr.io/home-assistant/home-assistant:stable                        38 hours ago  Up 38 hours                                                              homeassistant
3686a0cb6872  docker.io/koenkk/zigbee2mqtt:latest           /sbin/tini -- nod...  3 hours ago   Up 26 seconds  0.0.0.0:8080->8080/tcp                                    zigbee2mqtt

Okay, thatā€™s a sign the device is working since if you couldnā€™t flash it z2m wouldnā€™t work either.

What is your z2m config? If using 2.0.x do you have the adapter: line under your he port?

Using latest (2.0.0) z2m as starting from scratch.

z2m config:

mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://mqtt.xxx:1883
serial:
  port: tcp://10.1.20.22:6638
  adapter: zstack
advanced:
  # log_level: debug
  channel: 11
  network_key:
   - xxx
  pan_id: xxx
  ext_pan_id:
    - xxx
frontend:
  enabled: true
homeassistant:
  enabled: true
  legacy_action_sensor: true
devices:
  '0x00158d0009df81be':
    friendly_name: test_xiomi_motion01
  '0xa4c13835b597d8bb':
    friendly_name: test_tuya_temp01
  '0x00158d008b35e1c9':
    friendly_name: test_aqara_btn01
  '0xa4c138ab07f7404a':
    friendly_name: test_tuya_soil01
  '0x00158d008b648aff':
    friendly_name: test_aqara_temp02
  '0xa4c138d5d5220e35':
    friendly_name: test_tuya_plug01
version: 4

full cycle of z2m logs with debug off as very verbose when device are connected:

[2025-01-25 20:05:10] info: 	z2m: Logging to console, file (filename: log.log)
[2025-01-25 20:05:10] info: 	z2m: Starting Zigbee2MQTT version 2.0.0 (commit #060ae99cff715cc9ef6a0cfa7cae0cdcb17f0c8a)
[2025-01-25 20:05:10] info: 	z2m: Starting zigbee-herdsman (3.2.1)
[2025-01-25 20:05:10] info: 	zh:zstack:znp: Opening TCP socket with 10.1.20.22:6638
[2025-01-25 20:05:10] info: 	zh:zstack:znp: Socket connected
[2025-01-25 20:05:10] info: 	zh:zstack:znp: Socket ready
[2025-01-25 20:05:10] info: 	zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2025-01-25 20:05:11] info: 	zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2025-01-25 20:05:12] info: 	z2m: zigbee-herdsman started (resumed)
[2025-01-25 20:05:12] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20240710,"transportrev":2},"type":"zStack3x0"}'
[2025-01-25 20:05:12] info: 	z2m: test_xiomi_motion01 (0x00158d0009df81be): RTCGQ01LM - Xiaomi Mi motion sensor (EndDevice)
[2025-01-25 20:05:12] info: 	z2m: test_tuya_temp01 (0xa4c13835b597d8bb): ZG-227Z - Tuya Temperature and humidity sensor (EndDevice)
[2025-01-25 20:05:12] info: 	z2m: test_aqara_btn01 (0x00158d008b35e1c9): WXKG11LM - Aqara Wireless mini switch (EndDevice)
[2025-01-25 20:05:12] info: 	z2m: test_tuya_soil01 (0xa4c138ab07f7404a): TS0601_soil_3 - Tuya Soil sensor (EndDevice)
[2025-01-25 20:05:12] info: 	z2m: test_aqara_temp02 (0x00158d008b648aff): WSDCGQ11LM - Aqara Temperature and humidity sensor (EndDevice)
[2025-01-25 20:05:12] info: 	z2m: test_tuya_plug01 (0xa4c138d5d5220e35): TS011F_plug_3 - Tuya Smart plug (with power monitoring by polling) (Router)
[2025-01-25 20:05:12] info: 	z2m: Currently 6 devices are joined.
[2025-01-25 20:05:12] info: 	z2m: Connecting to MQTT server at mqtt://mqtt.xxx:1883
[2025-01-25 20:05:12] info: 	z2m: Connected to MQTT server
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2025-01-25 20:05:12] info: 	z2m: Started frontend on port 8080
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_xiomi_motion01', payload '{"battery":100,"linkquality":32,"occupancy":true,"power_outage_count":4,"voltage":3025}'
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_tuya_temp01', payload '{"battery":50,"humidity":62,"humidity_calibration":0,"linkquality":10,"temperature":26.1,"temperature_calibration":null,"temperature_unit":null}'
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_aqara_btn01', payload '{"action":null,"battery":100,"device_temperature":32,"linkquality":47,"power_outage_count":8,"voltage":3245}'
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_tuya_soil01', payload '{"battery":39,"battery_state":"medium","linkquality":51,"soil_moisture":25,"temperature":23.2,"temperature_unit":"celsius"}'
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_aqara_temp02', payload '{"battery":100,"humidity":61.01,"linkquality":36,"power_outage_count":5,"pressure":1008.2,"temperature":25.83,"voltage":3085}'
[2025-01-25 20:05:12] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/test_tuya_plug01', payload '{"child_lock":"UNLOCK","current":0,"energy":0,"indicator_mode":"off/on","linkquality":3,"power":0,"power_outage_memory":"off","state":"ON","update":{"installed_version":-1,"latest_version":-1,"state":null},"voltage":230}'
[2025-01-25 20:05:12] info: 	z2m: Zigbee2MQTT started!
[2025-01-25 20:05:17] info: 	z2m:mqtt: MQTT publish: topic 'homeassistant/binary_sensor/1221051039810110150109113116116_0x00124b002a7b5300/connection_state/config', payload '{"device":{"hw_version":"zStack3x0 20240710","identifiers":["zigbee2mqtt_bridge_0x00124b002a7b5300"],"manufacturer":"Zigbee2MQTT","model":"Bridge","name":"Zigbee2MQTT Bridge","sw_version":"2.0.0"},"device_class":"connectivity","entity_category":"diagnostic","name":"Connection state","object_id":"zigbee2mqtt_bridge_connection_state","origin":{"name":"Zigbee2MQTT","sw":"2.0.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"offline","payload_on":"online","state_topic":"zigbee2mqtt/bridge/state","unique_id":"bridge_0x00124b002a7b5300_connection_state_zigbee2mqtt","value_template":"{{ value_json.state }}"}'
[2025-01-25 20:05:37] error: 	zh:zstack:znp: Socket error Error: read ETIMEDOUT
[2025-01-25 20:05:37] info: 	zh:zstack:znp: Port closed
[2025-01-25 20:05:37] info: 	zh:zstack:znp: closing
[2025-01-25 20:05:37] error: 	z2m: Adapter disconnected, stopping
[2025-01-25 20:05:37] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"offline"}'
[2025-01-25 20:05:37] info: 	z2m: Disconnecting from MQTT server
[2025-01-25 20:05:37] info: 	z2m: Stopping zigbee-herdsman...
[2025-01-25 20:05:37] info: 	z2m: Stopped zigbee-herdsman
[2025-01-25 20:05:37] info: 	z2m: Stopped Zigbee2MQTT

okay this is really strange.

can you try running a energy scan with the zigpy-cli: https://github.com/zigpy/zigpy-cli

this is how I test/QC devices before sending and will let us know for sure if radio is working.

you address the device as socket:// just like with the flasher.

$ zigpy radio znp ocket://zigbee-coord.xxx:6638 energy-scan

Almost thought we had it. I had a misunderstanding about zigbee channels so had set my wifi to channel 1 and zigbee to channel 11, not knowing those actually overlap.

Changed my z2m config to channel 25 and reran the energy scan with results below.
Adapter behaviour is unchanged, still disconnecting every ~1min or so.

PS F:\Projects\zigbee-coord> zigpy radio znp socket://zigbee-coord.xxx:6638 energy-scan
Channel energy (mean of 1 / 5):
------------------------------------------------
 ! Different radios compute channel energy differently

 + Lower energy is better
 + Active Zigbee networks on a channel may still cause congestion
 + TX on 26 in North America may be with lower power due to regulations
 + Zigbee channels 15, 20, 25 fall between WiFi channels 1, 6, 11
 + Some Zigbee devices only join networks on channels 15, 20, and 25
 + Current channel is enclosed in [square brackets]
------------------------------------------------
 -  11      31.37%  ###############################
 -  12      48.24%  ################################################
 -  13       0.00%
 -  14      22.75%  ######################
 -  15       0.00%
 -  16       0.00%
 -  17       0.00%
 -  18       0.00%
 -  19       0.00%
 -  20       0.00%
 -  21       0.00%
 -  22       0.00%
 -  23       0.00%
 -  24       0.00%
 - [25 ]     0.00%
 -  26*      0.00%

Channel energy (mean of 2 / 5):
------------------------------------------------
 ! Different radios compute channel energy differently

 + Lower energy is better
 + Active Zigbee networks on a channel may still cause congestion
 + TX on 26 in North America may be with lower power due to regulations
 + Zigbee channels 15, 20, 25 fall between WiFi channels 1, 6, 11
 + Some Zigbee devices only join networks on channels 15, 20, and 25
 + Current channel is enclosed in [square brackets]
------------------------------------------------
 -  11      31.37%  ###############################
 -  12      48.24%  ################################################
 -  13      19.22%  ###################
 -  14      11.37%  ###########
 -  15       0.00%
 -  16       0.00%
 -  17       0.00%
 -  18       0.00%
 -  19       0.00%
 -  20       0.00%
 -  21       0.00%
 -  22       0.00%
 -  23       0.00%
 -  24       0.00%
 - [25 ]     0.00%
 -  26*      0.00%

Channel energy (mean of 3 / 5):
------------------------------------------------
 ! Different radios compute channel energy differently

 + Lower energy is better
 + Active Zigbee networks on a channel may still cause congestion
 + TX on 26 in North America may be with lower power due to regulations
 + Zigbee channels 15, 20, 25 fall between WiFi channels 1, 6, 11
 + Some Zigbee devices only join networks on channels 15, 20, and 25
 + Current channel is enclosed in [square brackets]
------------------------------------------------
 -  11      31.37%  ###############################
 -  12      49.28%  #################################################
 -  13      25.62%  #########################
 -  14      15.56%  ###############
 -  15       0.00%
 -  16       0.00%
 -  17       0.00%
 -  18       0.00%
 -  19       0.00%
 -  20       0.00%
 -  21       0.00%
 -  22       0.00%
 -  23       0.00%
 -  24       0.00%
 - [25 ]     0.00%
 -  26*      0.00%

Channel energy (mean of 4 / 5):
------------------------------------------------
 ! Different radios compute channel energy differently

 + Lower energy is better
 + Active Zigbee networks on a channel may still cause congestion
 + TX on 26 in North America may be with lower power due to regulations
 + Zigbee channels 15, 20, 25 fall between WiFi channels 1, 6, 11
 + Some Zigbee devices only join networks on channels 15, 20, and 25
 + Current channel is enclosed in [square brackets]
------------------------------------------------
 -  11      23.53%  #######################
 -  12      50.49%  ##################################################
 -  13      28.82%  ############################
 -  14      17.35%  #################
 -  15       0.00%
 -  16       0.00%
 -  17       0.00%
 -  18       0.00%
 -  19       0.00%
 -  20       0.00%
 -  21       0.00%
 -  22       0.00%
 -  23       0.00%
 -  24       0.00%
 - [25 ]     0.00%
 -  26*      0.00%

Channel energy (mean of 5 / 5):
------------------------------------------------
 ! Different radios compute channel energy differently

 + Lower energy is better
 + Active Zigbee networks on a channel may still cause congestion
 + TX on 26 in North America may be with lower power due to regulations
 + Zigbee channels 15, 20, 25 fall between WiFi channels 1, 6, 11
 + Some Zigbee devices only join networks on channels 15, 20, and 25
 + Current channel is enclosed in [square brackets]
------------------------------------------------
 -  11      25.10%  #########################
 -  12      50.04%  ##################################################
 -  13      30.75%  ##############################
 -  14      18.43%  ##################
 -  15       0.00%
 -  16       0.00%
 -  17       0.00%
 -  18       0.00%
 -  19       0.00%
 -  20       0.00%
 -  21       0.00%
 -  22       0.00%
 -  23       0.00%
 -  24       0.00%
 - [25 ]     0.00%
 -  26*      0.00%

Small update, bought a SLZB-06M to test with and another PoE router is always handy.
Seeing the exact same ETIMEDOUT error behaviour when using core 2.7.1 and anything on the ember adapter (sdk 7.4.1 and higher).
Using ezsp and 20231030 for the zigbee firmware things have been stable for a couple hours and remained so after adding devices.

I donā€™t want to stay using ezsp as thatā€™s deprecated, but after this test I think itā€™s safe to say itā€™s probably not the tubeszb-cc2652p7 at fault.
Iā€™ll keep digging when I have spare time, if I find anything useful Iā€™ll post another update.