Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.88k stars 1.66k forks source link

question about ti cc1352p-2 #2162

Closed flower87lucky closed 4 years ago

flower87lucky commented 4 years ago

) zigbee2mqtt:info 2019-10-19T12:50:02: Starting zigbee-herdsman... zigbee2mqtt:error 2019-10-19T12:50:09: Error while starting zigbee-herdsman zigbee2mqtt:error 2019-10-19T12:50:09: Failed to start zigbee zigbee2mqtt:error 2019-10-19T12:50:09: Exiting... zigbee2mqtt:error 2019-10-19T12:50:09: Error: SRSP - SYS - version after 6000ms at Timeout.object.timer.setTimeout [as _onTimeout] (/app/node_modules/zigbee-herdsman/dist/utils/waitress.js:44:24) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zigbee2mqtt@1.6.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zigbee2mqtt@1.6.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-10-19T12_50_09_649Z-debug.log 2019-10-19T20:50:09: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT] 2019-10-19T20:50:09: PM2 log: App [npm:0] starting in -fork mode- 2019-10-19T20:50:09: PM2 log: App

CodeFinder2 commented 4 years ago

@jrhansen IMHO, the data directory is sufficient. But going forward and backward between z stack versions (1.2 vs 3) can be tricky / may require re-pairing (regardless of a backup).

My CC1352P-2 is now running as my daily driver for a few days now with Z2M 1.9.0 from HassIO and everything's working fine so far. No issues and (re-) pairing of all my devices was SO smooth (I did not even try w/o re-pairing as I wanted a fresh install), it even made kinda fun. πŸ˜‚

TheStigh commented 4 years ago

@jrhansen IMHO, the data directory is sufficient. But going forward and backward between z stack versions (1.2 vs 3) can be tricky / may require re-pairing (regardless of a backup).

My CC1352P-2 is now running as my daily driver for a few days now with Z2M 1.9.0 from HassIO and everything's working fine so far. No issues and (re-) pairing of all my devices was SO smooth (I did not even try w/o re-pairing as I wanted a fresh install), it even made kinda fun. πŸ˜‚

@CodeFinder2 I've just started playing with z2m and installed a standalone docker installation on a RPi4 with the CC2531. Currently I'm waiting for my CC1352P-2, and when it arrives I would like to move my z2m to my HA hardware running on a NUC i7.

My question to you would be; should I run the z2m HA addon or would I benefit from running z2m as a docker install on the same hardware?

CodeFinder2 commented 4 years ago

[...] My question to you would be; should I run the z2m HA addon or would I benefit from running z2m as a docker install on the same hardware?

The advantage of the hassio addon is it's simplicity in installing / managing it (single web instance: HA). Behind the scenes, it's a docker container as well (you might want to take a look at the "Portrainer" addon).

I am using the hassio addon and I'm quite happy with it. Also having features like 'secrets' and accessing the log in HA should be taken into consideration.

The disadvantage is mainly that you are depending on the release cycle of the addon (although this is normally the same as for Z2M). Also switching between stable/dev might be a bit more complicated sometimes.

So, as usual: it depends. πŸ™ˆ I would suggest that you start using the hassio addon first. By the way, you can also use somewhat both: install both, do all the pairing and configuration you require in the addon. Then you should be fine in copying the config over to the docker instance. Of cause you shouldn't run both simultaneously. (Going the other way round is also possible but requires YAML > JSON converting and a bit care.) But this way, switching between both should be just a 'stop one, start the other' (possibly updating / copying config first).

Hope this helps!

james-fry commented 4 years ago

The disadvantage is mainly that you are depending on the release cycle of the addon (although this is normally the same as for Z2M).

There is an edge version of the addon that installs the latest dev z2m. Downside is that to upgrade you need to delete the addon and reinstall. (Needing to copy/paste the config ofc)

CodeFinder2 commented 4 years ago

The disadvantage is mainly that you are depending on the release cycle of the addon (although this is normally the same as for Z2M).

There is an edge version of the addon that installs the latest dev z2m. Downside is that to upgrade you need to delete the addon and reinstall. (Needing to copy/paste the config ofc)

Yes, but (although this is solved now): https://github.com/danielwelch/hassio-zigbee2mqtt/issues/284

I wrote that because one should consider that there's the "addon in between", adding an additional/potential source of errors.

TheStigh commented 4 years ago

@CodeFinder2 @james-fry

Thanks to both of you for the answers! I already use Portainer on my RPi4 running the test-installation of z2m together with z2m-assistant.

