prusa3d / Prusa-Firmware-Buddy

Firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL 3D printers by Prusa Research.
Other
1.16k stars 227 forks source link

[BUG] Prusa Connect main.js slow to load #1285

Closed reedy closed 1 year ago

reedy commented 3 years ago

Printer type MINI

Printer firmware version 4.3.0, 4.3.1, 4.3.2, 4.3.3

Original or Custom firmware Original

Optional upgrades Filament Runout Sensor

USB drive or USB/Octoprint USB

Describe the bug Prusa Connect Local Interface is slow to load, and should not take over 20 seconds to load one JS file. It seems to be consistently take over 20s

How to reproduce Load the web interface

Screenshot 2021-02-04 at 20 06 13

Expected behavior Interface to load in a timely fashion, especially when the printer is idle

G-code n/a

Crash dump file n/a

Video

https://user-images.githubusercontent.com/67615/106949475-e564bc80-6724-11eb-855d-153e1f93f785.mov

https://user-images.githubusercontent.com/67615/106949862-776cc500-6725-11eb-931a-e70844b8c238.mov

reedy commented 3 years ago

And for completeness, it still takes ~20s when the printer is actively printing

stickybyte commented 3 years ago

Can confirm that issue in version 4.3.0

turniptop commented 3 years ago

Can confirm and add some details. Bug appears to be browser specific. Does not load at all with Safari.
Loads extremely slowly on Chrome.
Loads intermittently slowly or quickly on Firefox

reedy commented 3 years ago

Does not load at all with Safari.

Ditto

Loads extremely slowly on Chrome.

Ditto. It's slower than FF... 1.5 minutes!

Screenshot 2021-02-13 at 16 13 33

Chrome 88.0.4324.150.

MS Edge ( 88.0.705.68) seems the same too...

Loads intermittently slowly or quickly on Firefox

Seems to be the same on FF (85.0.2) for me. Sometimes it's quick,

Screenshot 2021-02-13 at 16 11 30

Even doing curl -I can timeout... Or get a curl: (52) Empty reply from server

chillygithub commented 3 years ago

I am also seeing this issue with multiple browsers on Ubuntu 20.10. In my case is is taking up to 20 minutes to load. On Android and Win10 I don't see the extended delay.

Reviewing captures with WireShark shows a packet sent out of order which the printer takes 46 seconds to recover from. Which is then repeated: image

172.17.16.10 Prusa Mini 172.17.16.09 Ubuntu 20.10

The Mini sends packet sequence number 1073, the next sequence number should be 2145, but packet sequence number 2681 is sent. There is then a 46 second delay before the Mini sends packet 1609.

Captures have been taken both on the Ubuntu PC, and at the Mini interface with a network tap.

Captures files can be made available to Prusa staff.

Thanks for reporting this, I had been chasing the issue round my network, to ensure the issue was not my end before reporting. This issue (20 minute load time) was not apparent on 4.2.1 that was slow to load in the order of the 20 seconds reported by reedy.

reedy commented 3 years ago

Still an issue on 4.3.1 (yes, I know it wasn't called out as being fixed, but sometimes other bug fixes creep in on point releases and issues get fixed silently).

reedy commented 3 years ago

It's kinda interesting that people report bugs where features are rather broken in new releases, and no one has even responded/acknowledged it from Prusa. I understand you're probably busy, but you're actively committing to master for example.

Never mind as per https://github.com/prusa3d/Prusa-Firmware-Buddy/releases/tag/v4.3.0 the feature was called out as being improved...

Prusa Connect Local upgraded Prusa Connect Local has a separate language settings feature and the configuration remains saved even after a web page reload. To change the Prusa Connect interface language, connect your MINI/MINI+ to the local area network and enter its IP address into your web browser. In the top right corner, use the drop-down menu to pick the language of your choice. If you reload the page, the language setting remains saved.

Dorobuta commented 3 years ago

Can confirm and add some details. Bug appears to be browser specific. Does not load at all with Safari. Loads extremely slowly on Chrome. Loads intermittently slowly or quickly on Firefox

it would not load for me in Safari, or in Chrome - maybe I gave up in Chrome too soon. Tried the usual stuff, ping, port scans, yada yada. Didn't put wire shark on it to watch packets.

very frustrating,. was working under safari prior to this update. I'll go back and let Chrome sit loading for a while and see if int works on my iMac or not.

toyowheelin commented 3 years ago

This issue was happening to me today with Google Chrome. I got impatient waiting for it to load after about 5 minutes and then decided to try to do a no cache reload of the page and it came right up(ctrl+r in Chrome). I am curious if any of you have tried to do a force refresh on the page and see if it loads any quicker.

dldirector commented 3 years ago

Force refresh makes no difference for me. I have made no sense of what is happening but here is what I can report. I have one Linux machine in the basement, near the printer, running Firefox on Xubuntu, when I go to the Prusa Mini IP address I get the status page and all works fine. I have another upstairs Linux machine, also Xubuntu, and trying with Chrome or Opera or Firefox, page loading shows a blank page and appears to try and load "forever". At some point, I walked away and came back about 30 minutes later and the Prusa page was showing, but the print had finished and the Mini had since been turned off. At some point, it did load. When the page was not loading in Chrome on Linux, I opened the page on an iPad, in Chrome, and it opened immediately and seemed to work fine. I have opened the internal console on Chrome while loading the page and I see no errors or other indicators of what is not working. I get the same blank page, or slow loading, when a print is in progress and when the printer is completely idle.

dldirector commented 3 years ago

See above description. The page just loaded after 12 to 15 mins. Attached is a screenshot of the Chrome console, network display. Notice that main...js took 12 mins to load Screenshot_2021-05-20_11-03-43 before telemetry started.

Mushmuch commented 3 years ago

Prusa connect won't load or partially load since I upgraded to FW 4.3 (from 4.0 something) Safari 14.0.3 (16610.4.3.1.7) FW 4.3.1+2759 Screenshot 2021-06-08 at 22 36 22

coaxial commented 3 years ago

This is still an issue on 4.3.1: just connected the mini to my network and none of the JS or CSS files load.

$ http http://192.168.1.167/
HTTP/1.0 200 OK
Content-Encoding: gzip
Content-Type: text/html
Server: Prusa Mini

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Original Prusa Mini - Prusa Connect</title>
  <link rel="shortcut icon" href="favicon.ico"><link href="main.b322e2869b73e803bb67.css" rel="stylesheet"></head>
  <body>
    <noscript>Your browser does not support JavaScript!</noscript>
  <script type="text/javascript" src="main.b322e2869b73e803bb67.js"></script></body>
</html>

$ http http://192.168.1.167/main.b322e2869b73e803bb67.js
HTTP/1.0 200 OK
Content-Encoding: gzip
Content-Type: application/javascript
Server: Prusa Mini

http: error: ConnectionError: HTTPConnectionPool(host='192.168.1.167', port=80): Read timed out.

$ http http://192.168.1.167/main.b322e2869b73e803bb67.js
HTTP/1.0 200 OK
Content-Encoding: gzip
Content-Type: application/javascript
Server: Prusa Mini

http: error: ConnectionError: HTTPConnectionPool(host='192.168.1.167', port=80): Read timed out.
reedy commented 3 years ago

And on 4.3.2...

reedy commented 3 years ago

And on 4.3.3 too...

sgreene570 commented 2 years ago

And on 4.3.3 too...

Same here. Can't get the web UI to properly load from any browser. @DRracer is this a known regression from any specific release?

reedy commented 2 years ago

It wasn't an issue before upgrading to 4.3.x

Lorraine1000 commented 2 years ago

Interesting observation: Could not load the printer page in Safari or Firefox in macOS BigSur. But when I tried with Safari on my iPhone (iOS 15), it would load INSTANTLY! :-O

FileGo commented 2 years ago

Good workaround until firmware is fixed, is to access the telemetry API directly, which gives you pretty much all the data that is available on the web interface (when it works).

It's available at http://IP_ADDRESS/api/telemetry.

Tobix99 commented 2 years ago

Still broken in 4.3.4

meo3000 commented 2 years ago

Solution.

Disable Enhanced Tracking Protection (Firefox) for the page; or allow Insecure Content (Edge and Chrome) in sites permissions.

Happy monitoring and happy new year!

coaxial commented 2 years ago

Solution.

Disable Enhanced Tracking Protection (Firefox) for the page; or allow Insecure Content (Edge and Chrome) in sites permissions.

Happy monitoring and happy new year!

This was occurring with command line clients as well and not only browsers, pointing to an issue with the server rather than the client. Are you able to curl or similar several times in a row and not have the issue anymore?

chillygithub commented 2 years ago

Solution.

Disable Enhanced Tracking Protection (Firefox) for the page; or allow Insecure Content (Edge and Chrome) in sites permissions.

Happy monitoring and happy new year!

Just tried, this did not resolve the issue for myself.

mweisshaupt1988 commented 2 years ago

Guys this issue is not related to the tracking protection. It is most likely a bug in the networking code. I'm currently working on a guide how to integrate the metrics in OpenHAB. I'll provide a link once I'm done. Since it only uses the metrics I have seen far less problems but they are not gone.

image

deltamualpha commented 2 years ago

Chiming in to say I'm also experiencing this (and the /api/telemetry endpoint loads practically instantly, as described above, as well). Very strange behavior.

reedy commented 2 years ago

Anyone had chance to try it on https://github.com/prusa3d/Prusa-Firmware-Buddy/tree/v4.4.0-beta2 yet?

deltamualpha commented 2 years ago

I'll try it this weekend.

DRracer commented 2 years ago

I'm so happy that we can finally welcome everyone to try the completely rewritten networking in 4.4-BETA2 including the new WiFi interface. On top of that, PrusaLink should be considerably more stable with many more features (not only telemetry, but G-code upload, thumbnail previews, start/stop/pause print and more).

For devs, please have a look at the PrusaLink repo (API spec): https://github.com/prusa3d/Prusa-Link-Web

deltamualpha commented 2 years ago

Certainly seems like it's working now for me. Haven't gotten a chance to test the new features, but the raw UI loads snappily.

reedy commented 1 year ago

Just installed https://github.com/prusa3d/Prusa-Firmware-Buddy/releases/tag/v4.4.0

It seems to work a lot better...

(Putting an API key in to view the interface feels a bit weird, but maybe that's mostly because it's being called an API key)

Prusa-Support commented 1 year ago

Hello everyone. I hope you are satisfied with the recent achievements and I wonder if this issue can be closed now.

Michele Moramarco Prusa Research

Prusa-Support commented 1 year ago

Thanks for reacting. This issue will be closed.

Michele Moramarco Prusa Research