diff --git a/README.md b/README.md index 4c01493..d667db0 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Most of the set-commands are effective only after save and reset. - portmap add [TCP|UDP] _external_port_ _internal_ip_ _internal_port_: adds a port forwarding - portmap remove [TCP|UDP] _external_port_: deletes a port forwarding - nslookup _name_: starts a DNS lookup for the given name and displays the result -- ping _ip-addr_: checks IP connectivity with ICMP echo request/reply +- ping _host_: checks IP connectivity with ICMP echo request/reply (host as IP address or DNS name) ### Firewall/Monitor Config - acl [from_sta|to_sta] [TCP|UDP|IP] _src-ip_ [_src_port_] _desr-ip_ [_dest_port_] [allow|deny|allow_monitor|deny_monitor]: adds a new rule to the ACL diff --git a/firmware/0x02000.bin b/firmware/0x02000.bin index 2b1d7b7..cbf3f55 100644 Binary files a/firmware/0x02000.bin and b/firmware/0x02000.bin differ diff --git a/firmware/0x82000.bin b/firmware/0x82000.bin index e938599..fd68731 100644 Binary files a/firmware/0x82000.bin and b/firmware/0x82000.bin differ diff --git a/firmware/sha1sums b/firmware/sha1sums index 386025f..af238f0 100644 --- a/firmware/sha1sums +++ b/firmware/sha1sums @@ -1,3 +1,3 @@ -89709d6484a66253d3159f2740da338337805e0f firmware/0x02000.bin -04fdebd28ce94542519c08a4f94bec262ff343c6 firmware/0x82000.bin +83db266f74801f2d9236314c6beccb0cd2c085c9 firmware/0x02000.bin +37cc650900e4df9fa368f84a2b49f8d0dc986e59 firmware/0x82000.bin 9bd7d25204d71b3db5f35e0b2def8a6aaa7f765c firmware/0x00000.bin diff --git a/user/user_config.h b/user/user_config.h index afb1c58..acb0d45 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.3" +#define ESP_REPEATER_VERSION "V2.2.4" #define LOCAL_ACCESS 0x01 #define REMOTE_ACCESS 0x02 diff --git a/user/user_main.c b/user/user_main.c index 057e726..e59fd0d 100644 --- a/user/user_main.c +++ b/user/user_main.c @@ -278,11 +278,11 @@ void ICACHE_FLASH_ATTR user_ping_sent(void *arg, void *pdata) system_os_post(0, SIG_CONSOLE_TX, (ETSParam) currentconn); } -void ICACHE_FLASH_ATTR user_do_ping(uint32_t ipaddr) +void ICACHE_FLASH_ATTR user_do_ping(const char *name, ip_addr_t *ipaddr, void *arg) { ping_opt.count = 4; // try to ping how many times ping_opt.coarse_time = 2; // ping interval - ping_opt.ip = ipaddr; + ping_opt.ip = ipaddr->addr; ping_success_count = 0; ping_regist_recv(&ping_opt,user_ping_recv); @@ -1654,7 +1654,6 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn) os_sprintf(response, INVALID_NUMARGS); goto command_handled; } - to_console("\r\n"); uint32_t result = espconn_gethostbyname(NULL, tokens[1], &resolve_ip, dns_resolved); if (result == ESPCONN_OK) { os_sprintf(response, "DNS lookup for %s: " IPSTR "\r\n", tokens[1], IP2STR(&resolve_ip)); @@ -1682,9 +1681,14 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn) os_sprintf(response, INVALID_NUMARGS); goto command_handled; } - to_console("\r\n"); currentconn = pespconn; - user_do_ping(ipaddr_addr(tokens[1])); + uint32_t result = espconn_gethostbyname(NULL, tokens[1], &resolve_ip, user_do_ping); + if (result == ESPCONN_OK) { + ip_addr_t ip; + ip.addr = ipaddr_addr(tokens[1]); + user_do_ping(tokens[1], &ip, NULL); + } + //user_do_ping(ipaddr_addr(tokens[1])); return; } #endif