May I ask another question; My house do have several floors and there is no way my Coordinator (or any powered zigbee devices) will reach one particular floor as it is concrete in all walls. The only thing I have there that reaches the rest of the house are cabled Cat6 network. My plan was to set my RPi4 on this floor with a CC2531, but the question is then, what firmware should I use on this so it communicates correct with HA/z2m (with CC1352P-2) on the main floor? Or am I totally off understanding how z2m works?

PS; my CC1352P-2 arrives next week - is there any difference in setting it up on z2m addon vs z2m standalone? Anything I should be aware of (hoping I don't get a deprecated revision, but it is coming directly from TI).

TheStigh commented 4 years ago

[...] So a nice little bit of improvement there, I should get an SMA antenna to increase that even more, anyone can recommend me one? [...]

I bought this one (because it was also labeled "Zigbee") and it works good, see my post above: https://www.digikey.de/product-detail/de/linx-technologies-inc/ANT-2.4-CW-HW-SMA/ANT-2.4-CW-HW-SMA-ND/2391322 (8€)

Don't know if any similar (Cheap Chinese πŸ˜‚) SMA 2.4 GHz antenna would do the same job. 😁

If you already have paired devices to the CC1352P-2 and then do the mod/add the external antenna, do you have to re-pair afterwards? Or is that part 'plug-and-play' after re-soldering the capacitor?

CodeFinder2 commented 4 years ago

@CodeFinder2 @james-fry

Thanks to both of you for the answers! I already use Portainer on my RPi4 running the test-installation of z2m together with z2m-assistant.

May I ask another question; My house do have several floors and there is no way my Coordinator (or any powered zigbee devices) will reach one particular floor as it is concrete in all walls. The only thing I have there that reaches the rest of the house are cabled Cat6 network. My plan was to set my RPi4 on this floor with a CC2531, but the question is then, what firmware should I use on this so it communicates correct with HA/z2m (with CC1352P-2) on the main floor? Or am I totally off understanding how z2m works?

If you are sure that it's impossible to get any Zigbee signal to that floor, you can surely use your RPi (connected via Ethernet) and create a separate Zigbee network (in addition to the one created by your CC1352P-2 coordinator). On the RPi would then run Z2M as well, publishing messages to the same MQTT broker (via Ethernet). The CC2531 would then be a coordinator as well (but spawning a DIFFERENT network). Although I have never used this kind of setup myself but you are welcome to report your experiences here! :-)

PS; my CC1352P-2 arrives next week - is there any difference in setting it up on z2m addon vs z2m standalone? Anything I should be aware of (hoping I don't get a deprecated revision, but it is coming directly from TI).

Not really. Except that the addon requires JSON and Z2M requires YAML configuration. Also "port: null" does not work in the Hassio addon. According to my knowledge, TI only sends the recent revisions so no need to worry.

CodeFinder2 commented 4 years ago

[...] So a nice little bit of improvement there, I should get an SMA antenna to increase that even more, anyone can recommend me one? [...]

I bought this one (because it was also labeled "Zigbee") and it works good, see my post above: https://www.digikey.de/product-detail/de/linx-technologies-inc/ANT-2.4-CW-HW-SMA/ANT-2.4-CW-HW-SMA-ND/2391322 (8€) Don't know if any similar (Cheap Chinese πŸ˜‚) SMA 2.4 GHz antenna would do the same job. 😁

If you already have paired devices to the CC1352P-2 and then do the mod/add the external antenna, do you have to re-pair afterwards? Or is that part 'plug-and-play' after re-soldering the capacitor?

I have started the pairing (re-pairing because I used a CC2531 previously) after I did the mod but if you do the pairing before the mod, no re-pairing should be required. You may want to keep in mind that IF you damage the board during the re-soldering (which is VERY unlikely), you have to go back to the CC2531 (= repairing). However, it's virtually impossible to destroy the board although it can happen that you destroy the capacitor because its very tiny and it depends on your soldering skills. Nonetheless, this isn't a real problem as well since they are really cheap. ;-)

remkolems commented 4 years ago

I did the the capacitor mod and was not successful. I destroyed the capacitor completely. Signal with the antenna became half of CC2531 (oops to say the least), So watch out! I had to buy a new board to continue my journey.... The bloody cap is tiny! You will need a magnifying glass.

Planning to repair my board, once I have the correct soldering station and miscellaneous required tools. I will keep this thread up to date.

See also (specs of capacitor and where to buy):

(https://zigbee2mqtt.discourse.group/t/cc1352p-switch-to-external-antenna-instead-of-pcb/681/6?u=rlems) and https://zigbee2mqtt.discourse.group/t/cc1352p-switch-to-external-antenna-instead-of-pcb/681/7?u=rlems

timdonovanuk commented 4 years ago

I really don't understand the design. Why even bother putting a SMA connector on...but then require phsyical modification to the board to actually support it. facepalm.

james-fry commented 4 years ago

I really don't understand the design. Why even bother putting a SMA connector on...but then require phsyical modification to the board to actually support it. facepalm.

Because its a hardware dev kit not an "end user" device. TI are expecting this to be used to develop new devices - hence assumption there will be support engineers well able to resolder a SMD device.

timdonovanuk commented 4 years ago

I understand that, but thats not really a good justification, IMO. They also could have just shipped the entire board as a bag of parts and expect Ikea style self assembly? πŸ˜†

There are various jumpers on the board that allow changes, rather than having to solder a trace on..same principle.

james-fry commented 4 years ago

I understand that, but thats not really a good justification, IMO. They also could have just shipped the entire board as a bag of parts and expect Ikea style self assembly? πŸ˜†

There are various jumpers on the board that allow changes, rather than having to solder a trace on..same principle.

I thought on this too when I 1st saw the design. I'm no RF engineer, but I think the losses and EMC issues from adding a jumper in the signal path would be unacceptable.

CodeFinder2 commented 4 years ago

@remkolems Sorry to hear that and thanks for sharing your insights with us! That's why I warned about the mod/resoldering. πŸ˜‘

Hope you can finally repair it!

fredrikgk commented 4 years ago

I really don't understand the design. Why even bother putting a SMA connector on...but then require phsyical modification to the board to actually support it. facepalm.

You cannot use a conventional jumper for RF signals, that will introduce impedance mismatch and RF signal loss.

Similarly, you cannot simply split the RF path in two. Even when using a proper RF design splitter, which can be implemented on PCB, you would get 3 dB loss. That is not acceptable.

The design is made for TIΒ΄s customers to easily be able to evaluate the radiated performance out of the box. Thus, the PCB antennas are connected by default. The SMA is intended primarily for customers who want to do advanced RF testing by connecting the radio directly to RF instruments (spectrum analyser, RF signal generator, etc.). These are typically fully capable of soldering a 0402 component.

@remkolems , the simplest way to solder the capacitor is to use a hot-air soldering iron. Combine with generous amounts of liquid flux and a good microscope and it is quite easy.

patrickharris commented 4 years ago

Thanks guys for the clue to press the soft reset button next to the USB connector. So happy it's working now.

valepe commented 4 years ago

I flashed my CC1352P-2 and I'm ready to change the panID and the channel (avoid wifi interferences) so I must repair my devices (no problem). But I have a question: after paired the devices z2m will change the actual ID (eg 0x....) of my devices?

CodeFinder2 commented 4 years ago

@valepe No, those IDs won't change.

valepe commented 4 years ago

@TASSDevon: no, it does not auto-detect an external antenna. You have to resolder a tiny capacitor on the board (CC1352P-2) to use the external antenna...unfortunately.

Can you tell me how you move this capacitor? Did you use a hot air station or a solder tip? Thanks

CodeFinder2 commented 4 years ago

With a fine solder tip ;-)

valepe commented 4 years ago

With a fine solder tip ;-)

