arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.98k stars 4.77k forks source link

WebUI slow over Internet #12911

Closed sebsebseb1982 closed 3 years ago

sebsebseb1982 commented 3 years ago

PROBLEM DESCRIPTION

Web UI is working perfectly on LAN Web UI is very slow through Internet. UI load fast but led control and CPU temperature is very slow to show. Video stream is never shown.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:
No interesting log.

TO REPRODUCE

Steps to reproduce the behavior: Flash http://ota.tasmota.com/tasmota32/release/tasmota32-webcam.bin 9.5.0 on Ai-Thinker camera. Set-up Wifi. On your router, forward port xxxxx to esp32's port 80. Connect through lan : no problem. Connect over internet : very very slow.

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen. Web UI should be a little less fast over FTTH

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

s-hadinger commented 3 years ago

First, you shouldn't do this. Tasmota uses HTTP with no encryption. It shouldn't leave your local network. You are going through the internet unencrypted...

Tasmota is very limited in RAM so it sends HTTP responses in 'chunked mode'. This means that small portion of response are sent through the network to make sure we don't buffer too much. This means a lot of round-trips between Tasmota and the web client. On a LAN it's not a problem, on a high latency network it is.

However you have maybe another problem on top of this one.

There's nothing we can do. Tasmota is optimized for MQTT.

sebsebseb1982 commented 3 years ago

First, you shouldn't do this. Tasmota uses HTTP with no encryption. It shouldn't leave your local network. You are going through the internet unencrypted...

Yup, I know but there is nothing critical shown by this camera.

On a LAN it's not a problem, on a high latency network it is.

Even over FTTH ?

s-hadinger commented 3 years ago

Then you may have another problem. Using the developer tools of your browser might give you a hint about the problem

sebsebseb1982 commented 3 years ago

Using the developer tools of your browser might give you a hint about the problem

Good idea ! I think that I've found the problem ;

Web page try to load /stream from LAN IP even through Internet through external DNS/IP

<center><img src="http://192.168.1.234:81/stream" alt="Webcam stream" style="width:99%;"></center>

Could img src be relative and not absolute ? Could video stream be served through port 80 too ? Or could this hostname 192.168.1.234:81 be overriden by configuration (ExternalIP:secondPort) ?

Jason2866 commented 3 years ago

Maybe interesting to read https://github.com/arendst/Tasmota/discussions/12523

sebsebseb1982 commented 3 years ago

My assumption is correct. WebUI works well through VPN over Internet and local IP.

Maybe interesting to read #12523

Thank you for this. If stream must be served on 81 port, it would be great (as said earlier) if stream's hostname could be overriden

ascillato2 commented 3 years ago

Moving to Discussions