GithubHelp home page GithubHelp logo

asjdf / webseriallite Goto Github PK

View Code? Open in Web Editor NEW
59.0 4.0 12.0 53 KB

Super lightweight remote serial monitor for ESP8266 & ESP32 (frontend <3k)

License: GNU General Public License v3.0

C++ 20.01% C 34.59% JavaScript 9.14% HTML 36.26%
arduino esp32 esp8266 webserial

webseriallite's Introduction

WebSerialLite

WebSerial is a Serial Monitor for ESP8266 & ESP32 Microcontrollers that can be accessed remotely via a web browser. Webpage is stored in program memory of the microcontroller.

Preview

Preview

DemoVideo

Upgrade to Pro?

I'm sorry that the current version is already the Pro version. XD

Features

  • Works on WebSockets
  • Realtime logging
  • Any number of Serial Monitors can be opened on the browser
  • Uses Async Webserver for better performance
  • Light weight (<3k)
  • Timestamp
  • Event driven

Dependencies

For ESP8266:

  • ESP8266 Arduino Core - (latest)
  • ESPAsyncTCP - v1.2.2
  • ESPAsyncWebServer - v1.2.3

For ESP32:

  • ESP32 Arduino Core - (latest)
  • AsyncTCP - v1.1.1
  • ESPAsyncWebServer - v1.2.3

Documentation

WebSerialLite is very similar to the default Serial Monitor Library of Arduino.

Please see Demo examples for better understanding on how to setup WebSerialLite for your Project.

WebSerialLite has 2 main functions:

  • print
  • println

print - simply prints the data sent over WebSerialLite without any newline character.

println - prints the data sent over WebSerialLite with a newline character.

Both functions support the following datatypes: String, const char, char, int, uint8_t, uint16_t, uint32_t, double, float.

To Access WebSerialLite: Go to <IP Address>/webserial in your browser ( where <IP Address> is the IP of your ESP).

FAQ

  1. last println not being received #4

    This issue is not caused by this library. 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 recommend 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 (esphome/ESPAsyncWebServer#10), hope it can be proved.

Contributions

Every Contribution to this repository is highly appreciated! Don't fear to create pull requests which enhance or fix the library as ultimately you are going to help everybody.

License

WebSerialLite is licensed under General Public License v3 ( GPLv3 ).

webseriallite's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

webseriallite's Issues

Window size

Thank you for this great piece of software.

How can I increase the window size on the browser both horizontally and vertically?

And why is the page code in binary?

Thanks
Bromium

many calls of WebSerial.println in a row causes problems

Hi,
Brilliant libary!

I had big problems with stuttering output at the beginning.
Especially when many WebSerial.println came in a row in the skipt:

WebSerial.print ("Measurement_count: );
WebSerial.println (Measurement_count);
WebSerial.print ("Unix-Time: ");
WebSerial.println (now);
WebSerial.print ("Records in cache: );
WebSerial.println (queue.size());

After replacing this with the following, it worked better:

snprintf(printbuffer, sizeof(printbuffer), "Measurement_count: %i \nUnix-Time: %ld \nRecords in cache: %i", Measurement_count, now, queue.size());
WebSerial.println(printbuffer);

Also, I think it is very important to make an adjustment to the AsyncTCP:
me-no-dev/AsyncTCP#121
Without this change it kept crashing every few hours.

A MAJOR PROBLEM - Each page reload takes the free heap down to zero

Each page reload takes the free heap down to zero
When I run the demo code, each reload causes the freeheap value to decrease by 1-2 kB. When the value gets close to zero (15x reloads approximately), it causes a loss of function and then eventually a restart of the ESP8266 with an OOM error. Everything can be seen in the picture. How to solve this problem?

oom error no free heap

Access websocket on port not equal 80

You might want to use
let gateway = ``ws://${window.location.host}/webserialws``;
instead of
let gateway = ``ws://${window.location.hostname + window.location.port + window.location.pathname}/webserialws``;

That combination of hostname, port and pathname is not working at all, even on port 80, it tries to access /webserial/webserialws

Login / password

Is there an option to add at least some simple security in the form of a password, or login and password?

frontend

Can i have a frontend folder to upgrade function?

Clear command field after sending

I think it would be nice to clear the command 'line' after sending it...
by adding:

document.getElementById("command-text").value=""

in the sendCommand function (in the encrypted WebSerialWebPage.h)

To clarify: I use the commend line for multiple purposes and often forget to clear it, which results in concatenating the 'new' command I want to send with the previous one, resulting in something that is not recognized mostly (and IF recognized, not what I wanted probably :-) )

Issue with the Terminal

Hi Atom - Issue #4 did not show up, although I got several errors on the serial monitor that
"ERROR: Too many messages queued". However, it did not appear data was dropped.

Another issue. Terminal is too slow.

Where does console.log() output go?

Is there a JS function to put the data on the browser screen, instead of the Terminal?
Even better, is there a way to direct WebSocket output to the browser screen rather than to JS?

Thanks
Bromium

last println not rebeing recieved..

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."

double time output

Hi,

can you please change the double time issue? Left is sufficient. The time does not have to be repeated at the end of each line. Can you please correct this? That would be very nice.

WebSerial 2x time

Issues and improvements

Hello!

  1. The window cannot be expanded on a mobile device
  2. The top interface buttons do not work in Chrome under iOS.
  3. It would be nice to indicate on the project page that to access the page with the log you need to write /webserial at the end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.