wendlers / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices ⛺
MIT License
396 stars 84 forks source link

Make webrepl connection faster. #46

Closed tfeng closed 5 years ago

tfeng commented 6 years ago

It seems we are unnecessarily reading more data from the server than necessary. This results in long wait time before the prompt shows up. I tested with the actual amount of data being read from the server, and it turns out that reading 256 bytes at both places is excessive.

Can we change to the actual numbers of bytes expected in both cases?

Let me know if there is a good reason for reading 256 bytes instead.

skorokithakis commented 5 years ago

I don't know the reason that we're reading 256 bytes, but reading the exact number seems a bit error-prone (what if the prompt changes)? Would it be possible to read bytes one by one (or some small number) until we've gotten the full prompt, and then stop reading?

skorokithakis commented 5 years ago

I'm going to merge this and hope MicroPython doesn't change their prompts, as the speedup is significant. Thank you.

skorokithakis commented 5 years ago

On second thought, trying to test this I get failures to connect. I will need to investigate more before merging, sorry.

skorokithakis commented 5 years ago

I've implemented this, since the failures were unrelated. Let's see if anything breaks, thank you.