-
I seem to be having a problem, maybe a bug or a size limit, I'm not too sure. I don't think it's a limit on the actual size of the char itself, as I can make it pretty big with other text and various elements and it will still work. It's just it doesn't seem to like to many, or long ACSelects. One curious behavior is the SAME code works on a ESP32wrover module, but moving the code to a ESP32-C3 will cause this problem and apparent limit. I turned on debug on both autoconnect and pagebuilder. The only line about the alarm page is: Sample page code below, first one works with a limited number of select options in ALARMxMIN, second one that has more pulldown choices does not work on a ESP32-C3. Thank you! Regards, //// THIS IS WORKING WORKING const char PAGE_ALARM[] PROGMEM = R"( "},
] /// THIS IS NOT WORKING, DIFFERENCE IS ADDITIONAL VALUES in SETTING_ALARM1MIN const char PAGE_ALARM[] PROGMEM = R"( "},
] |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
@ghmpi Chopped code blocks like this are very hard to see. I can't reproduce the problem using this code. You're probably out of memory. Enable AC_DEBUG and PB_DEBUG for trace logging. If you see ArduinoJson deserialization errors or PageBuilder errors, the cause is there. Also, AutoConnect's JSON buffer size is defined in So, what's the point of your experiment? It's not clear what the point of the problem is. Move to Discussions. |
Beta Was this translation helpful? Give feedback.
-
Code upload |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. The posting interface is breaking up the pasted code, even when I encode it in code clocks.. I have uploaded it as a text file. I did enable the debug before.. and the only thing I could obviously see was.. But your memory and deserialization comments got me to go back to it and I found this where the I will look further into the buffer size. This is not an experiment. I'm trying to get this code working on a clock. My workaround so far has been to trim down the minute values to 5 minute increments (as seen in the sample code), so it's OK for now. But eventually I'm sure I'll need something similar and someone else will run into this scenario where they are hitting these limits as well. Thank you again. Regards, |
Beta Was this translation helpful? Give feedback.
-
I got it working! It was indeed running out of memory. Adding the following to AutoConnectDefs.h fixed it! #define AUTOCONNECT_JSONDOCUMENT_SIZE (16 * 1024) The devkitc board was working because AUTOCONNECT_JSONPSRAM_SIZE is defined larger then the regular AUTOCONNECT_JSONDOCUMENT_SIZE. (8 * 1024) on a regular board vs (16 * 1024) on boards with PSRAM. A suggestion.. if you can have the "[AC] Deserialize:NoMemory" text/error appear on the page that the error occurred.. /alarm in my case.. instead of just dropping the page, it would help the next poor soul a few hours of troubleshooting! Not sure how easy it would be to do. Thank you again @Hieromon , you have a neat project. Regards, |
Beta Was this translation helpful? Give feedback.
-
@ghmpi The procedure to take if you cannot see the custom web page is explained in the FAQ in the Documentation. It states that the first step is to validate the JSON syntax using ArduinoJson assistant. Then you enable AC_DEBUG and get the AC_DEBUG log trace. It is not so difficult to discover the NoMemory error log if you track the trace. At first, you should follow the procedure, which is the closest path to the cause. It will lead you to the NoMemory error and will reduce the time it takes to get to the solution beyond that. And this procedure is related to your following mention:
Unfortunately we cannot make it happen. Nevertheless, if you still want to detect and export JSON errors in the web page response, your own sketch implementation, knowing the existence of /alarm, will make this possible. AutoConnect portal;
void handleNotFound() {
WebServer& server = portal.host();
if (server.uri().endsWith("/alarm")) {
server.send("200", "text/plain", "/alarm not loaded, check JSON error");
}
else {
server.send(404);
}
}
portal.onNotFound(handleNotFound); A description of the onNotFound handler for AutoConnect can be found here. In this case, your report allowed us to post on this topic. In Issues, similar discussions tend to hide in the background after close. In Discussions, we will have the opportunity to see them. This will provide guidance to other users to help them resolve their issues Thank you for your contribution, it is much appreciated. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your detailed answer! I'm slowly getting into the details of your project. If you are curious my retro clock project is using your autoconnect libraries for wifi and config pages. Here is a screenshot of the alarm page: And the project in general is here: http://www.neonixie.com/IV-9-6D-RR/ I appreciate your contribution with this library! Regards, |
Beta Was this translation helpful? Give feedback.
@Hieromon
I got it working! It was indeed running out of memory.
Adding the following to AutoConnectDefs.h fixed it!
#define AUTOCONNECT_JSONDOCUMENT_SIZE (16 * 1024)
The devkitc board was working because AUTOCONNECT_JSONPSRAM_SIZE is defined larger then the regular AUTOCONNECT_JSONDOCUMENT_SIZE. (8 * 1024) on a regular board vs (16 * 1024) on boards with PSRAM.
A suggestion.. if you can have the "[AC] Deserialize:NoMemory" text/error appear on the page that the error occurred.. /alarm in my case.. instead of just dropping the page, it would help the next poor soul a few hours of troubleshooting! Not sure how easy it would be to do.
Thank you again @Hieromon , you have a neat project.
Reg…