Closed honestech74 closed 3 years ago
I have added the following configuration to platformio.ini
, then an error has fixed.
board_build.embed_txtfiles =
components/esp32-wifi-manager/src/index.html
components/esp32-wifi-manager/src/style.css
components/esp32-wifi-manager/src/code.js
Hi, can you share how you compiled it on platformio knowing that this project only compiles with esp-idf 4.2 and above, and platformio is using esp-idf v4.1
I had the same problem but with this fix alone the portal is static and the js doesn't work. This is because Platformio adds an extra null char at the end of the files, breaking the scripts. For anyone else reading, this is the full fix for wifi-manager release v3.3.1 on Platformio v3.0.0.
Add this to your platform.ini:
board_build.embed_txtfiles =
components/esp32-wifi-manager/src/index.html
components/esp32-wifi-manager/src/style.css
components/esp32-wifi-manager/src/code.js
Then modify these 3 lines in http_app.c:
252: httpd_resp_send(req, (char*)index_html_start, index_html_end - index_html_start);
258: httpd_resp_send(req, (char*)code_js_start, code_js_end - code_js_start);
265: httpd_resp_send(req, (char*)style_css_start, style_css_end - style_css_start);
to
httpd_resp_send(req, (char*)index_html_start, strlen((char*)index_html_start));
httpd_resp_send(req, (char*)code_js_start, strlen((char*)code_js_start));
httpd_resp_send(req, (char*)style_css_start, strlen((char*)style_css_start));
Fix for platformio/platform-espressif32 v3.0.0 and ESP-IDF v4.2
I had the same problem but with this fix alone the portal is static and the js doesn't work. This is because Platformio adds an extra null char at the end of the files, breaking the scripts. For anyone else reading, this is the full fix for wifi-manager release v3.3.1 on Platformio v3.0.0.
Add this to your platform.ini:
board_build.embed_txtfiles = components/esp32-wifi-manager/src/index.html components/esp32-wifi-manager/src/style.css components/esp32-wifi-manager/src/code.js
Then modify these 3 lines in http_app.c:
252:
httpd_resp_send(req, (char*)index_html_start, index_html_end - index_html_start);
258:httpd_resp_send(req, (char*)code_js_start, code_js_end - code_js_start);
265:httpd_resp_send(req, (char*)style_css_start, style_css_end - style_css_start);
to
httpd_resp_send(req, (char*)index_html_start, strlen((char*)index_html_start)); httpd_resp_send(req, (char*)code_js_start, strlen((char*)code_js_start)); httpd_resp_send(req, (char*)style_css_start, strlen((char*)style_css_start));
This fix should be in readme for Platformio users!! Thanks a lot!
@gagank1 thank you for pointing in the right direction. The NULL issue can be solved by using embed_files
instead of embed_txtfiles
. Doing this eliminates the need to change http_app.c.
board_build.embed_files =
components/esp32-wifi-manager/src/index.html
components/esp32-wifi-manager/src/style.css
components/esp32-wifi-manager/src/code.js
Description
I am using ESP-IDF v4 and PlatformIO and got the following error while building the project. I have added this repository to my components directory and set EXTRA_COMPONENTS, and then copy the whole code of default_demo/main/user_main.c to my project source.
Steps to Reproduce
set(EXTRA_COMPONENTS components/)
pio run
System Configuration
OS: Windows 10 x64 IDE: PlatformIO Tools: ESP-IDF v4.1