Skip to content
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

TX power for CC1352P2 CC2652P router firmware #273

Closed
bkupidura opened this issue Mar 4, 2021 · 58 comments
Closed

TX power for CC1352P2 CC2652P router firmware #273

bkupidura opened this issue Mar 4, 2021 · 58 comments
Labels

Comments

@bkupidura
Copy link

Hey,
Can you please share what tx power is set in CC1352P2_CC2652P_other_router_20210128.hex?

Currently im tessting CC2652P as a router, it works stable but i think that it has lower radio tx power than my old CC2530+CC2591 - which is surprising ;)

@Koenkk
Copy link
Owner

Koenkk commented Mar 6, 2021

5dbm, currently this is not configurable, to change you have recompile: https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/COMPILE.md

@bkupidura
Copy link
Author

bkupidura commented Mar 6, 2021

Ok, will try to build new firmware. As i dont have any experience with CCS (and zigbee firmware), any hints how to adjust tx power before compilation?

UPDATE:
So afaik i was able to change TX power. But not sure how to compile router code. Im able to build firmware, but stick is not trying to join network. My guess is that i have cordinator firmware.

TX power change:

+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/MAC/HighLevel/mac_cfg.c
@@ -109,6 +109,10 @@
 #endif
 #endif

+#ifndef PHY_TX_POWER_FREQ_2_4_G
+#define PHY_TX_POWER_FREQ_2_4_G 5
+#endif
+
 /* ------------------------------------------------------------------------------------------------
  *                                           Global Variables
  * ------------------------------------------------------------------------------------------------
@@ -183,7 +187,7 @@ const macPib_t macPibDefaults =
 #ifndef FREQ_2_4G
   14,                                         /* phyTransmitPower */
 #else
-  5,                                          /* phyTransmitPower */
+  PHY_TX_POWER_FREQ_2_4_G,                    /* phyTransmitPower */
 #endif
 #ifndef FREQ_2_4G
   MAC_CHAN_LOWEST,                            /* logicalChannel */

+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@@ -2,6 +2,7 @@
 -DMAC_CFG_TX_DATA_MAX=5
 -DMAC_CFG_TX_MAX=8
 -DMAC_CFG_RX_MAX=5
+-DPHY_TX_POWER_FREQ_2_4_G=20

I tried to set different defines for router fw (ZG_DEVICE_RTRONLY_TYPE, DEVICE_BUILD_ROUTER, ZSTACK_ROUTER_BUILD, DEVICE_LOGICAL_TYPE), but for now no luck.

UPDATE2: Looks it works. I used zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs instead of znp. Testing since yesterday and looks fine (but CC2530+CC2591 still have better range).

@r312645
Copy link

r312645 commented Mar 15, 2021

Can you please share your firmware?

@bkupidura
Copy link
Author

bkupidura commented Mar 15, 2021

Sure, but please remember that this is "test" firmware, im dont know much about this board. I cant guarantee anything (except that it works in my network). But still power is better on CC2530+CC2591, can you confirm?

Changes:

  • TX power set to 20
  • Red LED always turn on

zb_firmware_CC1352P_2.zip

@gio-dot
Copy link
Contributor

gio-dot commented Mar 27, 2021

Sure, but please remember that this is "test" firmware, im dont know much about this board. I cant guarantee anything (except that it works in my network). But still power is better on CC2530+CC2591, can you confirm?

Changes:

  • TX power set to 20
  • Red LED always turn on

zb_firmware_CC1352P_2.zip

Wich hardware are you using?

@Alfiegerner
Copy link

@bkupidura - thanks, appears to be working for me.

I have two of these CC2652P routers, and the one flashed with your firmware is reporting approx double the LQI in the same location.

Finger crossed this change makes its way through.

@bkupidura
Copy link
Author

@Alfiegerner my firmware for sure will not be part of "official" zigbee2mqtt firmware available for CC1352P2. As it have some issues with introspection.

But maybe @Koenkk can just introduce two firmwares created by him (5 and 20 DB tx power).

@cjsteward
Copy link

@Alfiegerner @bkupidura Have either of you had any issues since you've been running the modified firmware? I've installed it on a couple of tubes routers the other day and they seem to be working perfectly so far. And pardon my ignorance here @bkupidura , but what did you mean by "issues with introspection"?

@Alfiegerner
Copy link

Alfiegerner commented Apr 21, 2021

No issues from me @cjsteward, looking good. I don't get any updates on last seen in the z2m frontend but I don't think I did pre custom flash either. Network map show sitting connections and connected endpoints all good.

@bkupidura
Copy link
Author

@cjsteward board with that firmare is running in my network for last 1.5 month without issue.

Regarding introspection i mentioned, when you are pairing board with zigbee2mqtt, you will see error in log message about missing endpoint. Except that error, everything else (i hope) is working.

@cjsteward
Copy link

cjsteward commented May 2, 2021

Just wanted to follow up here - I've been running the modified firmware for over two weeks now and everything is still stable, but I just wanted to call out a few oddities I've noticed:

  • As @bkupidura mentioned above, I also receive errors on startup:
    Zigbee2MQTT:error 2021-05-02 15:04:36: Failed to configure 'New Garage Repeater', attempt 1 (Error: ConfigureReporting 0x00124b00229839f4/8 genBasic([{"attribute":"zclVersion","minimumReportInterval":0,"maximumReportInterval":3600,"reportableChange":0}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 34821 - 8 - 3 - 0 - 7 after 10000ms) at Timeout._onTimeout (/app/node_modules/zigbee-herdsman/dist/utils/waitress.js:37:35) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7))

  • Link quality is only reported on startup, I believe I read in another thread though that this is a known issue, even on stock fw.

  • Another issue I've noticed is that I haven't been able to pair new devices. I swapped out my CC1352P-2 coordinator for a CC2652P from Tubes around the same time I put these routers into rotation, so I'm not exactly sure what's causing the issue there.

I'm hoping there will be production ready firmware released with the Tx power increase because besides the issues above, I've been really happy with the performance.

@bkupidura
Copy link
Author

bkupidura commented May 2, 2021

@cjsteward regarding pairing issue, i dont think its related to router firmware. As in my network i added new enddevices while router with custom firmware is running.

You can easly test that by just removeing router from network (and powering it off after that, to be sure) and try to pair new device.

@github-actions
Copy link

github-actions bot commented Jun 2, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@Alfiegerner
Copy link

Missed stale bot - I think this would be a great feature.

@TSKnuhtsen
Copy link

TSKnuhtsen commented Jun 14, 2021

I'm using a CC1352P-2 LAUNCHPAD.
The coordinator firmware works perfectly on my device.
But when I load @bkupidura 's firmware or firmware from the Z2M Z-STACK Firmware Repo, the device does will not attempt to interview and join the network.

Anyone have any ideas on how I can get my device to interview and pair with my coordinator?

EDIT: After sniffing zigbee traffic with CC2531, I realized that CC1352P-2 was sending "Beacon Request) appropriately and that the issue resided with my coordinator. I erased and updated the firmware on my CC2562R coordinator and I am now able to pair CC1352P-2 Launchpad with latest firmware (*_20210128.hex) every time I plug in the device.

SOLVED.

@thiscantbeserious
Copy link

thiscantbeserious commented Nov 25, 2021

Succesfully flashed the 20dBm variant above and got double the lqi now ... only issue I have is that no matter what I do not a single device will ever join the router even if I specifically put it on top of it ...

@cjsteward
Copy link

@thiscantbeserious I had the same issue and ended up reverting back to the stable firmware. I hope someone smarter than me can figure this out because besides the pairing issue, the increase in performance and range was really nice. It also seems like a waste having nice routers if they can only perform at 1/4 of their rated power.

@ptvoinfo
Copy link

ptvoinfo commented Dec 5, 2021

Can someone test my router firmware? It supports CC2562 and CC1352P-2, custom LED configuration, etc. I am primarily interested in signal strength.
https://ptvo.info/download/ptvo-firmware-latest.zip

@thiscantbeserious
Copy link

Can someone test my router firmware? It supports CC2562 and CC1352P-2, custom LED configuration, etc. I am primarily interested in signal strength. https://ptvo.info/download/ptvo-firmware-latest.zip

Will do. Give me a week, maybe a day :)

@bkupidura
Copy link
Author

@ptvoinfo can you build firmware which reports rssi to z2m in some (1/5/10m) intervals? Im currently using Conbee as cordinator, and to be honest im not trusting signal strenght reported by z2m.

@ptvoinfo
Copy link

ptvoinfo commented Dec 6, 2021

@bkupidura The coordinator receives RSSI with every message from a device. You can define a virtual output with a virtual pin or an output for a LED pin and enable periodic reports with the necessary interval. But I'm not sure if Conbee can receive messages from a DIY device.

@ruimarinho
Copy link

@ptvoinfo what's the difference between psm-cc2652p.hex and cc2652p.hex? Not sure which one to flash.

@ptvoinfo
Copy link

@ruimarinho You cannot flash these files directly.
It is necessary to configure the firmware for your board.
https://ptvo.info/cc2652r1-cc2652rb-cc2652p-cc1352p2-configurable-router-firmware-748/

@irakhlin
Copy link

@ruimarinho You cannot flash these files directly. It is necessary to configure the firmware for your board. https://ptvo.info/cc2652r1-cc2652rb-cc2652p-cc1352p2-configurable-router-firmware-748/

I have tested your router firmware on multiple cc2652p sticks, including the sonoff, zigstar and a custom router I am working on with a SHT35 and some other sensors. I am seeing a significant increase in LQI across my entire network. It would be hard to give an exact figure but previously my mesh had some distance end device sensors sitting at ~15, currently the lowest is ~70. I was however experience this issue: 10282. Earlier today I re-flashed most of the routers with the newest firmware and all are still responding and pinging as expected.

Just a few things I wanted to comment on...
In your configuration utility all settings are saved between opening and closing the application, except "serial bootloader enable SBL". I ran into an issue as I was going back and forth modifying the firmware a few times, enabled the feature, closed the app, reopened it and only changed a setting on the main page without realizing that this setting does not get saved. Ended up having to flash with jtag, not a huge deal just a minor point.
Unrelated to tx power, but it would also be amazing to be able to configure sensors to use the reporting functionality based on change example (https://www.zigbee2mqtt.io/devices/KMPCIL_RES005.html#kmpcil-kmpcil_res005). This would allow me to configure router devices with less frequent "periodic updates" but still get good sensor values.

As a follow up question, if you do not mind sharing what version of the TI simplelink SDK are you using for these firmwares? I only ask out of interest as I was working on one for the experience.

@Hedda
Copy link
Contributor

Hedda commented Dec 22, 2021

currently this is not configurable, to change you have recompile

FYI, submitted a separate feature request for Zigbee router firmware with remotely configurable TX power output level -> #341

@ruimarinho
Copy link

@ptvoinfo would be great to test a pre-compiled version for TubesZB based on these schematics.

@irakhlin
Copy link

irakhlin commented Dec 22, 2021

@ruimarinho

@ptvoinfo would be great to test a pre-compiled version for TubesZB based on these schematics.

I can confirm I am using the firmware on two of those units for a few day now. With the following configuration.. just note in the second image I've blacked out Manufacturer ID, Name, Model and Icon as I have simply just set my own custom information here to make it easier and identify all units in my network running "custom" firmware I have deployed. You should be able to use anything. After simply hit "save custom converter to Z2M" which will generate a converter file that you will need to set in zigbee2mqtt before joining the device. Also do not forget to enable serial bootloader SBL or you will lock the bootloader and need to reflash via jtag.

edit: I should note I am also using this configuration on a zigstar v4, sonoff 3 plus and CircuitSetup's CC2652P2 sticks.

tube
tube2

@daufinsyd
Copy link

I have tested your router firmware on multiple cc2652p sticks, including the sonoff, zigstar and a custom router I am working on with a SHT35 and some other sensors. I am seeing a significant increase in LQI across my entire network. It would be hard to give an exact figure but previously my mesh had some distance end device sensors sitting at ~15, currently the lowest is ~70. I was however experience this issue: 10282. Earlier today I re-flashed most of the routers with the newest firmware and all are still responding and pinging as expected.

Hi @irakhlin is it now working stable or do you still have disconnections ?
Did you also flashed the coordinator ? or how did you solve the issue with devices routers (eg plugs) ?

@cjsteward
Copy link

cjsteward commented Dec 30, 2021

Just wanted to report back - I've flashed both Tube's cc2652p router and Sonoff's Dongle Plus with PTVO's router firmware while following the options in @irakhlin post above and everything has been perfectly stable for about a week or so now. I've noticed a significant increase in LQI with my 3 routers (mix of Tube's and Sonoff's), especially after being paired with my Tube's usb cc2652p coordinator that's flashed with the 20 db firmware from Koenkks dev branch. Sensors and routers pair faster and more easily, sensors located at further points in my house and garage are more responsive, Z2M network map loads up quick and accurately, and nothing has dropped off. This is the end game zigbee solution that I've been trying to achieve for literally years. I can't thank everyone enough for all the hard work that has gone into this project, including all the custom firmware. Seriously amazing stuff.

Side Note: For anyone following this thread PLEASE PLEASE pay attention to the BSL option in the firmware configuration tool. I took a stab at installing PTVO's router firmware a month ago when he first posted it here and I ended up killing a router due to my ignorance. If you do goof up like I did it can be recovered, but unless you already have the flashing tools required it's probably cheaper to just buy a new Sonoff. Hard lesson learned for me but the payoff here was completely worth it. Seriously, thank you again!

@ruimarinho
Copy link

@cjsteward which firmware are you referring to with +20dBm hardcoded? I believe the one posted on the dev branch was +9dBm only.

@irakhlin
Copy link

irakhlin commented Dec 31, 2021

@cjsteward which firmware are you referring to with +20dBm hardcoded? I believe the one posted on the dev branch was +9dBm only.

@ruimarinho I think he is talking about the ptvoinfo custom firmware configuration tool. I posted a screenshot of the settings I am using for generating that firmware and I can also report my network has been incredibly stable.

@daufinsyd I did not flash my firmware on the coordinator but I did flash all my 'custom' routers and a few usb powered sensors I am working on, all of which are cc2652p chips. The coordinator I am using is tube's ethernet cc2652. For the last week my network has been stable and the firmware provides a very significant increase in LQI. I now believe the issue I was having with routers going offline was due to 3 zigbee powered sensors that where running very old firmware. I am not positive about this but I have removed them from the network and no issues thus far, I will probably know in the next few days.

@ruimarinho
Copy link

Thanks @irakhlin. Would be great if you could do a side-by-side test with the firmware compiled by @bkupidura above (link)!

@irakhlin
Copy link

Thanks @irakhlin. Would be great if you could do a side-by-side test with the firmware compiled by @bkupidura above (link)!

@ruimarinho I did not use his specific file but about a month or so ago I did make compile the same firmware with the changes he posted above. I saw an increase in LQI but the issue of not responding to pings/network map requests was very annoying. It also caused significant delay on restarts of zigbee2mqtt. It seemed like it would wait for a ping timeout from all routers running thr firmware before the web ui would start to load.

@digiblur
Copy link

Fun with higher power zigbee https://youtu.be/4aLxw48ZCQo

@cjsteward
Copy link

cjsteward commented Dec 31, 2021

@ruimarinho I may be mistaken, and I have no real way to measure it, but I was under the impression that the dev branch coordinator firmware defaults to 9 but allows you to set it higher with "transmit_power" in the config file.

If I'm wrong then I guess I have more improvements to look forward to in the future.

@irakhlin
Copy link

@ruimarinho I may be mistaken, and I have no real way to measure it, but I was under the impression that the dev branch coordinator firmware defaults to 9 but allows you to set it higher with "transmit_power" in the config file.

If I'm wrong then I guess I have more improvements to look forward to in the future.

@cjsteward I think the discussion here was regarding various versions of the router firmware. As it stands now that value is compiled into the firmware. There are a few different versions floating around with values from 5db to 20db (for the cc2652p) chips.

@cjsteward
Copy link

cjsteward commented Dec 31, 2021

@irakhlin Yeah, the discussion here is for sure focused on the router firmware. I was just responding to ruimarinho because he was asking about the 20db coordinator firmware from the dev branch that I mentioned in my previous post.

@ruimarinho
Copy link

I've switched to @ptvoinfo's firmware as well and my network has been rock solid too. I've never had an issue with @bkupidura's one too. I'm using ZHA and a Tubes coordinator and router.

@mortenmoulder
Copy link

I'm getting a solid ~190 LQI between my two Sonoff sticks both running 20 dBm firmwares. The router is using PTVO's firmware. I tried a large antenna from a router, as well as the antenna that came with the Sonoff stick, and I couldn't see a difference between them.

The two sticks are between a thick concrete wall and the coordinator is plugged into my server without an extension cable. Still lots of options for better LQI, but 190 is very, very good.

@wojciechczyz
Copy link

@ruimarinho You cannot flash these files directly. It is necessary to configure the firmware for your board. https://ptvo.info/cc2652r1-cc2652rb-cc2652p-cc1352p2-configurable-router-firmware-748/

Hi @ptvoinfo can you please help in correct configuration for https://github.com/egony/cc2652p_cc1352p_RF-STAR/tree/main/firmware/router RF-Star Stick? I found pins to be described here:
https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/bin/README.md

ZigStar Stick v4 CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zip DIO_15 Only for CH340C ver. DIO_28: 2.4Ghz
DIO_29: 20dBm PA DIO_6 (Green)
DIO_7 (Red)

Thank you,
Wojciech

@KipK
Copy link

KipK commented Feb 1, 2022

@wojciechczyz , can't we flash with usb using koenkk bootloader? Would it overwrite the bl ?

@Hedda
Copy link
Contributor

Hedda commented Feb 1, 2022

Can someone test my router firmware? It supports CC2562 and CC1352P-2, custom LED configuration, etc. I am primarily interested in signal strength.
https://ptvo.info/download/ptvo-firmware-latest.zip

@ptvoinfo could you perhaps build a +9 TX router OTA firmware for ITead's new SONOFF ZBMINI-L Zigbee 3.0 Smart Switch?

https://itead.cc/product/sonoff-zbmini-l-zigbee-smart-switch-no-neutral-wire-required/

https://sonoff.tech/product/diy-smart-switch/zbmini-l/

It has been confirmed its radio board uses exact same model of CC2652P chip as ITead SONOFF Zigbee 3.0 USB Dongle Plus:

https://community.home-assistant.io/t/sonoff-zbmini-l-zigbee-3-0-smart-switch-by-itead-works-without-neutral-wire-and-based-on-cc2652p-so-should-be-a-good-zigbee-router/384644/

PS: Not recieved mine yet but latest information is firmware ITead is shipping is configured as "End Device" (and not "Router").

@bojanpotocnik
Copy link

latest information is firmware ITead is shipping is configured as "End Device" (and not "Router").

@Hedda, this may be because ZBMINI-L does not have guaranteed power budget, but it can be dependent on what load it is switching (check Shelly Bypass for Shelly 1L). Operating as End Device means lower power consumption -> more stable operation in more use cases. Operating as Router - even more with increased output power - would increase the chance of brownout resets, which would also be more impactful/noticeable when operating as a Router.

ZBMINI (with neutral wire) uses the same chip and does not have these limitations, but for some strange reason none of the router firmwares in this repository work with it - check last part of this comment.

@nickwild-999
Copy link

@ptvoinfo @Hedda Is there a version of the firmware for the regular ZBMINI?

@nickwild-999
Copy link

nickwild-999 commented Mar 7, 2022

Thanks @ptvoinfo so if we select the chip type to CC2652R it works? Are there any means of getting your firmware working on the Sonoff S26R2ZB plug too? Problems with this plug are on #10282

@ptvoinfo
Copy link

ptvoinfo commented Mar 7, 2022

Yes, the firmware for cc2652r works. Sorry, but I don't have info about sonoff s26R2ZB.

@nickwild-999
Copy link

Thanks @ptvoinfo

@Hedda
Copy link
Contributor

Hedda commented Mar 8, 2022

Sorry, but I don't have info about sonoff s26R2ZB.

FYI, ITead Sonoff S26R2ZB ZigBee Smart Plugs (S26R2ZBTPG/S26R2ZBTPF/S26R2ZBTPE) is also based on a new radio module with CC2652P (CC2652 P1F) but it has ceramic chip antenna so it does not look to have the same exact radio module design, or does it?

Koenkk/zigbee2mqtt#10909

Koenkk/zigbee2mqtt#10282

https://itead.cc/product/sonoff-s26r2zb-zigbee-smart-plug-uk-de-fr/

https://sonoff.tech/product/smart-plug/s26r2zb/

image

image

image

image

@bojanpotocnik
Copy link

@Hedda, note that the module on your pictures has exactly the same design flaw/optimization as described in ptvoinfo/zigbee-configurable-firmware#96 (comment) (ptvo blog post), therefore enabling the power amplifier will result in working chip/FW, but no transmitted packets.

@Hedda
Copy link
Contributor

Hedda commented Mar 9, 2022

@Hedda, note that the module on your pictures has exactly the same design flaw/optimization as described in ptvoinfo/zigbee-configurable-firmware#96 (comment) (ptvo blog post), therefore enabling the power amplifier will result in working chip/FW, but no transmitted packets.

So to resolve Koenkk/zigbee2mqtt#10282 it then probably very likely that selecting CC2652R chip type in the PTVO firmware configurator will result in a working firmware image on the ITead Sonoff S26R2ZB ZigBee Smart Plug similar to the new Sonoff ZBMINI (01MINIZB) as both use CC2652P (CC2652 P1F) chip model and their radio modules have same design "optimizations"?

Manually configuring the transmit power to 5 dBm or less in the firmware should probably also work?

@ruimarinho
Copy link

@ptvoinfo there have been a few commits on https://github.com/ptvoinfo/zigbee-configurable-firmware but it seems like the changelog on the blog hasn't been updated in a while.

Are any of the most recent commits relevant for the router firmware (in my case, originally Dec 2021)? Thanks.

@ptvoinfo
Copy link

ptvoinfo commented May 4, 2022

@ruimarinho All these changes are relevant to my firmware, where you can build a router too.

@Hedda
Copy link
Contributor

Hedda commented May 4, 2022

5dbm, currently this is not configurable, to change you have recompile: https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/COMPILE.md

See #341 for request + discussion about having a similar configurable feature in Koenkk's Z-Stack Zigbee Router firmware -> #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests