Skip to content

Commit

Permalink
better AP IP, reenable AP
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ger committed Jan 12, 2018
1 parent 3f5479f commit 0f06342
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Binary file modified firmware/0x00000.bin
Binary file not shown.
Binary file modified firmware/0x10000.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions firmware/sha1sums
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
e437a3f6ec07520aeb791e0fb70287ff1794bc81 0x00000.bin
f2a3fb9a65c4b0dc6b6e5e85a11efb8496153e03 0x10000.bin
533d30838d37938b97e47609f0ec9c96e325ebe8 0x00000.bin
cb58e58d520ed554de223dd601d5b806d78c45a3 0x10000.bin
8 changes: 7 additions & 1 deletion user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,7 @@ void wifi_handle_event_cb(System_Event_t *evt)
if (config.automesh_mode == AUTOMESH_OPERATIONAL) {
if (evt->event_info.disconnected.reason != 201) {
wifi_set_opmode(STATION_MODE);
os_printf(">>> Disable AP\r\n");
}

config.automesh_tries++;
Expand Down Expand Up @@ -2205,6 +2206,11 @@ void wifi_handle_event_cb(System_Event_t *evt)
}
}

if (config.automesh_mode != AUTOMESH_OFF) {
wifi_set_opmode(STATIONAP_MODE);
os_printf(">>> Enable AP\r\n");
}

#ifdef MQTT_CLIENT
if (mqtt_enabled) MQTT_Connect(&mqttClient);
#endif /* MQTT_CLIENT */
Expand Down Expand Up @@ -2437,7 +2443,7 @@ void ICACHE_FLASH_ATTR automesh_scan_done(void *arg, STATUS status)
config.AP_MAC_address[4] = RANDOM_REG & 0xff;
config.AP_MAC_address[5] = RANDOM_REG & 0xff;

IP4_ADDR(&config.network_addr, 10, 24, mesh_level, 1);
IP4_ADDR(&config.network_addr, 10, 24, mesh_level+1, 1);

config.automesh_mode = AUTOMESH_OPERATIONAL;
config.automesh_tries = 0;
Expand Down

0 comments on commit 0f06342

Please sign in to comment.