ESPUI icon indicating copy to clipboard operation
ESPUI copied to clipboard

UI is not starting

Open ahmedelashouti opened this issue 2 years ago • 8 comments

Hello everyone, I am trying to run an example of this library on my ESP32 (Pico kit) using Arduino IDE. I have installed all the necessary dependencies and now i tried first to run preparefilesystem.ino ( found in the examples directory) however, I get the following error ( trap). When I try to run the gui example, there aren't any errors but the UI is not starting. Not sure if this because preparefilesystem didn't run successfully or it lies on something else.

LOGS when I run preparefilesystem.ino:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 188777542, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:10124 load:0x40080400,len:5856 entry 0x400806a8 assertion "partition_label" failed: file "C:\Users\ahmed\Documents\Arduino\libraries\LITTLEFS-master\src\esp_littlefs.c", line 275, function: esp_littlefs_format abort() was called at PC 0x400d9d5b on core 1 ELF file SHA256: 0000000000000000 Backtrace: 0x40085004:0x3ffb1ea0 0x40085279:0x3ffb1ec0 0x400d9d5b:0x3ffb1ee0 0x400d30c2:0x3ffb1f10 0x400d6db8:0x3ffb1f40 0x400d150f:0x3ffb1f60 0x400d122f:0x3ffb1f80 0x400d79be:0x3ffb1fb0 0x40086289:0x3ffb1fd0 Rebooting...

LOGS when I run gui.io: ( network has been established) TextAll {"type":104,"value":"32807","id":2,"visible":true,"color":1,"enabled":true} TextAll {"type":10,"value":13,"id":18} {"type":105,"value":"0","id":6,"visible":true,"color":6,"enabled":true} TextAll

ahmedelashouti avatar Jul 06 '22 21:07 ahmedelashouti

I also tried the proposed solution in Issue 157 but it didn't work for me

ahmedelashouti avatar Jul 06 '22 21:07 ahmedelashouti

Unless you absolutely need it, you don't need to prepare the file system, that's only for special situations. Does it work with a regular example like this

https://github.com/s00500/ESPUI/blob/master/examples/gui/gui.ino

daniel-frenkel avatar Jul 12 '22 03:07 daniel-frenkel

this is the example i run as mentioned in the post. i get the following output on the serial monitor, but no gui is starting. idk what would be the reason ! ( connection with internet is established ) TextAll {"type":104,"value":"32807","id":2,"visible":true,"color":1,"enabled":true} TextAll {"type":10,"value":13,"id":18} {"type":105,"value":"0","id":6,"visible":true,"color":6,"enabled":true} TextAll

ahmedelashouti avatar Jul 12 '22 17:07 ahmedelashouti

ESPUI serves several files to the browser to build up its web interface. This can be achieved in 2 ways: PROGMEM or LITTLEFS.

It seems that you have chosen to use the LITTLEFS web interface method. The web browser's missing GUI means that you have not installed all the web files into the ESP32. This requires "file system" flashing after you have uploaded the runtime code. I recall that both Arduino and PlatformIO need to be modified to support file system flashing on the ESP32.

If you are not sure how to install the file system files: I recommend you switch to the PROGMEM web interface. This will handle the web interface without needing any additional file flashing.

  • Thomas

thomastech avatar Jul 12 '22 17:07 thomastech

Thank You for the answer. how can i switch to PROGMEM ? i found this comment in the gui.ino example and the program uses ESPUI.begin not ESPUI.beginLITTLEFS. so it is by default supposed to serve files form PROGMEM ! /* * .begin loads and serves all files from PROGMEM directly. * If you want to serve the files from LITTLEFS use ESPUI.beginLITTLEFS * (.prepareFileSystem has to be run in an empty sketch before) */

ahmedelashouti avatar Jul 12 '22 17:07 ahmedelashouti

If you are already using PROGMEM then the missing web GUI is a mystery to me.

I suggest providing more info. For example, you say the GUI does not start. That can mean many things, such as a page timeout, blank html page, etc. More details may help someone understand what you are experiencing.

I recommend reviewing the log messages starting the instant the page load is requested. This may provide important info, such as if a ESP32 crash has occurred.

  • Thomas

thomastech avatar Jul 13 '22 19:07 thomastech

Yes further to what Thomas says, we need a bit more information here.

Do you see output on the JavaScript console? Also I presume there is a lot more that appears on the Serial Monitor than just the lines you pasted. Connect the monitor then reboot the ESP to ensure you capture everything please.

iangray001 avatar Jul 16 '22 10:07 iangray001

I had this effect of website is not shown sometimes after uploading a new program. a simple reset on the microcontroller and a reload of the website and everything appeared.

StefanL38 avatar Oct 24 '22 13:10 StefanL38