chmorgan / esphttpd-freertos

freertos example of libesphttpd for esp32 and esp8266
53 stars 14 forks source link

Loading Partitions Info Table Not Working #30

Open aminediab007 opened 4 years ago

aminediab007 commented 4 years ago

Hi, I am using ESP-IDF v4.1, the application compiles and flashes correctly, however selecting perform OTA firmware does nothing, it does not display the partitions table, nor does it accept to reboot! Apperantly the cgiGetFlashInfo is not called due to bad java script in html file, cannot read localStorage!

Thanks,

phatpaul commented 4 years ago

Thanks for the report. It is working for me, but I am on ESP-IDF 3.3.

Can you provide more info? (Environment, web-browser, sdkconfig) Also please try a different web-browser, since you indicated it's a javascript error.

aminediab007 commented 4 years ago

Hi, I tried Firefox and chrome with JavaScript enabled. I inspected the Firmware Page using chrome inspector, i could see two errors: 1) Uncaught Type Error: Cannot read property 'localStorage' of undefined at 140medley.min.js:1 2)Uncaught Type Error: j is not a function at index.html:1 Below I listed the partitions table and sdkconfig file. Thank you for taking a look at!

I (60) boot: Partition Table: I (63) boot: ## Label Usage Type ST Offset Length I (71) boot: 0 nvs WiFi data 01 02 00009000 00004000 I (78) boot: 1 otadata OTA data 01 00 0000d000 00002000 I (86) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (93) boot: 3 factory factory app 00 00 00010000 00100000 I (101) boot: 4 ota_0 OTA app 00 10 00110000 00100000 I (108) boot: 5 ota_1 OTA app 00 11 00210000 00100000 I (116) boot: End of partition table

sdkconfig.txt

phatpaul commented 4 years ago

I suspect it is the javascript preprocessing step that is messing up the library 140medley.js.

I haven't been able to get that step working on my environment since @jkent changed it to use node.js, since I am still on IDF 3.3 (using mingw32 environment), so I have it disabled and haven't been able to test it.

Please try disable CONFIG_ESPFS_PREPROCESS_FILES in menuconfig. (or at least disable any steps that preprocess javascript)

aminediab007 commented 4 years ago

I had the same suspicion, and disabled pre-process files in menuconfig, it did not resolve the problem! I used Postman and performed most of the api calls, with success!

phatpaul commented 3 years ago

I just encountered this myself. After disable CONFIG_ESPFS_PREPROCESS_FILES and rebuild, it did not fix the issue. I then did a make clean, and rebuilt again and the problem is gone.

So it's confirmed that the preprocessing is messing up 140medley.js. @jkent is there an easy way to make the preprocessing step skip that file? It's already pretty minimal.

jkent commented 3 years ago

Off hand I don't think there is a mechanism for this. The new libespfs v2 has a yaml based filter which is extremely flexible. The only down side is that the espfs binary is not compatible. Would you like for me to backport it?

Jeff Kent

On Wed, Apr 28, 2021, 8:08 PM Paul Abbott @.***> wrote:

I just encountered this myself. After disable CONFIG_ESPFS_PREPROCESS_FILES and rebuild, it did not fix the issue. I then did a make clean, and rebuilt again and the problem is gone.

So it's confirmed that the preprocessing is messing up 140medley.js. @jkent https://github.com/jkent is there an easy way to make the preprocessing step skip that file? It's already pretty minimal.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chmorgan/esphttpd-freertos/issues/30#issuecomment-828879023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEH7M34VA46BIMQ2Y3Q4KTTLCWRVANCNFSM4ND6RM2Q .

phatpaul commented 3 years ago

I wouldn't do the backporting work just for this issue, since the better solution is to upgrade the ancient javascript and get rid of the 140medley.js dependency in the example project.

What if the babel script can skip any file with *.min.js in the filename? Then I can just rename the file to add .min.

jkent commented 3 years ago

Sounds good to me

jkent commented 3 years ago

should be fixed here: https://github.com/jkent/libespfs/tree/v1.1.1 edit: https://github.com/jkent/libespfs/tree/v1.1.2