Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By Rover
#32728 Thank you for your great work!

I'm strongly need operate the radio TX power under Arduino IDE like command AT+RFPOWER in the AT firmware v.25
The reason is short-range communication with prevention of excessive RF radiation around and save the battery power. Also, it will be usefull during development "on the table".
As I think many another developers need to have the same function in ESP8266 library.

Would you add this task to github?
User avatar
By Cap
#44579 Hello... have you tried the solution and does it work? I am invoking system_phy_set_max_tpw but don't see a difference in power detected by other wifi clients. I have tried providing values of 0, 1, 81, and 82, to see some change, but the clients seem to see full tx power.
User avatar
By Rover
#44583 Yes, i have used this solution for my little project, the WiFi module for remote control of Xiaomi Yi camera on quadcopter using RC PWM channel http://forum.rcdesign.ru/blogs/7830/blog20971.html. The reason is minimize the power of ESP to prevent interference for RC onboard receiver.

For ESP-09 module connection established only in 0.9 - 1 meter distance if 0 power, but for 85 power distance was bigger than 10 m. So, this is visible difference. Also the power consumption was different too.

This code works fine in my case:

Code: Select all#include <ESP8266WiFi.h>
// Connect the original libs of Expressiff SDK 1.4.0
#ifdef ESP8266
extern "C" {
#include "ets_sys.h"
#include "os_type.h"
#include "osapi.h"
#include "mem.h"
#include "user_interface.h"
#include "cont.h"
}
#endif

#define WIFI_TX_POWER 0 // TX power of ESP module (0 -> 0.25dBm) (0...85)

void setup() {
#ifdef ESP8266
  system_phy_set_max_tpw(WIFI_TX_POWER); //set as lower TX power as possible
#endif
}


Full source code you can download here: https://drive.google.com/open?id=0B6fd8HhaRRWTQkY1alB6RnB6TE0