Did it in a breaveheart moment. :) I used and edge tip but wtf these 0402 components are too small for my tastes...

alekslyse commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

TASSDevon commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

Mine has been running for months without a reset required.

CodeFinder2 commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

Mine has been running for months without a reset required.

Dito 😏

alekslyse commented 4 years ago

Strange. On raspberry pi or nuc/pc? I'm running on a nuc and seem to need a reset from time to time. From what I understand it has not been a problem on pi's

TheStigh commented 4 years ago

Strange. On raspberry pi or nuc/pc? I'm running on a nuc and seem to need a reset from time to time. From what I understand it has not been a problem on pi's

Only thing I do experience is that my NUC i7 on reboot, about every 3-5th reboot I need to power-cycle the CC, but on my NUC i5 that never happens. Either it is an USB issue, or one of my CC's are faulty. I could of course try to re-flash but it hasn't been that big issue to me :)

TASSDevon commented 4 years ago

Mine is hooked up to a Beaglebone Black (rev B) which is never rebooted

presslab-us commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

I messed around with a bunch of stuff to try and fix this. Using an oscilloscope I have seen that when it fails, the CC1352P is trying to send data back to the PC, but the PC never receives it. The XDS110 debugger (the on-board one) somehow gets into a state where it doesn't relay this data.

What seems to have solved it is updating the XDS110 to the latest version. The firmware is included here: https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds_software_package_download.html

And instructions; use the path "C:\ti\ccs_base\common\uscif\xds110": http://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds110.html#updating-the-firmware

