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

Z-Stack router firmware for CC2652P/CC1352 that support control of RF transmit power output dBm level remotely #341

Closed
Hedda opened this issue Dec 20, 2021 · 59 comments

Comments

@Hedda
Copy link
Contributor

Hedda commented Dec 20, 2021

Feature request for a Z-Stack router firmware for CC2652P/CC1352P that can support controlling of RF transmit power output dBm levels remotely.

If router firmware supported that feature then could somehow expose the power output configuration attributes in applications like Zigbee2MQTT and ioBroker, etc. when the CC2652P and CC1352 based device is joined to Zigbee network and there allow the user to set the power output in dBm on those routers without reflashing, (maybe by presenting the transmission power output option on the Z-Stack router as via switches or dimmer?).

I guess that future router firmware for CC2652P/CC1352P will be set to +9 dBm by default to stay compliant with international regulations, and having a feature like this would allow users to bump applications up to +20 dBm without having to maintain a separate firmware. Better yet could allow users to change and exactly tweak RF transmit power output dBm level settings for each individual CC2652P/CC1352P based router to achieve optimally range and coverage.

If 20 steps of TX power output levels is too many then suggest offering these five (5) dBm settings levels; 5, 9, 14, 19, and 20.

PS: Worth knowing difference between dB and dBm https://www.wilsonpro.com/blog/whats-the-difference-between-db-and-dbm

@ruimarinho
Copy link

For reference, some experimental firmware versions have been posted on #273. The difference between the stable firmware and the one provided by @bkupidura (with +20dBm) is staggering: from LQI 7 to 80 in exactly the same spot.

@Hedda
Copy link
Contributor Author

Hedda commented Dec 22, 2021

For reference, some experimental firmware versions have been posted on #273.

Should be noted that the router firmware in #273 is not configurable to differed TX power output levels, it is instead hardcoded into the firmware image to always use +20dBm TX power output amplification and can not be changed without flashing a other firmware image with a different configuration, which again is might be too strong/high for some scenarios and as such not always optimal for all individual users situations.

The initial request from the original post above remains as it would be great to have a Zigbee router firmware for CC2652P/CC1352P where the TX power output could be reconfigured remotely.

@wolph
Copy link

wolph commented Jan 2, 2022

As a simpler solution for now, a normal / low power build and a high power build would already make a lot of difference.

@digiblur
Copy link

digiblur commented Jan 8, 2022

I'd definitely drop some decent donations to @Koenkk to make a CC2652 router firmware that had a Z2M converter with a slider of output power, restart button (probably needed to change power?), and LED state (on/off/status) picker. Game changer indeed.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

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

@github-actions github-actions bot added the Stale label Feb 8, 2022
@wolph
Copy link

wolph commented Feb 8, 2022

@Koenkk would you accept a pull request with an extra high-power build in addition to the regular ones?

@Koenkk
Copy link
Owner

Koenkk commented Feb 8, 2022

would you accept a pull request with an extra high-power build in addition to the regular ones?

No, this creates extra maintenance overhead for me. Instead this should be done by adding a manufacturer specific attribute on the genBasic cluster, from there it can be controlled from z2m by sending a write command.

@github-actions github-actions bot removed the Stale label Feb 9, 2022
@wojciechczyz
Copy link

I can see there is already coordinator with 5.40 SDK in development branch, is there a plan for a router with 5.40? Thank you

@Hedda
Copy link
Contributor Author

Hedda commented Feb 25, 2022

I can see there is already coordinator with 5.40 SDK in development branch, is there a plan for a router with 5.40? Thank you

Please start a new issue for that version request as that is off-topic for this specific subject or at least not directly related to topic.

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label Mar 28, 2022
@wolph
Copy link

wolph commented Mar 28, 2022

This if very much still relevant. Bumping

@github-actions github-actions bot removed the Stale label Mar 29, 2022
@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label Apr 28, 2022
@Hedda
Copy link
Contributor Author

Hedda commented Apr 28, 2022

Still a relevant request I think, if even technically possible?

@ptvoinfo
Copy link

@Hedda
Maybe, this is off-topic. I've implemented this feature in the premium version
https://ptvo.info/zigbee-configurable-firmware-features/rf-signal-level-control/

@Hedda
Copy link
Contributor Author

Hedda commented Apr 28, 2022

Maybe, this is off-topic. I've implemented this feature in the premium version

https://ptvo.info/zigbee-configurable-firmware-features/rf-signal-level-control/

Nice to know that it can technically be done at least. I guess chances are low that you code a patch and do a PR for it to this repo?

https://github.com/Koenkk/Z-Stack-firmware/blob/master/router/Z-Stack_3.x.0/firmware.patch

@ptvoinfo
Copy link

I guess chances are low that you code a patch and do a PR for it to this repo?

My changes are incompatible with this repo.

@Hedda
Copy link
Contributor Author

Hedda commented Apr 28, 2022

@ptvoinfo off-topic but if Z2M needs a converter then maybe you need to create a "quirk" for ZHA Device Handlers for that too(?) -> https://www.home-assistant.io/integrations/zha#zha-exception-and-deviation-handling -> https://github.com/zigpy/zha-device-handlers/blob/dev/README.md and might also need ZHA code as well to expose config in its UI(?) -> zigpy/zigpy#934

@github-actions github-actions bot removed the Stale label Apr 29, 2022
@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label May 29, 2022
@wolph
Copy link

wolph commented May 29, 2022

This would still be very useful. Bump

@github-actions github-actions bot removed the Stale label May 30, 2022
@Koenkk Koenkk closed this as completed Nov 2, 2022
Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Nov 2, 2022
@wolph
Copy link

wolph commented Nov 2, 2022

Fantastisch @Koenkk, dankjewel!

@Koenkk
Copy link
Owner

Koenkk commented Nov 2, 2022

@wolph graag gedaan 😄

@shaggee
Copy link

shaggee commented Nov 16, 2022

This is now supported by the Z-Stack_3.x.0 router 20221102 https://github.com/Koenkk/Z-Stack-firmware/tree/develop/router/Z-Stack_3.x.0/bin . This will be supported in the zigbee2mqtt dev branch later today.

Will it work also with the coordinator firmware?

@Koenkk
Copy link
Owner

Koenkk commented Nov 17, 2022

@shaggee that is supported for a long time already via the transmit_power option: https://www.zigbee2mqtt.io/guide/configuration/adapter-settings.html

@Smandurlo
Copy link

but, how to use it for the router? We need to replace the firmware (is stable or dev) for the router and move to the dev branch? Where will we find the option to increase the dB?

@Hedda
Copy link
Contributor Author

Hedda commented Nov 18, 2022

but, how to use it for the router? We need to replace the firmware (is stable or dev) for the router and move to the dev branch? Where will we find the option to increase the dB?

You first need to flash your CC2652/CC1352 based Zigbee Router device with the Koenkk's Z-Stack 3.x.0 router firmware version 20221102 or later (currently in the develop branch so still in development / pre-release testing phase) -> https://github.com/Koenkk/Z-Stack-firmware/tree/develop/router/Z-Stack_3.x.0/bin

You will then need to use the very latest dev branch of zigbee2mqtt from today (e.i. cutting edge / development version) as only that dev branch got the converter and (it just got it less than 24-hours ago) -> https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html#linux

Lastly, you need to configure the device parameters by setting the wanted dB as Zigbee attribute for transmit_power in BasicCluster for the device in order to increase or lower.

(The feature will not be available in Z2M master until it gets bumped zigbee-herdsman-converters v14.0.669 as a dependency).

For reference:

zigbee-herdsman converter was committed to the master branch of zigbee-herdsman-converters on the 2nd of November 2022 -> Koenkk/zigbee-herdsman-converters@8fb1ba4 and that means that the needed converter should be available in zigbee-herdsman-converters v14.0.669 -> https://github.com/Koenkk/zigbee-herdsman-converters/releases/tag/v14.0.669

zigbee-herdsman-converters v14.0.669 was bumped in Z2M yesterday https://github.com/Koenkk/zigbee2mqtt/commits/dev

PS: TheJulianJES wrote step-by-step instructions for how to change router transmit power specifically in Home Assistant's ZHA integration (if supported in Zigbee Router device firmware) but it should be similar in Zigbee2MQTT -> zigpy/zha-device-handlers#1886

@Hedda
Copy link
Contributor Author

Hedda commented Nov 18, 2022

Maybe, this is off-topic. I've implemented this feature in the premium version
https://ptvo.info/zigbee-configurable-firmware-features/rf-signal-level-control/

@ptvoinfo Can you extend the converter for custom_devices_diy.js to expose transmit_power option for your devices too? See:

Koenkk/zigbee-herdsman-converters@8fb1ba4

@ptvoinfo
Copy link

@Hedda In my case, this is configurable feature and may absent in many devices. Therefore, you can create a custom converter for your device and the corresponding option will appear in HA automatically.

@Smandurlo
Copy link

Thanks @Hedda , then I will wait for the stable releases for both firmware and z2m

@877dev
Copy link

877dev commented Dec 3, 2022

This change made the z2m stable release this month. Are there instructions for setting the transmit power?
Can it be done dynamically via a MQTT message or does it need to go in configuration.yaml and restart z2m each time?
Thanks for any info!

@Shamshala
Copy link

Shamshala commented Dec 3, 2022

@877dev Last time I've checked it was already implemented in 1.28.4-1 (the latest stable release). Just check the device's Exposes section and there is the transmit_power slider.

@877dev
Copy link

877dev commented Dec 3, 2022

@Shamshala i don’t use HA, I wonder if there is a similar option in Z2M frontend interface.
But it sounds like it can be altered dynamically which is great 👍

@Shamshala
Copy link

@877dev Exposes is within the z2m frontend 😉

@Smandurlo
Copy link

Smandurlo commented Dec 3, 2022 via email

@877dev
Copy link

877dev commented Dec 3, 2022

You cannot use Flash Programmer 2. Here is how I flashed mine recently, I wrote a little guide.:

https://pastebin.com/i8akGRCy

@Smandurlo
Copy link

Smandurlo commented Dec 3, 2022 via email

@877dev
Copy link

877dev commented Dec 4, 2022

I am seeing the option to alter transmit power for the zzh routers within 'exposes':
image
image

But the zzh coordinator does not show in that list as of course it's not a device. So my original question remains, can coordinator transmit power be changed dynamically (either via front end or MQTT message), or does it need to go in configuration.yaml as per below @Koenkk comment and restart z2m each time?

#341 (comment)

@Hedda
Copy link
Contributor Author

Hedda commented Dec 4, 2022

@877dev transmit power for Zigbee Coordinator is off-topic here, this specific issue is only about Zigbee Router. Please start a Zigbee2MQTT issue or discussion for your questions regarding Zigbee Coordinator configuration -> https://github.com/Koenkk/zigbee2mqtt/discussions

Mephistofeles pushed a commit to Mephistofeles/zigbee-herdsman-converters that referenced this issue Dec 13, 2022
@Smandurlo
Copy link

I have a silly problem. I have 2 sonoff zigbee stick as router. I tried the router dev firmware: 1 stick +20dB ok, the other one doesn't accept the setting.
I tried the 6.10.01.01 and again, the first stick is ok with +20dB, the other one no:

Publish 'set' 'transmit_power' to '0x00124b0024c0af49' failed: 'Error: Write 0x00124b0024c0af49/242 genBasic({"4919":{"value":20,"type":40}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 38967 - 242 - 100 - 0 - 4 after 10000ms)'

Any idea?

@xekil
Copy link

xekil commented Jan 7, 2023

Same Problème, help please :)

@s0ftice
Copy link

s0ftice commented Feb 3, 2023

Same issue. I have 4 routers (all CC2652P - SONOFF Dongle-P) and around the Z2M 1.28.4 upgrade (early December), my 4th router suddenly started dropping connected devices. But not sure whether that was related to the Z2M upgrade. Anyways, I upgraded all router firmwares to 20221102 (by the way Z2M still shows 20220125 for two of them, even after re-pairing, seems to be a display bug).

Now, with all 4 routers on firmware on 20221102 and Z2M on 1.30.0 in the meanwhile, I am able to change the transmit_power (thanks for that!! @Koenkk), but my 4th router that was dropping connected devices also does not accept changing its transmit_power with the same error as @Smandurlo above. Simply times out after 10 seconds.
Same behaviour with the router close to the coordinator (LQI ~200).

I thought it's a hardware issue and ordered a replacement dongle. Upgraded to 20221102, but exactly the same issue.

Reading the report above and jumping to conclusions, seems to be an issue with people having more than one CC2652P...?

Any ideas? Thanks!

@xekil
Copy link

xekil commented Feb 3, 2023

@s0ftice i only have one such dongle and i have the same problem

@Smandurlo
Copy link

Smandurlo commented Feb 6, 2023

Same issue. I have 4 routers (all CC2652P - SONOFF Dongle-P) and around the Z2M 1.28.4 upgrade (early December), my 4th router suddenly started dropping connected devices.
[cut]
Reading the report above and jumping to conclusions, seems to be an issue with people having more than one CC2652P...?

Any ideas? Thanks!

I think I've narrowed down the problem: it is not a problem "more than one", but "of the last added router"!!!

The second router didn't want to update the transmit power: timeout error. Today I added a 3rd router: now the second router updates the transmit power and the 3rd doesn't with the transmit power timeout error.

Lastest master firmware for the coordinator and dev for the routers.

It looks similar to the +1 dBm transmit power bug :-D

BTW: the last router drops the connection. Same exactly settings, but it goes offline and I cannot make it returns online unless I hit the reconfigure button. Unplug and plug it back doesn't solve it, still offline.

@Hedda
Copy link
Contributor Author

Hedda commented Feb 7, 2023

@Smandurlo best is probably if you open a new ”bug” issue for tracking that issues as @Koenkk might miss it here since this ”feature request” issue as it is already closed.

@Smandurlo
Copy link

@Hedda thanks for your suggestion. It is already open (Koenkk/zigbee2mqtt#15912), but it didn't get any feedback from @Koenkk. Anyway, I will try to update my previous post. Thanks.

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

No branches or pull requests