-
Notifications
You must be signed in to change notification settings - Fork 17
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
Building custom web page (/setup) breaks the library #50
Comments
I have the same issue. Did you manage to fix it?
|
The problem is due to the fact that the Segger Bin2C tool generates an array with a different name and in the latest versions I decided to use this tool mainly because it is more effective in compressing the file. I also updated the script so that it generates an array with the same name and I just committed. |
Thank you, i will download the updated script. Unrelated question: What file and part of this file is responsible for implementing the "custom html" and adding it to the menu in /setup? I had it working, then adhusted the all.htm to match my needs, and the custom menu item is not visible anymore. I must have removed that part from the code so i'm looking to put it back in. |
The code responsible for customizing /setup starts here. When you add custom HTML, CSS, or JavaScript code using the library’s methods, a new file is created on the filesystem for each addition. Additionally, an entry mapping When the /setup page is requested and config.json is parsed, the script looks for these "special keys," and the custom code is injected into the main page. Try checking your custom page by enabling the browser's developer tools (typically by pressing F12). In the "console" tab, you should be able to see any errors and act accordingly. |
Ok, so for what i figured, the code is fine and working if i just add the lines in the arduino sketch. But as soon as i use add my own css and use minify.js it breaks things and the javascript you mentioned above is not in the page anymore. So it must have something to do with the minifying OR the bin2C i think. any thoughts? |
I made my own page for setup, but when I tried to compile the library it failed. After some testing, I discovered that even with the original files from the library, with NO changes at all, if I build the setup file and copy it to the src folder, the library has an error and will no longer build.
Error:
/Users/iamorion/Documents/Arduino/libraries/AsyncEspFsWebserver/src/AsyncFsWebServer.cpp: In member function 'void AsyncFsWebServer::handleSetup(AsyncWebServerRequest*)': /Users/iamorion/Documents/Arduino/libraries/AsyncEspFsWebserver/src/AsyncFsWebServer.cpp:219:93: error: '_acsetup_min_htm' was not declared in this scope; did you mean '_acedit_min_htm'? 219 | AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", (uint8_t*)_acsetup_min_htm, sizeof(_acsetup_min_htm)); | ^~~~~~~~~~~~~~~~ | _acedit_min_htm exit status 1 Error compiling for board ESP32C3 Dev Module.
If I restore the setup_htm.h that exists in src from the download, it will compile file. If I compile the file following the instructions and using node minify.js - then move the generated setup_htm.h file into the src folder, it then has the error as above so something is breaking and it's not possible to create custom pages currently (Using version 1.0.7)
The text was updated successfully, but these errors were encountered: