tube0013 / tube_gateways

Information and Documentation on Tube's Zigbee Gateways
270 stars 51 forks source link

Not able to connect tubeszb-cc2652-poe-2022 to iobroker #152

Closed Nogger82 closed 1 year ago

Nogger82 commented 1 year ago

Hello,

i wanted to connect my Coordinator with iobroker on Proxmox LXC. That was impossible. But i´ve got a running Iobroker System for my Smarthome, so i tried to connect the Coordinator on that Raspi-System. Still no Connection possible, bit the Webinterface put some informations on Debug, as followed.

[D][serial_server:103]: New client connected from 10.10.10.2 [D][binary_sensor:036]: 'Serial Connected': Sending state ON [D][serial_server:068]: Client 10.10.10.2 disconnected [D][binary_sensor:036]: 'Serial Connected': Sending state OFF [D][serial_server:103]: New client connected from 10.10.10.2 [D][binary_sensor:036]: 'Serial Connected': Sending state ON [D][serial_server:042]: Not accepting new connection from 10.10.10.2, only one client allowed

What can i do or what am i do wrong? Is there a possibility to reset the coordinator or what should i do?

tube0013 commented 1 year ago

Are there any logs fro iobroker, unfortunately i am not familiar with it to give you any direction.

the log above shows that 2 client processes are trying to talk to the coordinator at once and only one connection is allowed

Nogger82 commented 1 year ago

This is the Log from IoBroker:

zigbee.1 | 2023-08-02 15:36:19.540 | error | Error herdsman start -- | -- | -- | -- zigbee.1 | 2023-08-02 15:36:19.539 | error | Failed to start Zigbee zigbee.1 | 2023-08-02 15:36:19.538 | error | Starting zigbee-herdsman problem : "startup failed - configuration-adapter mismatch - see logs above for more information" zigbee.1 | 2023-08-02 15:36:19.341 | error | Re-commissioning your network will require re-pairing of all devices! zigbee.1 | 2023-08-02 15:36:19.340 | error | If you wish to re-commission your network, please remove coordinator backup at /opt/iobroker/iobroker-data/zigbee_1/nvbackup.json. zigbee.1 | 2023-08-02 15:36:19.339 | error | Please update configuration to prevent further issues. zigbee.1 | 2023-08-02 15:36:19.338 | error | - Channel List: configured=11, adapter=11 zigbee.1 | 2023-08-02 15:36:19.336 | error | - Network Key: configured=01030507090b0d0f00020406080a0abc, adapter=01030507090b0d0f00020406080a0abc zigbee.1 | 2023-08-02 15:36:19.336 | error | - Extended PAN ID: configured=bcdadddddddddddd, adapter=00124b00259060c7 zigbee.1 | 2023-08-02 15:36:19.335 | error | - PAN ID: configured=6756, adapter=6756 zigbee.1 | 2023-08-02 15:36:19.334 | error | Configuration is not consistent with adapter state/backup! zigbee.1 | 2023-08-02 15:36:17.947 | info | Installed Version: iobroker.zigbee@1.8.16 zigbee.1 | 2023-08-02 15:36:17.211 | info | Starting Zigbee npm ... zigbee.1 | 2023-08-02 15:36:17.005 | info | starting. Version 1.8.16 in /opt/iobroker/node_modules/iobroker.zigbee, node: v16.17.0, js-controller: 4.0.24 zigbee.1 | 2023-08-02 15:35:52.988 | info | Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason zigbee.1 | 2023-08-02 15:35:52.987 | info | terminating zigbee.1 | 2023-08-02 15:35:52.986 | warn | Failed to stop zigbee during startup zigbee.1 | 2023-08-02 15:35:52.969 | info | Zigbee: disabling joining new devices. zigbee.1 | 2023-08-02 15:35:52.962 | info | cleaned everything up... zigbee.1 | 2023-08-02 15:35:52.959 | info | Got terminate signal TERMINATE_YOURSELF
Nogger82 commented 1 year ago

Are there any logs fro iobroker, unfortunately i am not familiar with it to give you any direction.

the log above shows that 2 client processes are trying to talk to the coordinator at once and only one connection is allowed

I´ve uploaded the Iobroker Log above...

There is no other Process, that trys to log on the system.

tube0013 commented 1 year ago

the log above, tells you the error. if you want to reset the coordinator, give zigpy-cli a try:

https://github.com/zigpy/zigpy-cli

the command to reset: zigpy radio znp socket://IP_ADDRESS:6638 reset

be sure no other clients are attempting to talk to the coordinator.

another option is the delete the backup which has the conflicting information.

Nogger82 commented 1 year ago

the log above, tells you the error. if you want to reset the coordinator, give zigpy-cli a try:

https://github.com/zigpy/zigpy-cli

the command to reset: zigpy radio znp socket://IP_ADDRESS:6638 reset

be sure no other clients are attempting to talk to the coordinator.

another option is the delete the backup which has the conflicting information.

Okay, please teach me. Where do i have install it? On the Raspi where iobroker ist installed?

tube0013 commented 1 year ago

if you can get a linux command line on the pi

you should be able to run pip install zigpy-cli or pip3 install zigpy-cli then you should be able to run the command.

Nogger82 commented 1 year ago

that´s what comes around:

pi@raspberrypi:~ $ pip install zigpy-cli Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting zigpy-cli Could not find a version that satisfies the requirement zigpy-cli (from versio ns: ) No matching distribution found for zigpy-cli pi@raspberrypi:~ $ ^C pi@raspberrypi:~ $ pip3 install zigpy-cli Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting zigpy-cli Could not find a version that satisfies the requirement zigpy-cli (from versio ns: ) No matching distribution found for zigpy-cli pi@raspberrypi:~ $

tube0013 commented 1 year ago

python --version

?

Nogger82 commented 1 year ago

Python 2.7.16

tube0013 commented 1 year ago

what about python3 --version

Nogger82 commented 1 year ago

Python 3.7.3

tube0013 commented 1 year ago

do you have any other systems you can use on same network?

I recommend the directions here: https://github.com/zigpy/zigpy-znp/blob/dev/TOOLS.md#in-other-environments

up until the pip install command, and using the one above instead.

Nogger82 commented 1 year ago

i can try on my Proxmox Shell, which shoulb be my new Central for Iobroker & Co. Can take a while.

tube0013 commented 1 year ago

should work from your desktop/laptop whether windows or mac (I use both mac and ubuntu linux following the above guide)

Nogger82 commented 1 year ago

okay i did it, but there was no response on the console, just a short break an done. How can i check, that was succesful?

tube0013 commented 1 year ago

run the same command but use info instead of reset

(it may just throw an error if no network is setup on the coordinator)

Nogger82 commented 1 year ago

Result:

Traceback (most recent call last): File "/root/venv/bin/zigpy", line 8, in sys.exit(cli()) ^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/click/decorators.py", line 45, in new_func return f(get_current_context().obj, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/zigpy_cli/cli.py", line 20, in inner return loop.run_until_complete(cmd(args, kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/root/venv/lib/python3.11/site-packages/zigpy_cli/radio.py", line 86, in info await app.load_network_info(load_devices=False) File "/root/venv/lib/python3.11/site-packages/zigpy_znp/zigbee/application.py", line 168, in load_network_info await self._znp.load_network_info(load_devices=load_devices) File "/root/venv/lib/python3.11/site-packages/zigpy_znp/api.py", line 228, in load_network_info await self._load_network_info(load_devices=load_devices) File "/root/venv/lib/python3.11/site-packages/zigpy_znp/api.py", line 117, in _load_network_info raise NetworkNotFormed() zigpy.exceptions.NetworkNotFormed

tube0013 commented 1 year ago

confirmed, the coordinator is reset:

zigpy.exceptions.NetworkNotFormed

Nogger82 commented 1 year ago

Okay, First i´ll try on the Raspi, if ther is still a second process...Thank you very much for now....Stay Tune ;-)

tube0013 commented 1 year ago

z2m (which looks to be what iobroker is using in the background for zigbee) will write the network to the coordinator at launch. be sure the config matches the back up or you'll need to do this all over again

tube0013 commented 1 year ago

from the original log, it looks like the Extended PAN ID. did not match.

Nogger82 commented 1 year ago

Still not working:

Iobroker Log:

zigbee.1 | 2023-08-02 17:22:46.748 | info | Installed Version: iobroker.zigbee@1.8.16 -- | -- | -- | -- zigbee.1 | 2023-08-02 17:22:46.682 | info | Starting Zigbee npm ... zigbee.1 | 2023-08-02 17:22:46.681 | info | Try to reconnect. zigbee.1 | 2023-08-02 17:22:36.675 | error | Error herdsman start zigbee.1 | 2023-08-02 17:22:36.674 | error | Failed to start Zigbee zigbee.1 | 2023-08-02 17:22:36.672 | error | Starting zigbee-herdsman problem : "network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby" zigbee.1 | 2023-08-02 17:21:29.583 | info | Installed Version: iobroker.zigbee@1.8.16 zigbee.1 | 2023-08-02 17:21:28.746 | info | Starting Zigbee npm ... zigbee.1 | 2023-08-02 17:21:28.564 | info | starting. Version 1.8.16 in /opt/iobroker/node_modules/iobroker.zigbee, node: v16.17.0, js-controller: 4.0.24

Zigbee Coordinator Log: [D][serial_server:103]: New client connected from 10.10.10.2 [D][binary_sensor:036]: 'Serial Connected': Sending state ON [D][serial_server:042]: Not accepting new connection from 10.10.10.2, only one client allowed [D][serial_server:042]: Not accepting new connection from 10.10.10.2, only one client allowed

I´ve resetet a few times, and I changed the extpanID.... I don´t know what´s the Problem

Nogger82 commented 1 year ago

another message...

zigbee.1 | 2023-08-02 17:25:30.889 | error | Error herdsman start -- | -- | -- | -- zigbee.1 | 2023-08-02 17:25:30.888 | error | Failed to start Zigbee zigbee.1 | 2023-08-02 17:25:30.887 | error | Starting zigbee-herdsman problem : "Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)"
tube0013 commented 1 year ago

try starting without the antenna, or unplugging any near by routing devices.

tube0013 commented 1 year ago

if this continues:

"Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)" see: https://github.com/tube0013/tube_gateways/blob/main/Troubleshooting.md#zigbee2mqtt-startup---error-srsp---sys---ping-after-6000ms

Nogger82 commented 1 year ago

okay, so i need equipment for flashing? USB is not possible right?

tube0013 commented 1 year ago

Not for PoE version see the esp32 flashing guide under your model:

https://github.com/tube0013/tube_gateways/blob/main/models/current/tubeszb-cc2652-poe-2022/readme.md

Nogger82 commented 1 year ago

Not for PoE version see the esp32 flashing guide under your model:

https://github.com/tube0013/tube_gateways/blob/main/models/current/tubeszb-cc2652-poe-2022/readme.md

okay, i´m out for today. at least at point 3 i´m stocking. How do i get this cc2538-bsl flasher and so on...Should i flash over USB or Ethernet? Sorry for beeing stupid, but i´ve never had to flash such equipment, but i´m about to lern. Tomorrow i want to carry on. I´ve you have some more Tipps, i would be very Thankful :-)

tube0013 commented 1 year ago

no need to reflash the zigbee module. look only to flash the esp32 over the internal usb port with esphomeflasher, (no poe connected)

if that doesn't work then will move to zigbee module reflash... I know this is frustrating somehow the configurations in your back up vs config changed, and one version was likely written to the coordinator which caused the mismatch.

Nogger82 commented 1 year ago

Okay, little Success, on my Raspberry Iobroker it worked. It was a little procedure with den Zigbee Adapter, but it was connected and it was possible to pair one Sensor (aqara). On my new System (Proxmox, LXC Container) it dosn´t work. Same IP like on the Raspi.

Log from Iobroker:

zigbee.0 | 2023-08-03 00:33:07.232 | warn | Terminated (UNCAUGHT_EXCEPTION): Without reason -- | -- | -- | -- zigbee.0 | 2023-08-03 00:33:07.231 | info | terminating zigbee.0 | 2023-08-03 00:33:06.731 | info | Zigbee: disabling joining new devices. zigbee.0 | 2023-08-03 00:33:06.731 | info | cleaned everything up... zigbee.0 | 2023-08-03 00:33:06.726 | error | Cannot read properties of undefined (reading 'Error') zigbee.0 | 2023-08-03 00:33:06.726 | error | TypeError: Cannot read properties of undefined (reading 'Error') at /opt/iobroker/node_modules/iobroker.zigbee/main.js:122:56 at Hub.configureScope (/opt/iobroker/node_modules/@sentry/src/hub.ts:340:1) at Object.configureScope (/opt/iobroker/node_modules/@sentry/src/exports.ts:76:1) at Zigbee.sendError (/opt/iobroker/node_modules/iobroker.zigbee/main.js:118:32) at Zigbee.onZigbeeAdapterReady (/opt/iobroker/node_modules/iobroker.zigbee/main.js:415:30) zigbee.0 | 2023-08-03 00:33:06.719 | error | unhandled promise rejection: Cannot read properties of undefined (reading 'Error') zigbee.0 | 2023-08-03 00:33:06.719 | error | Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). zigbee.0 | 2023-08-03 00:33:06.718 | error | Unable to apply ExtPanID changes: Error: SRSP - SYS - osalNvRead after 0,2ms zigbee.0 | 2023-08-03 00:33:06.716 | info | Zigbee started zigbee.0 | 2023-08-03 00:33:06.716 | info | Currently no devices. zigbee.0 | 2023-08-03 00:33:06.647 | info | --> transmitPower : normal zigbee.0 | 2023-08-03 00:33:06.643 | info | Unable to disable LED, unsupported function. zigbee.0 | 2023-08-03 00:33:06.583 | info | Coordinator firmware version: {"type":"zStack3x0","meta":{"transportrev":2,"product":1,"majorrel":2,"minorrel":7,"maintrel":1,"revision":20230507}} zigbee.0 | 2023-08-03 00:31:53.919 | info | Installed Version: iobroker.zigbee@1.8.16 zigbee.0 | 2023-08-03 00:31:53.828 | info | Starting Zigbee npm ... zigbee.0 | 2023-08-03 00:31:53.814 | info | starting. Version 1.8.16 in /opt/iobroker/node_modules/iobroker.zigbee, node: v18.17.0, js-controller: 4.0.24 zigbee.0 | 2023-08-03 00:31:53.828 | info | Starting Zigbee npm ... zigbee.0 | 2023-08-03 00:31:53.814 | info | starting. Version 1.8.16 in /opt/iobroker/node_modules/iobroker.zigbee, node: v18.17.0, js-controller: 4.0.24

Log from Coordinator:

00:31:51 | [D] | [streamserver:074] | New client connected from 10.10.10.2 -- | -- | -- | -- 00:36:34 | [D] | [streamserver:074] | New client connected from 10.10.10.2

I started one more time, that´s why two entries exist.

tube0013 commented 1 year ago

Is the zigbee config file the same on both the raspberry pi and the vm?

I'd remove any backs ups as well. I think something is off with the 2 configs creating an issue when you move It from the pi to the vm.

I'd advice resetting the coordinator again, and trying to set up fresh only from the vm, possibly wiping the prior zigbee configuration there as well.

Nogger82 commented 1 year ago

That´s what i´ve done:

Raspi:

  1. Deleted the second intance from Iobroker, cause was only for Test
  2. Deleted second Zigbee Folder from Raspi
  3. Reset the Coordinator (like you told me above). This Step was testet by me occasionally on Raspi, just to check that it works.

LXC:

  1. Zigbee Adapter installed and configured, the same way as on Raspi.
Nogger82 commented 1 year ago

FYI...The Systems are not running at the same Time.

Nogger82 commented 1 year ago

Is the zigbee config file the same on both the raspberry pi and the vm? - No, they are seperate configured

I'd remove any backs ups as well. I think something is off with the 2 configs creating an issue when you move It from the pi to the vm. - I´ve deletet the folders a few times

I'd advice resetting the coordinator again, and trying to set up fresh only from the vm, possibly wiping the prior zigbee configuration there as well. - That´s waht i´ve done

Commented

tube0013 commented 1 year ago

the log above looks like z2m is starting.

I see one error that I've never seen before:

Unable to apply ExtPanID changes: Error: SRSP - SYS - osalNvRead after 0,2ms

but it doesn't seem to be fatal.

Nogger82 commented 1 year ago

It´s done! The ESP was flashed succesfully and then i tried many tings. Finaly the Solution was deactivating Sentry for the ZigbeeAdapter from IoBroker. After this, i´ve got the Log information for extPanID, what is active and what´s expected. The ID for expected was totaly Different, i´ve changed it in the ZigbeeAdapter and the Coordinator was online! Same on the Proxmox LXC System!

Thank you very much for your Help an Patience!

tube0013 commented 1 year ago

Excellent!