asjdf / WebSerialLite

Super lightweight remote serial monitor for ESP8266 & ESP32 (frontend <3k)
GNU General Public License v3.0
60 stars 12 forks source link

last println not rebeing recieved.. #4

Closed kmb36td closed 1 year ago

kmb36td commented 1 year ago
WebSerial.println(" ");
    WebSerial.println("List of Available Commands:");
    WebSerial.println("");
    WebSerial.println("help \"print help\"");
    WebSerial.println("geteeprom \"Print EEPROM settings.\"");
    WebSerial.println("setcur<space><decimal 20.0-100.0> \"Set motor current setting.\"");
    WebSerial.println("setaccel<space><decimal 0.04-1.0> \"Set accel setting.\"");
    WebSerial.println("setangle<space><decimal 0.0-360.0> \"Set turn Angle setting.\"");
    WebSerial.println("streamdata<space><\"true\" or \"false\"> \"Print streamdata.\"");

abaove code prints.. but the last printline not being recieved "streamdata" not printed..


List of Available Commands:

help "print help"
geteeprom "Print EEPROM settings."
setcur<space><decimal 20.0-100.0> "Set motor current setting."
setaccel<space><decimal 0.04-1.0> "Set accel setting."
setangle<space><decimal 0.0-360.0> "Set turn Angle setting."
asjdf commented 1 year ago

Thanks for your report.

I found that the problem you encountered may not be caused by this library, but by ESPAsyncWebServer (I think this is a feature of the library, although there are some things that can be improved). As you can see in https://github.com/me-no-dev/ESPAsyncWebServer/blob/f71e3d427b5be9791a8a2c93cf8079792c3a9a26/src/AsyncWebSocket.cpp#L550 , they limit the length of queue, and they define the max length of queue to 8 for ESP8266, you can check in https://github.com/me-no-dev/ESPAsyncWebServer/blob/f71e3d427b5be9791a8a2c93cf8079792c3a9a26/src/AsyncWebSocket.h#L30.

So if you want to send many messages through websocket rapidly, I recommand you make a temp storage. Or you can edit the ESPAsyncWebServer to solve this problem. By the way, I create a PR try to let user config the WS_MAX_QUEUED_MESSAGES (https://github.com/esphome/ESPAsyncWebServer/pull/10), hope it can be proved.XD

asjdf commented 1 year ago

If your problem is solved, you can close this issue. Or do you still have questions?

Bromiun commented 1 year ago

I am having the same problem, and it makes WebserLite quite unusable. The output appearing on the browser is good for the first few lines, then it gets totally garbled. I have the same problem with Webser non-lite, which points to the issue that you raised -- it being a problem with async websocket.

I will check your recommendation above, and if it does not fix the problem, I will be back.

Also, how do I make the window larger both horizontally and vertically. How can I do: "you should install NodeJS and pnpm first." ? I am using Arduino IDE on Windows. I also have access to VSCode.

Thanks!

asjdf commented 1 year ago

Also, how do I make the window larger both horizontally and vertically. How can I do: "you should install NodeJS and pnpm first." ? I am using Arduino IDE on Windows. I also have access to VSCode.

You can find that I put finalize.mjs under the frontend folder. This is a small tool I made for automated code generation. It is written in js, so you need a package manager ( I recommend pnpm) and an environment that can run js. If you don't know much about front-end knowledge or want to simplify the installation process, you can try to use scoop to help you install NodeJS and pnpm (scoop is a software manager under windows).

If you have any questions please feel free to ask and if this library helps you please give it a star, thank you😀.