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

Fix missing log entries in web #1652

Closed
proddy opened this issue Mar 9, 2024 · 6 comments
Closed

Fix missing log entries in web #1652

proddy opened this issue Mar 9, 2024 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@proddy
Copy link
Contributor

proddy commented Mar 9, 2024

There is a chance of log messages being skipped when displayed on the Web specially on slow networks.

MichaelDvP suggested the following:

"Maybe set a longer timeout (300-500ms) in EMS-ESP and post back the message-id on an event received. If the post is received in EMS-ESP, the next message-event can be sent immediately; otherwise, you can just repeat the message after a timeout. It could also help to pack all queued messages into one event as json-array, which reduces the number of events."

which is a perfect solution.

Originally posted by @MichaelDvP in #1611 (comment)

@proddy proddy added the enhancement New feature or request label Mar 9, 2024
@proddy proddy added this to the v3.7.0 milestone Mar 24, 2024
@proddy
Copy link
Contributor Author

proddy commented Mar 31, 2024

There was a bug in the React code, which I fixed in the 3.7.0-dev.1, where the EventStream could be initiated more than once when the web page is mounted, which could account for some messages getting lost. I'll see if this helps with this issue by slowing down the WiFi on a real ESP32 next,.

@proddy
Copy link
Contributor Author

proddy commented Mar 31, 2024

WebLogService.h had REFRESH_SYNC as 50, I changed to 30 and it may have caused #1611 missing logs, then it was changed to 80. I'll change it back to 30 and see if the fix in the web solves the sync issue.

If you compile with -DEMSESP_PINGTEST it will send a log message every 1/2 second, which i used for testing.

in 3.7.0-dev.2

@MichaelDvP
Copy link
Contributor

Wow, no missing logs with 30ms on my old notebook with compiler running in background. I think you can close the issue. Also no doubletts when removing the id checks.

@proddy
Copy link
Contributor Author

proddy commented Apr 2, 2024

Wow, no missing logs with 30ms on my old notebook with compiler running in background. I think you can close the issue. Also no doubletts when removing the id checks.

Great, I close this one then. Was a silly thing in how React renders the DOM on page rendering. Before it was easier with onMount().

@proddy proddy closed this as completed Apr 2, 2024
@MichaelDvP
Copy link
Contributor

I've also tested with wait-delay completly removed and buffer 100. Works good. Next i send all buffer messages at once (in one loop), works also, but maybe this blocks the main loop too long and it takes much memory for TCP buffering. Better leave it by one message per loop.

@proddy
Copy link
Contributor Author

proddy commented Sep 11, 2024

@MichaelDvP in 3.7.0-dev.36 I've removed the buffer delay after updating AsyncEventSource with this: mathieucarbou/ESPAsyncWebServer@0163e04

with Ping test enabled, and setting the browser to slow 3G network and high CPU throttle I'm not missing any incoming messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants