diff --git a/README.md b/README.md index 33e37e5..4466037 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,7 @@ Any part of a command line input after a single "#" until the end of the line wi ### Chip Config - set speed [80|160]: sets the CPU clock frequency (default 160 Mhz) +- set power [0-82]: sets the RF Tx power - sleep _seconds_: Put ESP into deep sleep for the specified amount of seconds. Valid values between 1 and 4294 (aprox. 71 minutes) - set status_led _GPIOno_: selects a GPIO pin for the status LED (default 2, >16 disabled) - set hw_reset _GPIOno_: selects a GPIO pin for a hardware factory reset (>16 disabled, default) diff --git a/user/user_config.h b/user/user_config.h index 79a8b9f..1cb4c9c 100644 --- a/user/user_config.h +++ b/user/user_config.h @@ -1,7 +1,7 @@ #ifndef _USER_CONFIG_ #define _USER_CONFIG_ -#define ESP_REPEATER_VERSION "V2.2.16" +#define ESP_REPEATER_VERSION "V2.2.17" #define LOCAL_ACCESS 0x01 #define REMOTE_ACCESS 0x02 diff --git a/user/user_main.c b/user/user_main.c index 8831c81..d3640a7 100644 --- a/user/user_main.c +++ b/user/user_main.c @@ -306,7 +306,7 @@ void ICACHE_FLASH_ATTR user_do_ping(const char *name, ip_addr_t *ipaddr, void *a os_sprintf(response, "DNS lookup failed for: %s\r\n", name); to_console(response); system_os_post(0, SIG_CONSOLE_TX, (ETSParam)currentconn); - return; + return; } ping_opt.count = 4; // try to ping how many times @@ -1224,7 +1224,7 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn) #endif os_sprintf_flash(response, "] \r\n"); to_console(response); - os_sprintf_flash(response, "set [speed|status_led|hw_reset|config_port|config_access|web_port] \r\nsave [config|dhcp]\r\nconnect|disconnect|reset [factory]|lock|unlock |quit\r\n"); + os_sprintf_flash(response, "set [speed|power|status_led|hw_reset|config_port|config_access|web_port] \r\nsave [config|dhcp]\r\nconnect|disconnect|reset [factory]|lock|unlock |quit\r\n"); to_console(response); os_sprintf_flash(response, "set [client_watchdog|ap_watchdog] \r\n"); to_console(response); @@ -2721,6 +2721,16 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn) goto command_handled; } + if (strcmp(tokens[1], "power") == 0) + { + uint16_t power = atoi(tokens[2]); + if (power > 82) + power = 82; + system_phy_set_max_tpw(power); + os_sprintf(response, "RF Tx Power updated %d\r\n", power); + goto command_handled; + } + if (strcmp(tokens[1], "status_led") == 0) { if (config.status_led <= 16)