-
Notifications
You must be signed in to change notification settings - Fork 192
JSON Parsing Causes Dynamic Page Woes #500
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
Comments
@DropTarget Thank you for your suggestion. It seems that you have discovered the hidden degradation caused by AutoConnect enhancement. My lack of consideration caused it. To make matters worse, an The current AutoConnectText HTML element generation conditions are as follows, but I would like to determine a more consistent specification through this topic.
My candidate spec would be to generate an element with an
These HTML are generated in a fixed manner, regardless of whether EDIT |
@Hieromon |
@Hieromon Thanks EDIT: Further investigation reveals that the delay in mDNS is not caused by ESP32. In fact, the ESP32 immediately responds to the mDNS broadcast on the local network. The delay appears to be in Windows 10, due to use of a VPN tunnel. mDNS brodcasts are routed through the tunnel as well as on the local network. This seems to cause a delay of about 10 seconds before Windows acts on the response - probably a timeout waiting for a response from the VPN tunnel. Disconnecting the VPN results in normal mDNS operation. |
@Hieromon |
@Hieromon |
@DropTarget Thank you for your testing.
That's exactly. It is my careless mistake. I'm aware of that but I'm working on changing the HTML generation logic from the current approach of concatenating String classes to one based on syntax templates. It will reduce the flashed size of the compiled bin. I should be able to stage the fix into the enhance/v135 branch within a few days. Also, the fix of the OTA Update script that |
@DropTarget I have brushed up the fix to an appreciable and I think you can give it a try on enhance/v135 branch. There may still be minor bugs lurking. If you find it I would be of great help. Also, thank you for the heads-up on the mDNS issue. I have not yet fully examined the information you provided. I will start working on it and will let you know if anything turns up. |
Closed due to the release of v1.3.5 |
I've been struggling to get a dynamic page operating correctly and finally found the root cause of my problem. The "Communicate with the Sketch using XHR" section of the documentation shows a simple example of updating a time display on the client web page. However, when using the example as written, the JSON parser creates HTML without an ID for the 'time' element. I now realize that this is probably due to the issue described in the note "AutoConnect JSON parsing process is not perfect" in the "Custom Web pages with JSON" section. I was able to determine that no ID was created by using inspection mode in the browser. Simply adding a "style" attribute to the 'time' element causes the JSON parser to create an ID and the script works properly.
I was wondering if there might be a way to make this more clear so that others don't encounter the same issue and need to go through a debug process to figure it out. Would it be possible to add a directive that would tell the JSON parser not to optimize? Maybe this already exists and I'm not aware of it.
Thanks again for a great library.
The text was updated successfully, but these errors were encountered: