s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266
https://valencia.lbsfilm.at/midterm-presentation/
Other
923 stars 174 forks source link

Still the blank-only-'Connected' UI #209

Open ericBcreator opened 2 years ago

ericBcreator commented 2 years ago

I thought I read this issue was tackled but getting back to my clock project and recompiling with the latest updated libraries I still run into this issue (Wemos D1 mini):

espui-err-22116

thomastech commented 1 year ago

I looked at your Mar-2021 project code and can see you were using the SPIFFS file system. I assume you've revised your code to use the LITTLEFS method [ESPUI.beginLITTLEFS()] instead of SPIFFS. And have updated your build platform's file system folder with the latest web related files needed to run ESPUI's revised filesystem AND have uploaded them to the ESP32 device.

So assuming you've done all that and there's still no-joy, it's time for a simple experiment. I suggest you temporarily change to the built-in file server [ESPUI.begin()]. If this works then there is something wrong with the LITTLEFS filesystem. Could be missing ESPUI web files in your project, a bug in the Arduino IDE's file system uploader, or a problem with the current ESPUI library.

ericBcreator commented 1 year ago

Hi Tomas,

I updated to ESPUI 2.2.1 and the other libraries (it depends on) to their latest versions. Recompiled (cleared all flash memory) and tried both with and without using the filesystem (LITTELEFS): no difference, still the same issue.

Experimenting in the past seemed to indicate the number of controls (>60) affect this issue. So in the project I added an option to limit the number of controls. But it is unreliable, sometimes the web ui will display, sometimes not. And it's also browser unrelated: the same issue with Firefox, Chrome, Edge and Safari.

BTW: it is only with ESP8266 boards, I have no problems with ESP32s:

ebc-32-221108

thomastech commented 1 year ago

That is indeed an interesting problem. Maybe Firefox's F12->Console debugger will provide a clue on what is going on. This will show you the messages between the browser and ESPUI.

ericBcreator commented 1 year ago

F12 unfortunately provides no useful info. (Also) check this: the UI appearing with the Edge browser but a minute later blank with Firefox:

afbeelding

Edit: and a refresh with the Edge and I get the same blank-connected UI.

BTW: I mentioned this issue already 2 years ago, check this thread: https://github.com/s00500/ESPUI/issues/92 It seems Ian was working on a fix. Apparently it didn't work or it didn't made it into the latest version.

ericBcreator commented 1 year ago

Another BTW: one thing I noticed is sometimes the blank UI displays 'Control Connected' and other times '#SSID# Connected'.

thomastech commented 1 year ago

Your previous Issue #92 provided helpful background info. I'd have to agree that switching the ESP8266 to a ESP32 is the most practical solution when a lot of controls are used.

ericBcreator commented 1 year ago

Yes and the ESP32 Mini is almost a drop in replacement for my project. I have built several with an ESP8266 though, so it would be nice if the UI also worked without issues.

And an issue I had with ESP32s was that sometimes a brownout error triggered when connecting to Wifi causing the EEPROM settings to be erased. So both boards have their pros and cons.

On Tue, Nov 8, 2022 at 9:28 PM Thomas @.***> wrote:

Your previous Issue #92 https://github.com/s00500/ESPUI/issues/92 provided helpful background info. I'd have to agree that switching the ESP8266 to a ESP32 is the most practical solution when a lot of controls are used.

  • Thomas

— Reply to this email directly, view it on GitHub https://github.com/s00500/ESPUI/issues/209#issuecomment-1307787894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWTPHDSZMN2BNXNCP4XUX3WHKZVFANCNFSM6AAAAAARYPYXFU . You are receiving this because you authored the thread.Message ID: @.***>

ericBcreator commented 1 year ago

IIRC a while ago I read an e-mail mentioning that someone (Ian?) figured out what was causing the blank screen and found another method of sending the JSON data? Not sure about it though.

On Wed, Nov 9, 2022 at 8:47 AM ericB creator @.***> wrote:

Yes and the ESP32 Mini is almost a drop in replacement for my project. I have built several with an ESP8266 though, so it would be nice if the UI also worked without issues.

And an issue I had with ESP32s was that sometimes a brownout error triggered when connecting to Wifi causing the EEPROM settings to be erased. So both boards have their pros and cons.

On Tue, Nov 8, 2022 at 9:28 PM Thomas @.***> wrote:

Your previous Issue #92 https://github.com/s00500/ESPUI/issues/92 provided helpful background info. I'd have to agree that switching the ESP8266 to a ESP32 is the most practical solution when a lot of controls are used.

  • Thomas

— Reply to this email directly, view it on GitHub https://github.com/s00500/ESPUI/issues/209#issuecomment-1307787894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWTPHDSZMN2BNXNCP4XUX3WHKZVFANCNFSM6AAAAAARYPYXFU . You are receiving this because you authored the thread.Message ID: @.***>

thomastech commented 1 year ago

And an issue I had with ESP32s was that sometimes a brownout error triggered when connecting to Wifi causing the EEPROM settings to be erased.

The ESP8266 and ESP32 require clean & stable power. Many USB "charger" supplies and some USB cables just aren't up to this task. So if you are seeing brownouts then your power supply configuration, or the related wiring, needs some attention.

BTW, I've build many ESP32 projects and have not experienced your noted issue. But long ago I had random reboot problems with my ESP8266 devices that were solved with improvements to the power supply, which included better USB cables and additional supply filtering on the affected devices. And I have used this learned experience to help my ESP32 projects.

IIRC a while ago I read an e-mail mentioning that someone (Ian?) figured out what was causing the blank screen and found another method of sending the JSON data?

The current ESPUI release sends data in much smaller chunks, in a more coordinated way, thanks to MartinMueller2003's efforts. But since the latest release did not solve your problem I suspect that the issue is deep in a Arduino library.

ericBcreator commented 1 year ago

You're right about using correct power and decent cables. In hindsight I have to say the brownout errors didn't occur since I added a good power supply next to the PC USB connection (when working on the project).

"The current ESPUI release sends data in much smaller chunks" So I was right some changes were made (by MartinMueller2003). In the past I did some retracing in the ESPAsync libraries but quit as it took a lof of time with no results (yet) and it was becoming a big sidetrack from my project.

What I don't get is why - with the exact same setup (board and code) - sometimes the UI is blank and other times not (like in the picture I posted). That doesn't make sense, the logic program excution should be the same every time. It is not like it's running on a bloated OS like Windows with all kind of other processes interfering.

thomastech commented 1 year ago

What I don't get is why - with the exact same setup (board and code) - sometimes the UI is blank and other times not (like in the picture I posted). That doesn't make sense, the logic program excution should be the same every time.

That's the dream, but reality is what it is. Program execution is not always the same each loop. For example, the browser's interaction with your device can occur at any time. Plus the ESP has interrupts that can delay entering other time critical functions.

Not to mention that there could be an issue somewhere in a library or your code. Uninitialized pointers, char buffers that are too small, compiler optimizations that misinterpret your intentions, and so on, can create random problems && endless frustrations.

Such things may cause a problem once-in-awhile or could trigger some odd memory corruption that requires a reboot to "fix."

But don't give up. It would be great if you or some other ESPUI user found the reason to this issue and published the fix. In the meantime I think swapping the ESP8266 with a ESP32 is a somewhat painless solution.

ericBcreator commented 1 year ago

Fair points.

BTW: a good debugger would make life lot a lot easier, Putting debug prints in the Arduino IDE is a pain in the but. I have some ideas, will give them a try when I have some time.

Op 10 nov. 2022, om 18:53 heeft Thomas @.***> het volgende geschreven:

What I don't get is why - with the exact same setup (board and code) - sometimes the UI is blank and other times not (like in the picture I posted). That doesn't make sense, the logic program excution should be the same every time.

That's the dream, but reality is what it is. Program execution is not always the same each loop. For example, the browser's interaction with your device can occur at any time. Plus the ESP has interrupts that can delay entering other time critical functions.

Not to mention that there could be an issue somewhere in a library or your code. Uninitialized pointers, char buffers that are too small, compiler optimizations that misinterpret your intentions, and so on, can create random problems && endless frustrations.

Such things may cause a problem once-in-awhile or could trigger some odd memory corruption that requires a reboot to "fix."

But don't give up. It would be great if you or some other ESPUI user found the reason to this issue and published the fix. In the meantime I think swapping the ESP8266 with a ESP32 is a somewhat painless solution.

Thomas — Reply to this email directly, view it on GitHub https://github.com/s00500/ESPUI/issues/209#issuecomment-1310671543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWTPHDWGDJH2J3XMNBHI3TWHUZBBANCNFSM6AAAAAARYPYXFU. You are receiving this because you authored the thread.

s00500 commented 1 year ago

you can do breakpoint debugging with some esp32 dev boards and platformio, the 8266 is a different story though...

Eisbaeeer commented 1 year ago

Got same issue with d1_mini_pro esp8266. The Edge browser showing connected and the blank screen. The same with mobile phone. Im using the ESPUI Test from example. EDIT: The example gui working out of the box. Greets Lars

d-a-v commented 1 year ago

But don't give up. It would be great if you or some other ESPUI user found the reason to this issue and published the fix. In the meantime I think swapping the ESP8266 with a ESP32 is a somewhat painless solution.

I think #241 would help.

Looki2000 commented 2 weeks ago

Im having the same problem with ESPUI 2.2.4 and ArduinoJson 6.10.1 but on ESP32. Is there any fix yet? Edit: I'm using PlatformIO

ericBcreator commented 2 weeks ago

I got back this project around 1,5 month ago, recompiled it with current libraries and it seems it finally fixed the issues with the ESP8266 and ESPUI interface - for me. Still working since 6 weeks without an issue:

scs24102301