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

[REQUEST] Allow strength of "TX Power" configuration for modules with Power Amplifier (PA) #33

Open
Hedda opened this issue Apr 14, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Hedda
Copy link
Contributor

Hedda commented Apr 14, 2020

Please consider allowing setting "TX power" (TX PWR) on radio modules with Power Amplifier (PA).

Backstory: Some if not all TI CC radio modules feature integrated or external Power Amplifier (PA), a powered RF-amplification frontend, and the amp power that goes to that RF-amplifier should be controllable via software via a configuration setting. All however also have a default setting which is always automatically used if no custom setting is asked for.

For example; the default TX power (TX_PWR) for the CC1352P and CC2652P is 5 dBm, however, these chips support up to a max of 19 dBm (though technical specification says 20 dBm), if you allow the user to control this then they could potentially get better reception if the power to amplification is increased.

See Koenkk/zigbee2mqtt#2253 from Koenkk of Zigbee2mqtt which the same idea and already implemented it as a proof-of-concept to allows setting the transmit power of the adapter for future versions which works for all adapters with Power Amplifiers, including CC2531, CC2530, CC1352P-2 and CC26X2R1, (in his POC allowed values are -22 dBm as the min to 19 dBm as the max, default is 0 except for the CC2530 + CC2591 = 4 and CC2530 + CC2592 = 19).

TI CC modules/chips which features an integrated or external RF-amplifier (PA/LNA) as I understand:

  • CC1352P ("P" is for integrated Power Amplifier), example: LAUNCHXL-CC1352P
  • CC2652P ("P" is for integrated Power Amplifier)
  • CC2530 + CC2591 (where CC2591 is an external Power Amplifier chip)
  • CC2530 + CC2592 (where CC2592 is an external Power Amplifier chip)
  • CC2538 + CC2591 (where CC2591 is an external Power Amplifier chip)
  • CC2538 + CC2592 (where CC2592 is an external Power Amplifier chip)

PS: As I understand, the chips have their maximum dBm hardcoded within safe limits so that there is no way to destroy the HW through these settings. It is just that depending on the frequency band, too high dBm values may not be legal outdoors and/or indoors depending on your country regulations, and therefore TI has set a low default value so that it is legal in all countries if one does not increase the values.

@Hedda
Copy link
Contributor Author

Hedda commented Apr 14, 2020

https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/443496

https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/523553

The dBm TX power optional values are those mentioned on Table 4.6 in http://www.ti.com.cn/cn/lit/an/swra308a/swra308a.pdf

In the course of my further research I came across an interesting hint within the TI Forum, where an "undocumented" interface of the ZNP is pointed out:

https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/443496/1593040#1593040

If you use ZNP, you can use the undocumented MT_SYS_STACK_TUNE command to the ZNP with the data for setting the Tx transmit power. It is an SREQ with 2 bytes of data, so

02 21 0F 00 XX where:

02 = 2 bytes of data

21 = SREQ + MT_RPC_SYS_SYS

0F = MT_SYS_STACK_TUNE

00 = STK_TX_PWR

XX = a valid power setting from ZMAC.h:

typedef enum
{
TX_PWR_MINUS_22 = -22,
TX_PWR_MINUS_21,
TX_PWR_MINUS_20,
TX_PWR_MINUS_19,
TX_PWR_MINUS_18,
TX_PWR_MINUS_17,
TX_PWR_MINUS_16,
TX_PWR_MINUS_15,
TX_PWR_MINUS_14,
TX_PWR_MINUS_13,
TX_PWR_MINUS_12,
TX_PWR_MINUS_11,
TX_PWR_MINUS_10,
TX_PWR_MINUS_9,
TX_PWR_MINUS_8,
TX_PWR_MINUS_7,
TX_PWR_MINUS_6,
TX_PWR_MINUS_5,
TX_PWR_MINUS_4,
TX_PWR_MINUS_3,
TX_PWR_MINUS_2,
TX_PWR_MINUS_1,
TX_PWR_ZERO,
TX_PWR_PLUS_1,
TX_PWR_PLUS_2,
TX_PWR_PLUS_3,
TX_PWR_PLUS_4,
TX_PWR_PLUS_5,
TX_PWR_PLUS_6,
TX_PWR_PLUS_7,
TX_PWR_PLUS_8,
TX_PWR_PLUS_9,
TX_PWR_PLUS_10,
TX_PWR_PLUS_11,
TX_PWR_PLUS_12,
TX_PWR_PLUS_13,
TX_PWR_PLUS_14,
TX_PWR_PLUS_15,
TX_PWR_PLUS_16,
TX_PWR_PLUS_17,
TX_PWR_PLUS_18,
TX_PWR_PLUS_19
} ZMacTransmitPower_t; // The transmit power in units of -1 dBm.

@Hedda Hedda changed the title [REQUEST] Allow setting TX power on modules with built-in Power Amplifier (PA/LNA) frontend Apr 15, 2020
@Hedda
Copy link
Contributor Author

Hedda commented Apr 15, 2020

@sanyatuning FYI, apparently @puddly has already enabled "TXPower" settings in 3f6968d for zigpy-znp:

zigpy/zigpy-znp@3f6968d

@sanyatuning sanyatuning added the enhancement New feature or request label May 3, 2020
@Hedda
Copy link
Contributor Author

Hedda commented May 13, 2020

Any more thought on allowing configuration of TX Power strength for modules with Power Amplifier?

As per zigpy/zigpy#381 radio schema config extension, which is also same for zigpy-znp radio library:

zigpy/zigpy-znp#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants