@@ -44,13 +44,17 @@ void supervisor_web_workflow_status(void) {
44
44
serial_write_compressed (translate ("Wi-Fi: " ));
45
45
if (common_hal_wifi_radio_get_enabled (& common_hal_wifi_radio_obj )) {
46
46
uint32_t ipv4_address = wifi_radio_get_ipv4_address (& common_hal_wifi_radio_obj );
47
- if (wifi_status != WIFI_RADIO_ERROR_NONE ) {
47
+ if (wifi_status == WIFI_RADIO_ERROR_AUTH_EXPIRE ||
48
+ wifi_status == WIFI_RADIO_ERROR_AUTH_FAIL ) {
49
+ serial_write_compressed (translate ("Authentication failure" ));
50
+ } else if (wifi_status != WIFI_RADIO_ERROR_NONE ) {
48
51
mp_printf (& mp_plat_print , "%d" , wifi_status );
49
52
} else if (ipv4_address == 0 ) {
50
53
serial_write_compressed (translate ("No IP" ));
51
54
} else {
52
55
uint8_t * octets = (uint8_t * )& ipv4_address ;
53
56
mp_printf (& mp_plat_print , "%d.%d.%d.%d" , octets [0 ], octets [1 ], octets [2 ], octets [3 ]);
57
+ // TODO: Use these unicode to show signal strength: ▂▄▆█
54
58
}
55
59
} else {
56
60
serial_write_compressed (translate ("off" ));
@@ -75,12 +79,15 @@ void supervisor_start_web_workflow(void) {
75
79
common_hal_wifi_init (false);
76
80
common_hal_wifi_radio_set_enabled (& common_hal_wifi_radio_obj , true);
77
81
82
+ // TODO: Do our own scan so that we can find the channel we want before calling connect.
83
+ // Otherwise, connect will do a full slow scan to pick the best AP.
84
+
78
85
// NUL terminate the strings because dotenv doesn't.
79
86
ssid [ssid_len ] = '\0' ;
80
87
password [password_len ] = '\0' ;
81
88
wifi_status = common_hal_wifi_radio_connect (
82
89
& common_hal_wifi_radio_obj , (uint8_t * )ssid , ssid_len , (uint8_t * )password , password_len ,
83
- 0 , 1 , NULL , 0 );
90
+ 0 , 0. 1 , NULL , 0 );
84
91
85
92
if (wifi_status != WIFI_RADIO_ERROR_NONE ) {
86
93
common_hal_wifi_radio_set_enabled (& common_hal_wifi_radio_obj , false);
0 commit comments