adrien3d / IO_WSSFM10-Arduino

Arduino library for the WSSFM10 Sigfox Module
https://plugblocks.com
MIT License
6 stars 8 forks source link

Setting transmission power #5

Closed nimasaj closed 5 years ago

nimasaj commented 5 years ago

Could you please add support to adjust transmission power?

Description is available in pages 8 (table 7) and 12 (table 10) of datasheet. The output power of the AX−Sigfox can be programmed in 1 dB steps from 0 dBm – 14 dBm.

Datasheet: https://www.onsemi.com/pub/Collateral/AX-SIGFOX-D.PDF

Table 7:

Description Command Tx power
PTXmin Lowest Transmitter output power AT$CW=868130000,1,0 0 dBm
PTXmax Highest Transmitter output power AT$CW=868130000,1,14 14 dBm

Table 10:

Name Range Description
Frequency 800000000−999999999, 0 Continuous wave frequency in Hz. Use 868130000 for Sigfox or 0 to keep previous frequency
Mode 0, 1 Enable or disable carrier wave.
Power 0−14 dBm of signal | Default: 14
adrien3d commented 5 years ago

There is already a setPowerMode() function here. The function you are referring to is to set to continuous wave, only usefull in test mode.

nimasaj commented 5 years ago

setPowerMode() is used for power management of the module itself (to set it in standby, sleep or deep sleep mode). Is it possible to change transmission power of the module from 14 dBm to 12 dBm or less?

adrien3d commented 5 years ago

You are right. I don't think you can change the transmission power, it is by default at 14dBm

nimasaj commented 5 years ago

You can adjust radio output power with following command, based on table 11:

ATS302=12 // here 12 represents output power in dBm. By default it is set to 14 dBm

Command Function Description
ATSuint=uint Set Register Change a configuration register.
Register Name Description Default Range Units
302 Power Level The output power of the radio. Note: This setting is used for all TX modes except AT$CW. 14 0 - 14 dBm

Datasheet: https://www.onsemi.com/pub/Collateral/AX-SFEU-D.PDF

You can update the library to support transmission power as well.

adrien3d commented 5 years ago

Here you are: https://github.com/adrien3d/IO_WSSFM10-Arduino/commit/48c7f9fbb11ecabdc8cceaadbf81e3ea63f22570

nimasaj commented 5 years ago

I think you have to edit line 149 in IO_WSSFM10.cpp to change Sigfox.print(mode); to Sigfox.print(power);.

adrien3d commented 5 years ago

You were right, this is now fixed in https://github.com/adrien3d/IO_WSSFM10-Arduino/commit/c343b05925e36c57431b1c37b2d1912fd670b87c