s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI is not starting

ahmedelashouti opened this issue · 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

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

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

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

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

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)
*/

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

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.

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.