-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I (12340306) slave_ctrl: ESP32 station is not connected with AP, can't get AP config #517
Comments
Please attach full textual logs. Also attach the sdkconfig both sides. Did you connect resetpin and other two mandatory pins in between host and slave, as per documentation? |
Thanks for your reply.I followed the instructions for the SPI connection, and there was no problem with the WiFi communication under normal circumstances. When I was debugging the host, I suspected that a large amount of data in the module was not processed normally, causing the slave module to be abnormal. Even after the host resumed normal operation, the slave connected to wifi again, but the wifi could not be connected. Tomorrow,I will extract the complete log |
Test process: The slave completes a normal communication interaction process, then disconnects the WiFi connection. The second interruption occurs after the host LWIP-ACept. After the slave connects to the WiFi, communication continues to send messages, but the host does not process ESP32 module data. At the end of the log, it can be seen that the slave scans the AP again, then connects to the host AP, but can no longer connect. |
After debugging multiple times, it was found that the slave ESP32 had automatically disconnected from the WiFi connection, but the MCU did not detect it. The MCU sent another message to disconnect the WiFi, but the WiFi disconnection failed. The WiFi control state machine was still in the connected state, resulting in an abnormal situation where the WiFi was not reconnected.I haven't figured out the ESPHosted protocol stack yet. Is there any API that can automatically detect WiFi connection status? |
If the wifi is disconnected manually? it would disconnect. if you get ap info, also, would fail, as you need to connect to ap first. May we get to see the script you use at host? There are two ways to trigger control request, (a) sync (b) async You can hook your own connect here . Just make sure you use test_station_mode_connect() with async in event callback. For non-event callback, please rely on 'sync' connect_ap(). sync versionint test_station_mode_connect_sync(void)
{
/* implemented SYNC */
ctrl_cmd_t req = CTRL_CMD_DEFAULT_REQ();
ctrl_cmd_t *resp = NULL;
printf("Connect to AP[%s]", STATION_MODE_SSID);
strcpy((char *)&req.u.wifi_ap_config.ssid, STATION_MODE_SSID);
strcpy((char *)&req.u.wifi_ap_config.pwd, STATION_MODE_PWD);
strcpy((char *)&req.u.wifi_ap_config.bssid, STATION_MODE_BSSID);
req.u.wifi_ap_config.is_wpa3_supported = STATION_MODE_IS_WPA3_SUPPORTED;
req.u.wifi_ap_config.listen_interval = STATION_MODE_LISTEN_INTERVAL;
req.u.wifi_ap_config.band_mode = STATION_BAND_MODE;
/* DO NOT register callback for handling synch reply */
resp = wifi_connect_ap(req);
return ctrl_app_resp_callback(resp);
} async versionint test_station_mode_connect(void)
{
/* implemented Asynchronous */
ctrl_cmd_t req = CTRL_CMD_DEFAULT_REQ();
printf("Connect to AP[%s]", STATION_MODE_SSID);
strcpy((char *)&req.u.wifi_ap_config.ssid, STATION_MODE_SSID);
strcpy((char *)&req.u.wifi_ap_config.pwd, STATION_MODE_PWD);
strcpy((char *)&req.u.wifi_ap_config.bssid, STATION_MODE_BSSID);
req.u.wifi_ap_config.is_wpa3_supported = STATION_MODE_IS_WPA3_SUPPORTED;
req.u.wifi_ap_config.listen_interval = STATION_MODE_LISTEN_INTERVAL;
req.u.wifi_ap_config.band_mode = STATION_BAND_MODE;
/* register callback for handling asynch reply */
req.ctrl_resp_cb = ctrl_app_resp_callback;
wifi_connect_ap(req);
return SUCCESS;
} async procedure triggers request but do not wait for response and returns control to caller immediately. In general, use 'sync' way for normal operations. You might need to use sync here: For event handler, only async is supported as if now. |
Checklist
How often does this bug occurs?
always
Expected behavior
I use two ARM Crotex-m4 MCU main control boards and ESP32C3 as the WiFi communication module.The main control board operates in AP mode, while the slave board operates in STA mode.When I debugged the main control board, the slave connected and sent a large number of communication messages, but eventually reported a communication interruption fault and disconnected the WiFi connection.Let the host main control normally again, clear the slave fault, and connect to the AP again, but it will never connect again.
Actual behavior (suspected bug)
When I reset the slave esp32c3 module and reconnected to the main control AP for communication, the communication became normal
Error logs or terminal output
Steps to reproduce the behavior
1.The ESP32 AP module on the main control end disconnects SPI communication, and the slave continues to send messages for about 2 minutes after connecting.
2.The ESP32 AP module on the main control was connected to SPI communication, and the slave machine was connected to AP communication again. Despite repeated connections, it did not connect
Project release version
master
System architecture
other (details in Additional context)
Operating system
Linux
Operating system version
RTThread RTOS
Shell
other (details in Additional context)
Additional context
I used RTThread RTOS and ported the ESP hosted FG driver.
The text was updated successfully, but these errors were encountered: