ayushsharma82 / WebSerial

A remote terminal library for wireless microcontrollers to log, monitor or debug your firmware/product
https://webserial.pro
GNU Affero General Public License v3.0
507 stars 113 forks source link

Terminal Window #107

Open toms3057 opened 1 week ago

toms3057 commented 1 week ago

I am using WebSerial in code that controls some equipment. There are settings in the Flash/EEPROM that the user can change. There are 13 addresses read by sending a command 'r'. I can also write to a location. I have this working well using v1.4.0 because I had done this code some time ago. Lately I am make mods to the code and notice that v2.0.8 acts weird. I am using onMessage and the ESPasync library with new maintainer. It compiles and it does work but querky. When I send the 'r' command WS usually misses the first time or two. On the second or third it works and echos the command and then prints settings 0 to 10, then prints the remaining two settings above the command echo at the top. Also if there is a lot of data in the terminal window and I scroll up to look the scroll is cancelled and it goes back to the bottom I assume waiting for more data or something. The early version never did this and never missed a command. So what gives? Do I need to clear a buffer or something. If so there is no library command for such. Also log files are great but in my application there is no need so it would be great if there was a setting to turn them off.
Summary follows.

  1. Using the v 1.4.0 works for me without any issues.
  2. Using v2.0.8 has out of sequence terminal window printing, automatic scroll setback and misses commands from the user. Any help would be great, however I am sticking with the v1.4.0 because it works as expected does not miss commands and prints in the terminal window as expected and scroll does not do auto reset. Honestly I don't see whats great about v2.x!
mathieucarbou commented 1 week ago

Maybe try with -D WSL_HIGH_PERF, which will activate a different implementation I have contributed from https://github.com/mathieucarbou/MycilaWebSerial, and which works closer to first version, but with perf improvements added (meaning that it requires your application to only send lines, and not use write(c) or similar character variants). You can read the header doc for more info.