Skip to content

Commit 638900d

Browse files
committed
Changed debug pin, fixed AP mode problem micropython#221
1 parent 2372a6b commit 638900d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ports/esp32/modnetwork.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
NORETURN void _esp_exceptions(esp_err_t e) {
5757
switch (e) {
58-
case ESP_ERR_WIFI_NOT_INIT:
58+
case ESP_ERR_WIFI_NOT_INIT:
5959
mp_raise_msg(&mp_type_OSError, "Wifi Not Initialized");
6060
case ESP_ERR_WIFI_NOT_STARTED:
6161
mp_raise_msg(&mp_type_OSError, "Wifi Not Started");
@@ -87,7 +87,7 @@ NORETURN void _esp_exceptions(esp_err_t e) {
8787
mp_raise_OSError(MP_ETIMEDOUT);
8888
case ESP_ERR_TCPIP_ADAPTER_NO_MEM:
8989
case ESP_ERR_WIFI_NO_MEM:
90-
mp_raise_OSError(MP_ENOMEM);
90+
mp_raise_OSError(MP_ENOMEM);
9191
default:
9292
nlr_raise(mp_obj_new_exception_msg_varg(
9393
&mp_type_RuntimeError, "Wifi Unknown Error 0x%04x", e
@@ -337,9 +337,12 @@ STATIC mp_obj_t esp_ifconfig(size_t n_args, const mp_obj_t *args) {
337337
wlan_if_obj_t *self = MP_OBJ_TO_PTR(args[0]);
338338
tcpip_adapter_ip_info_t info;
339339
tcpip_adapter_dns_info_t dns_info;
340-
tcpip_adapter_get_ip_info(self->if_id, &info);
341-
tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info);
340+
// tcpip_adapter_get_ip_info(self->if_id, &info);
341+
// tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info);
342342
if (n_args == 1) {
343+
tcpip_adapter_get_ip_info(self->if_id, &info);
344+
tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info);
345+
usleep(200000);
343346
// get
344347
mp_obj_t tuple[4] = {
345348
netutils_format_ipv4_addr((uint8_t*)&info.ip, NETUTILS_BIG),

ports/esp32/sdkconfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
#define CONFIG_CONSOLE_UART_CUSTOM_NUM 0
9797
#define CONFIG_CONSOLE_UART_NUM 0
9898
#define CONFIG_CONSOLE_UART_TX_GPIO 17
99-
#define CONFIG_CONSOLE_UART_RX_GPIO 5
99+
#define CONFIG_CONSOLE_UART_RX_GPIO 16
100100

101101
#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1
102102
#define CONFIG_LOG_BOOTLOADER_LEVEL_WARN 1

0 commit comments

Comments
 (0)