It used to need a reset every time I reboot the PC, but now I have not needed to reset it and I've rebooted the PC at least a half dozen times.

james-fry commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

I messed around with a bunch of stuff to try and fix this. Using an oscilloscope I have seen that when it fails, the CC1352P is trying to send data back to the PC, but the PC never receives it. The XDS110 debugger (the on-board one) somehow gets into a state where it doesn't relay this data.

What seems to have solved it is updating the XDS110 to the latest version. The firmware is included here: https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds_software_package_download.html

And instructions; use the path "C:\ti\ccs_base\common\uscif\xds110": http://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds110.html#updating-the-firmware

It used to need a reset every time I reboot the PC, but now I have not needed to reset it and I've rebooted the PC at least a half dozen times.

Nice analysis :) Thanks

valepe commented 4 years ago

Did the need to reset CC1352P-2/CC26X2R1 ever get solved? Is it possible to solve this in firmware or was it a really bad choice to buy those boards when it randomly require a reset?

I messed around with a bunch of stuff to try and fix this. Using an oscilloscope I have seen that when it fails, the CC1352P is trying to send data back to the PC, but the PC never receives it. The XDS110 debugger (the on-board one) somehow gets into a state where it doesn't relay this data.

What seems to have solved it is updating the XDS110 to the latest version. The firmware is included here: https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds_software_package_download.html

And instructions; use the path "C:\ti\ccs_base\common\uscif\xds110": http://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds110.html#updating-the-firmware

It used to need a reset every time I reboot the PC, but now I have not needed to reset it and I've rebooted the PC at least a half dozen times.

Great! Can I update the XDS110 with Uniflash? Or should I use the support utilities?

CodeFinder2 commented 4 years ago

@presslab-us from me as well, great analysis and thanks for sharing! πŸ™‚

presslab-us commented 4 years ago

Great! Can I update the XDS110 with Uniflash? Or should I use the support utilities?

@valepe I'm not sure if Uniflash can program the XDS110, or what version it comes with. You can try it and let us know. The version I programmed from my link above was firmware_3.0.0.11.bin

alekslyse commented 4 years ago

I got it updated to .11 by uniflash (it said it had a new fw when I was about to upload the new z2m firmware), but got 03.00.00.13 from the link above

alekslyse commented 4 years ago

Also remember the serial id change on the update so z2m won't change if you don't update the path. The version is in the name for example /dev/serial/by-id/usb-Texas_Instruments_XDS11003.00.00.13Embed_with_CMSIS-DAP_L430021O-if00

valepe commented 4 years ago

I got it updated to .11 by uniflash (it said it had a new fw when I was about to upload the new z2m firmware), but got 03.00.00.13 from the link above

I updated with Uniflash but I can't find where to read the XDS110 firmware version. I found in System report -> USB -> XDS110 (3.0.0.12) so I suppose that this is the firmware version just updated.

upwindanderl commented 4 years ago

I did a fw update tonight and still have this reboot / reset problem :(

Either sometimes it's pretty hard to get the board running. It's not only pressing the reset button once and everything is ok. Supershitty :( HW is a intel x86 board, cheap nuc rebuild

presslab-us commented 4 years ago

In my case I could always unplug and replug the USB and it would be fine. Does that work for you? I didn't use the reset button because it didn't work well in the case I made. Since updating the XDS110 I have rebooted many times and there has been no problem. Maybe you can try removing the jumpers for TCK and TMS?

upwindanderl commented 4 years ago

In my case I could always unplug and replug the USB and it would be fine. Does that work for you? I didn't use the reset button because it didn't work well in the case I made. Since updating the XDS110 I have rebooted many times and there has been no problem. Maybe you can try removing the jumpers for TCK and TMS?

hmmmm sounds promising! πŸ‘

The thing is the server is not nearby me and i'm only remote on it. As well plugging or unplugging is a total difficult phonecall and some remote guidance. The only thing i know is that i updated the last FW yesterday which was automatically recommended with uniflash as i've been there and again today big trouble after rebooting the server. Next time im there i'll check exactly the fw version and what you mean with tck and tms :-)

upwindanderl commented 4 years ago

In my case I could always unplug and replug the USB and it would be fine. Does that work for you? I didn't use the reset button because it didn't work well in the case I made. Since updating the XDS110 I have rebooted many times and there has been no problem. Maybe you can try removing the jumpers for TCK and TMS?

hmmmm sounds promising! πŸ‘

The thing is the server is not nearby me and i'm only remote on it. As well plugging or unplugging is a total difficult phonecall and some remote guidance. The only thing i know is that i updated the last FW yesterday which was automatically recommended with uniflash as i've been there and again today big trouble after rebooting the server. Next time im there i'll check exactly the fw version and what you mean with tck and tms :-)

So in the end it looks pretty solid! Had lot reboots because of server problems and of course some more restarts of HA and i can't remember to push the button again. Didn't changed anything on the jumpers, the only solution for me to click yes after i was asked for some firmware update of the UNIFLASH tool

likellindil commented 4 years ago

In my case I could always unplug and replug the USB and it would be fine. Does that work for you? I didn't use the reset button because it didn't work well in the case I made. Since updating the XDS110 I have rebooted many times and there has been no problem. Maybe you can try removing the jumpers for TCK and TMS?

hmmmm sounds promising! πŸ‘ The thing is the server is not nearby me and i'm only remote on it. As well plugging or unplugging is a total difficult phonecall and some remote guidance. The only thing i know is that i updated the last FW yesterday which was automatically recommended with uniflash as i've been there and again today big trouble after rebooting the server. Next time im there i'll check exactly the fw version and what you mean with tck and tms :-)

So in the end it looks pretty solid! Had lot reboots because of server problems and of course some more restarts of HA and i can't remember to push the button again. Didn't changed anything on the jumpers, the only solution for me to click yes after i was asked for some firmware update of the UNIFLASH tool

Hi there,

My HA & Z2M are built on my NUC and I met exactly the same issue. May I know how you fixed this issue in the end? Now I have to unplug and re-plug it every one or two days to keep it working.

joshuakoh1 commented 3 years ago

Has this been fixed yet?

timdonovanuk commented 3 years ago

My personal experience, coming from a CC2531 to the CC1352p-2 is the CC1352p-2 has been a nightmare. Weekly I get devices drop off my network, that need repairing. If I stop and restart Z2M I quite often need to repress the button on the side of the CC1352P, which is not great as physical access to it is not easy (it's up in my loft).

I tried to flash the CC1352P today using the command line TI tools and it actually managed to take out my entire Proxmox instance!

joshuakoh1 commented 3 years ago

@timdonovanuk Yup I'm getting really upset about the need to press the reset button, I just wish this issue was made more obvious in the supported sticks page. I would not have purchased this at all if I knew about it from the start. Open to suggestions about a better stick without this issue as well.

Separately, how did you manage to pass through the device to VM on proxmox? Passing the USB port doesn't create any /dev/ttyACM0 on the VM.

timdonovanuk commented 3 years ago

I have to agree, based on my personal experience I don't think CC1352P should be in the list of recommended devices, but maybe it's just some of us. Today I'm experiencing more fun, some of my bulbs randomly dont work with Data request failed with error: 'No network route' (205) errors 🀦

@joshuakoh1 here are my proxmox settings, works fine for me:

image

Needs a hard reboot. Then I get these showing up:

~$ ls -l /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Dec 14 15:57 usb-Texas_Instruments_XDS110__03.00.00.05__Embed_with_CMSIS-DAP_L43001PG-if00 -> ../../ttyACM0
lrwxrwxrwx 1 root root 13 Dec 14 15:57 usb-Texas_Instruments_XDS110__03.00.00.05__Embed_with_CMSIS-DAP_L43001PG-if03 -> ../../ttyACM1
joshuakoh1 commented 3 years ago

@timdonovanuk What distro are you using btw? Mine was Ubuntu 20.04 and there's no /dev/serial at all I ended up passing /dev/ttyACM0 directly from host as /dev/ttyS0 on VM.

timdonovanuk commented 3 years ago

@joshuakoh1 Debian 10. To be fair, I think if the adapter is not passed through successfully then I used to get no /dev/serial at all either. Glad you got it going!

timdonovanuk commented 3 years ago

I finally updated to the latest firmware on the adapter and it's been an unstable mess. Once a day a different bulb drops off the network, or a battery powered sensor or button has to be repaired. It's actually worse than the firmware I was using before (~6 months old). At this point I don't know whether to abandon z2m or abandon the CC1352.

joshuakoh1 commented 3 years ago

Looking for alternatives to CC1352P-2. Really frustrated with the stupid reset button problem. Does zzh/slaesh's stick have this issue?

timdonovanuk commented 3 years ago

@joshuakoh1 FWIW throughout all of this, my logs have been showing a lot of "failed to ping ". Today I updated to the latest version 1.17 and also set availability_timeout: 0 (it used to be set to 60) and so far not a single error in my log. I found the advice about availability_timeoutin another issue thread. For some people setting it to zero made z2m more stable, and for others setting it to 60 made it more stable so I don't know...but so far so good.