Skip to content

Commit

Permalink
Fix for #116, WebUI not working
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeio committed Jul 1, 2024
1 parent 01a6ef9 commit 6a9d515
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion main/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,7 @@ bool driver_init (void)
#else
hal.info = "ESP32";
#endif
hal.driver_version = "240418";
hal.driver_version = "240701";
hal.driver_url = GRBL_URL "/ESP32";
#ifdef BOARD_NAME
hal.board = BOARD_NAME;
Expand Down
21 changes: 12 additions & 9 deletions main/wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,12 @@ network_info_t *networking_get_info (void)
{
static network_info_t info;

memcpy(&info.status, &network, sizeof(network_settings_t));

uint8_t bmac[6];

if(esp_wifi_get_mac(ESP_IF_WIFI_STA, bmac) == ESP_OK)
strcpy(info.mac, networking_mac_to_string(bmac));
else
*info.mac = '\0';

ip4_addr_t *ip;

#if NETWORK_IPMODE_STATIC
memcpy(&info.status, &network, sizeof(network_settings_t));

#if NETWORK_IPMODE_STATIC
ip = (ip4_addr_t *)&wifi.sta.network.ip;
#else
ip = ap_list.ap_selected ? &ap_list.ip_addr : (ip4_addr_t *)&wifi.ap.network.ip;
Expand All @@ -210,6 +204,15 @@ network_info_t *networking_get_info (void)
else
*info.status.ip = '\0';

#if WIFI_SOFTAP
if(esp_read_mac(bmac, ESP_MAC_WIFI_SOFTAP) == ESP_OK) {
#else
if(esp_read_mac(bmac, ESP_MAC_WIFI_STA) == ESP_OK) {
#endif
strcpy(info.mac, networking_mac_to_string(bmac));
} else
*info.mac = '\0';

if(info.status.ip_mode == IpMode_DHCP) {
*info.status.gateway = '\0';
*info.status.mask = '\0';
Expand Down

0 comments on commit 6a9d515

Please sign in to comment.