-
Notifications
You must be signed in to change notification settings - Fork 64
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
Stops working after a while #18
Comments
I had the same issue, in static void event_handler(void* arg, esp_event_base_t event_base,
int32_t event_id, void* event_data)
{
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
esp_wifi_connect();
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
ESP_LOGI(TAG, "Reconnecting");
esp_wifi_connect();
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
}
} |
Hello,
I just updated |
In the original example event handler removed after connection established:
event handler with |
Thanks @izmmisha I modified this function. |
@izmmisha , that version retries the initial connection but doesn’t handle disconnects that happen later. If WiFi drops later you have to call You can read more about the WiFi events in the esp docs, https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#wifi-event-sta-disconnected Edit: sorry, I’m responding from my phone in the middle of the night and missed that there are two commenters here. I think we’re saying the same thing. |
The code in app_wifi.c was taken from the esp idf Wi-Fi station example. Ofcourse, the logic of trying just 5 times at the beginning and also unsubscribing from the events on a successful connection made no sense here. I have changed that behaviour now.
|
Thanks @shahpiyushv !
|
I have a similar issue in my library Yurik72/ESPHap#34 esp_wifi_set_ps(WIFI_PS_NONE); I my case after that changes device work well with the Apple |
Thanks, using "WIFI_PS_NONE" definitely helps to some extent - I have to monitor it for longer times to see if the issue is resolved completely. |
Hello as I am having the same issue as @g-mocken I would like to ask for some advice. I am currently utilising the dual stack capabilities for esp32. Meaning I use wifi+ble for a project of mine. According to Espressif documentation setting WIFI_PS_NONE is impossible when using the dual stack environment. Is there anything else that can be done to correct this issue? |
I frequently see the homekit device becoming unresponsive. I managed to capture the precise moment in the terminal:
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:input closed
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:closing
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:closing security context
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] Closing HAP session.
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:Session] HAPSessionRelease
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:Session] HAPSessionInvalidate
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:closing TCP stream
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Platform:TCPStreamManager] shutdown(51, SHUT_RDWR);
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Platform:TCPStreamManager] close(51);
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:closed
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffb9d20:releasing session
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffba078:input closed
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffba078:closing
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] session:0x3ffba078:closing security context
1970-01-01'T'01:28:47'Z' Debug [com.apple.mfi.HomeKit.Core:IPAccessoryServer] Closing HAP session.
What is happening? Sometimes, it comes back to live on its own later, but not always.
The text was updated successfully, but these errors were encountered: