Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Loading Web Interface causes device to drop pings and never loads #504

Closed
jondunning opened this issue May 3, 2023 · 40 comments
Closed

Comments

@jondunning
Copy link

Describe the bug
Loading Web Interface causes device to drop pings and never loads.

To Reproduce
Steps to reproduce the behavior:
Open Chrome and browse to IP of the device

Expected behavior
Web should load and pings not expected to drop

Screenshots
If applicable, add screenshots to help explain your problem.

Hardware (please complete the following information):

  • Helsinki Spa
  • 6 wires
  • PCB v1

Software (please complete the following information):
Firmware: 2023-04-24-1854

Additional context
MQTT seems to still operate during this issue

@jondunning
Copy link
Author

Screen recording below;

Screen.Recording.2023-05-03.at.21.49.35.mov

@jondunning
Copy link
Author

Unifi Screenshot of connection between ESP and AP

Screenshot 2023-05-03 at 21 56 19

@visualapproach
Copy link
Owner

Hi! I don't know why you have that problem. I thought maybe the ESP's own AP is on but then MQTT wouldn't work I guess. Maybe something with the flash file system? Does the .../dir/ page work? Or .../info/
Or maybe something is blocking in your router? Guest network perhaps? Have you tried with any other applications on the ESP?

@jondunning
Copy link
Author

Both directories load fine, results below;

/dir/

bootlog.txt Size: 1057 Bytes remove
chkupdatefw.html.gz Size: 1452 Bytes remove
cmdq.json Size: 9 Bytes remove
config.html.gz Size: 3055 Bytes remove
debug.html.gz Size: 759 Bytes remove
favicon.ico Size: 9662 Bytes remove
favicon.png Size: 1817 Bytes remove
function.js.gz Size: 491 Bytes remove
furelise.tune Size: 524 Bytes remove
hwcfg.json Size: 69 Bytes remove
hwconfig.html.gz Size: 2479 Bytes remove
hwtest1.jpg Size: 10533 Bytes remove
hwtest2.jpg Size: 9432 Bytes remove
hwtestinfo.html.gz Size: 879 Bytes remove
index.html.gz Size: 2711 Bytes remove
index.js.gz Size: 3497 Bytes remove
main.css.gz Size: 1852 Bytes remove
manifest.json Size: 149 Bytes remove
menu.png Size: 223 Bytes remove
mqtt.html.gz Size: 1445 Bytes remove
mqtt.json Size: 259 Bytes remove
remove.html.gz Size: 788 Bytes remove
settings.json Size: 295 Bytes remove
states.txt Size: 34 Bytes remove
success.html.gz Size: 671 Bytes remove
upload.html.gz Size: 862 Bytes remove
visualapproach.png Size: 8177 Bytes remove
webconfig.html.gz Size: 1537 Bytes remove
wifi.html.gz Size: 2073 Bytes remove
wifi.json Size: 260 Bytes remove

/info/

Stack size: 268
Free Heap: 20488
Min Heap: 17168
Core version: 3.1.2
CPU fq: 160 MHz
Cycle count: 410041422
Free cont stack: 1520
Sketch size: 677312
Free sketch space: 2465792
Max free block size: 16208

@visualapproach
Copy link
Owner

Great, so it all seems normal and the ESP server can respond. Only serving the html files not working. Did it work in earlier versions or is this your first install?
If you open the inspect/console in the browser, what is the output when trying to load the page?

@jondunning
Copy link
Author

I've re-flashed the file system ota and it's now loading fine, very strange as it was working then suddenly stopped without any changes.

@dasfliege
Copy link

I'm having the same issue again as well. Running latest dev version.
Did a clean flash several times now, re-uploaded filesystem, etc.... First the UI was working until i rebootet the ESP. Now i don't get the UI to open at all. Favico is loading but the rest of the UI stays blank. /info/ and /dir/ are working fine though:

image

image

@visualapproach
Copy link
Owner

Do you have multiple pages open in different browsers? Or mqtt updates super frequently?

@dasfliege
Copy link

No. Also tried different browsers. MQTT is disabled.

@visualapproach
Copy link
Owner

Okay, my guess is web server is getting OOM (out of memory). If you want you can uncomment all the -Ddebug lines in platformio.ini and build+upload, and check the serial monitor for OOM message. You need to have it hooked up with USB to a computer. It's weird though that only some of you have this problem. Maybe connected to a certain router or something. Does it make a difference if you're on dhcp or static IP? Just fumbling in the dark here.

@dasfliege
Copy link

This drives me crazy. The behavior is completely random.

  • uncommented all ddebug line, rebuilt+uploaded -> UI was loading perfectly
  • Changed hardware to 54173 and PCB to v2, restarted ESP -> not working anymore. barely able to ping the device and UI not loading.
  • Set a static IP in config.h, rebuild+upload -> not working anymore. barely able to ping the device and UI not loading.

I don't see any OOM errors in the serial console, nor anything else then the startup sequence:
image

@visualapproach
Copy link
Owner

Followed your points and still works perfectly here.
Btw - You can/should set the IP static in the web ui-network config.
I added some output to the code. Will upload new beta version in a moment. It will give this output:

.
192.168.4.64
End of setup()
File size: 2711
HTTP > file sent: /index.html.gz (2711 bytes)
File size: 1852
HTTP > file sent: /main.css.gz (1852 bytes)
File size: 491
HTTP > file sent: /function.js.gz (491 bytes)
File size: 3497
HTTP > file sent: /index.js.gz (3497 bytes)
File size: 223
HTTP > file sent: /menu.png (223 bytes)
File size: 8177
HTTP > file sent: /visualapproach.png (8177 bytes)```

@dasfliege
Copy link

Did another clean flash with the latest beta. Ping is alright, but UI is not loading. Everytime is retry to access the UI, ping is breaking up for a few seconds.
This is all i get in the console:
image

@jondunning
Copy link
Author

jondunning commented May 8, 2023

@dasfliege Are you having the same issue when running without the hot tub connected? i.e Just the esp connected via usb?

@visualapproach
Copy link
Owner

Did another clean flash with the latest beta. Ping is alright, but UI is not loading. Everytime is retry to access the UI, ping is breaking up for a few seconds.

This is all i get in the console:

image

All file sizes are wrong, I wonder if there is something fishy with your file system. If you can make it work long enough to make an "update" to beta from web ui and then check output again, maybe it will be right

@dasfliege
Copy link

@dasfliege Are you having the same issue when running without the hot tub connected? i.e Just the esp connected via usb?

Yes, i had it on my bench all the time

@dasfliege
Copy link

All file sizes are wrong, I wonder if there is something fishy with your file system. If you can make it work long enough to make an "update" to beta from web ui and then check output again, maybe it will be right

I'll give it a try. But atm i don't get it to work at all...
Tried erasing flash, re-flash with or without pre-set wifi settings, etc etc...

I gonna try it on another computer as well

@dasfliege
Copy link

How do you guys exactly perform a fresh flash?

  • Do you perform an "erase flash" prior to each flash operation?
  • Do you physically unplug / re-plug the ESP after flashing and before uploading the filesystem?

@visualapproach
Copy link
Owner

  • No
  • No
    image
    1 build filesystem image
    2 upload filesystem image
    ESP connected with USB for upload

@jondunning
Copy link
Author

jondunning commented May 9, 2023

I got mine working by re-flashing the Filesystem OTA. It's not been connected to the Hot Tub since though (waiting on replacement pump) and also not connected to the same AP because I have it connected via USB in my office.

I'll go and place it outdoors now and see if it's an AP thing. Shooting in the dark but worth testing. I'll report back shortly.

@jondunning
Copy link
Author

OK interesting....It's started misbehaving when connected to my AP outdoors. I have many other esp devices (running tasmota) connected to this AP that are fine. Garden AP details below;

Screenshot 2023-05-09 at 08 51 55

Screenshot 2023-05-09 at 08 51 45

Screenshot 2023-05-09 at 08 50 00

@jondunning
Copy link
Author

Changed transmit TX from Auto to High and the esp now seems to be responding.

Is it possibly related to this - esp8266/Arduino#6471

@dasfliege
Copy link

dasfliege commented May 9, 2023

I do have a lot of Unifi AP as well and i also use an SSID with dashes in it (Dashes were a problem on older philips TVs :-) ).
In the discussion you've linked, they mainly talk about lowering transmitting power. So i wonder why you had success by increasing it...
I don't really consider changing the transmit power, as it's quite tuned for my environement with 6 APs. But may give it a try for testing purpose

@dasfliege
Copy link

What's pretty confusing though, is that everything was working perfect at the exact same location with an older firmware. I just bricked it by flashing a firmware that fixes my MQTT problem (hydrojets not visible in HA). So i highly doubt that the RF environement has anything to do with it.

@visualapproach
Copy link
Owner

Older firmware is still available. Wondering about your file sizes. Can you post screenshot of layzspa.local/dir/

@dasfliege
Copy link

image

I don't remember what firmware it was before the MQTT fix. Do you know it?

@jondunning
Copy link
Author

jondunning commented May 9, 2023

I put my WiFi transmit power back to auto and it still works but I notice a channel switch from 6 to 1 and it’s worked since. This does feel like a WiFi related issue. I’ll run more tests tomorrow

@olskar
Copy link

olskar commented May 13, 2023

I have the same problem, it seems very random. What I THINK is some kind of pattern in it for me is that the issue does not present itself when running the esp with usb, only when connected to the pump.

@visualapproach
Copy link
Owner

This is my /dir/
Check the file sizes. If not the same it's probably where you want to check first. At least @dasfliege.
Note that save files will be different, but the html should match.
image

@dasfliege
Copy link

Except of the image files, all others are smaller. How can it be, that it still works sometimes if all files seem to be not complete?

@dasfliege
Copy link

Just did an update to Beta 1551 through the UI. And now most of the filesizes matches.
I'll check how it runs now and give feedback.

Interesting though, Current firmware now show 1137. Maybe you forgot to update the fw version in the code?

image

@visualapproach
Copy link
Owner

That's a good question! I'd try to do updates to beta from web ui to take out some unknowns like your computer.

@visualapproach
Copy link
Owner

Hm, have to check but you're probably right

@dasfliege
Copy link

Seems to run perfectly fine until now.
One thing: I do see all informations in MQTT, but can't control the pump. I first have to activate "Take Control" via the UI and then it also works in MQTT. Is this by design? Though in an earlier release i was able to control the pump via MQTT without having to go to the WebUI first...

@visualapproach
Copy link
Owner

I'm on it 😸

@visualapproach
Copy link
Owner

There you are. Beta version.

@jondunning
Copy link
Author

jondunning commented May 15, 2023

I have the same problem, it seems very random. What I THINK is some kind of pattern in it for me is that the issue does not present itself when running the esp with usb, only when connected to the pump.

@olskar Just to confirm, you are connected to a Unifi Access Point? If so, can you share the model of the hardware (Just looking for a pattern).

Also, when connected to USB is your ESP connecting to the same AP as when it's connected to the Hot Tub. Mine wasn't, hence the question.

@dasfliege
Copy link

dasfliege commented May 16, 2023

There you are. Beta version.

Did the update, but getting E13 now on every boot :-( Had to bypass the ESP for now, as i installed it in the pump and the pool is heating up now. But i have another ESP here for testing.

@visualapproach
Copy link
Owner

sigh that's a bummer. Let me know how your other ESP works.

Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants