Skip to content
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

Device often offline #479

Open
chemelli74 opened this issue Oct 12, 2024 · 8 comments
Open

Device often offline #479

chemelli74 opened this issue Oct 12, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@chemelli74
Copy link

Hardware

ESP32

Firmware version

v2.4.6

Application version

v2.4.6

What happened? What did you expect to happen?

I often find the device offline; wifi connection is not re-established so I bet it somehow crash or have a memory leak or similar.

Can you suggest a way to properly investigate what happens ?

How to reproduce it (step by step)

1. Connect to network
2. Wait a 4/5 days

Logs

No response

@chemelli74 chemelli74 added the bug Something isn't working label Oct 12, 2024
@UsefulVid
Copy link

I have the same problem since I use ESPSomfy.
Maybe related to this:
#453
I will try to gather some logs.

@UsefulVid
Copy link

UsefulVid commented Oct 17, 2024

Logs collected

Radio Pins Configured!
[11:25:06]Successfully set up the radio
[11:25:06]Enabled receive on Pin #12 Timing: 1
Initializing RX Queue
11:25:10 Completed scan for access points (1)
Connecting to AP 60:B5:8D:07:A3:30 CH: 6
WiFi begin...
[11:25:27]Timi��r��: 108ms
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
[11:25:28]Memory dump at 0x40113bfc: 000000ff 2100613e fb7cf00b
[11:25:28]Core 1 register dump:
[11:25:28]PC : 0x40113c00 PS : 0x00060b30 A0 : 0x80107990 A1 : 0x3ffb2270
[11:25:28]A2 : 0x3ffcdb5c A3 : 0x3ffcdb50 A4 : 0x00000000 A5 : 0x00000004
[11:25:28]A6 : 0x3ffb8188 A7 : 0x80000001 A8 : 0x800e5f54 A9 : 0x3ffb2250
[11:25:28]A10 : 0x00000000 A11 : 0x3ffcdb5c A12 : 0x3ffcd2d0 A13 : 0x000000ff
[11:25:28]A14 : 0x00000003 A15 : 0x00060023 SAR : 0x0000000a EXCCAUSE: 0x00000000
[11:25:28]EXCVADDR: 0x00000000 LBEG : 0x40085e99 LEND : 0x40085ea1 LCOUNT : 0x00000027
[11:25:28]
[11:25:28]
[11:25:28]Backtrace: 0x40113bfd:0x3ffb2270 0x4010798d:0x3ffb2290
[11:25:28]
[11:25:28]
[11:25:28]
[11:25:28]
[11:25:28]ELF file SHA256: f81fd5f3694043bf
[11:25:28]
[11:25:28]Rebooting...
[11:25:28]ets Jun 8 2016 00:22:57

@chemelli74
Copy link
Author

Thx for collecting the log, I bet I have a similar issue even if so far I was not yet able to gather it.

@rstrouse
Copy link
Owner

Which ESP32 do you have? This log seems to indicate that initializing the wifi chip. Can you check your router logs to see if the connection refused to issue an IP address. Somewhere between the time it initialized the Wifi and the network response the (~7seconds) the connection dropped but the wifi library appears to have corrupted the code segment. Consequently, this is also the response time for the watchdog timer to reset but 7 seconds is a crazy long time for a connection to handshake with your AP.

The reset should have reconnected on startup though unless it is sending it into the same sequence for connection.

@chemelli74
Copy link
Author

@rstrouse, is there a way to retrieve logs remotely ?
I would like to capture them all the time so when something happens I may have a clue if it's the same issue as reported by @UsefulVid or not.

@rstrouse
Copy link
Owner

Unfortunately at this time I do not know of a solution that does not require creating code to send the logs over http. There are libraries that do this but they are not really compatible with the receive portion of the code and eat up way too much space. When I get some time I may look into creating something over the socket that ties to the serial output.

@chemelli74
Copy link
Author

This is the log form today, is still working for the moment but I see 2 strange values:

[19:44:32]Max Heap: 102388
[19:44:32]Free Heap: 149552
[19:44:32]Min Heap: 135272

vs

Max Heap: 65524
[19:45:00]Free Heap: 152348
[19:45:00]Min Heap: 100296

Shouldn't Max and Min be always similar if not the same ?

Full log:

[19:44:32]Max Heap: 102388
[19:44:32]Free Heap: 149552
[19:44:32]Min Heap: 135272
[19:44:34]Check github for updates...
[19:44:34]Max Heap: 110580
[19:44:34]Free Heap: 155448
[19:44:34]Min Heap: 135272
[19:44:38]Internet is Available: 1853ms
[HTTPS] GET... code: 200
[HTTPS] GET... code: 200 - -1
Max Heap: 65524
[19:44:38]Free Heap: 151308
[19:44:38]Min Heap: 100296
[19:45:00]Client 1 joining room 0
Timing WebServer: 3867ms
[19:45:00]Timing WebServer: 242ms
Socket [1] Disconnected!
Socket [1] Connected from 192.168.1.72 url: /
Initializing Socket Client 1
Max Heap: 65524
[19:45:00]Free Heap: 152348
[19:45:00]Min Heap: 100296

@rstrouse
Copy link
Owner

No those values represent different aspects of the heap. The max heap value is the maximum contiguous allocation space without fragments. The min heap is the lowest threshold memory reached. And the free heap is the total available memory.

The latter two values represent all blocks of memory. Min, max, and free are used for different purposes. For instance, if free memory continues to steadily drop over time then this is an indication of a memory leak. I max memory tends to drop over time then this indicates fragmentation and inefficiency on the memory use. Keep in mind the Wi-Fi and http client libraries will allocate memory and only free it periodically to maintain performance. This creates some level of fragmentation that should recover over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants