WebSerial icon indicating copy to clipboard operation
WebSerial copied to clipboard

function onMessage dont works

Open tobiasfaust opened this issue 1 year ago • 1 comments

Hi, I tried your example Logging.ino as my first test with webserial. But it seems, the funktion onMessage dont works because i dont get the messages as real serial output. Output as webserial works. Do you imagine whats wrong? If web connection fails, i need the serial output as real serial output twice ;)

WebSerial.onMessage([](const String& msg) { Serial.println(msg); });

tobiasfaust avatar Aug 13 '24 08:08 tobiasfaust

Hi @ayushsharma82 it would be fine if you could take a look into this?

tobiasfaust avatar Aug 17 '24 16:08 tobiasfaust

@tobiasfaust I tested logging.ino example on my end and it still works. Message sent from WebSerial is begin printed in Serial. Please check your setup.

ayushsharma82 avatar Sep 04 '24 02:09 ayushsharma82

Hi @ayushsharma82 , thanks for your reply. For a real testcase close to your test

  1. i cloned your repo,
  2. correct a spelling mistake in platformio.ini mathieucarbou/ESP Async WebServer@^3.1.1 -> mathieucarbou/ESPAsyncWebServer@^3.1.1
  3. compile for esp8266
  4. upload, show serial monitor and webserial

and unfortunally, no change. perfect loggin in webserial, the last serial log shows me the first ip-Adress and no more

whats wrong? I havent further ideas...

webserial

tobiasfaust avatar Sep 04 '24 16:09 tobiasfaust

Okay, so I tested it on ESP32. There must be an issue with ESP8266 part of code. I’ll check that when I’ll get some time in my hands.

@mathieucarbou You wrote this callback, have any idea why it’s not working?

ayushsharma82 avatar Sep 05 '24 23:09 ayushsharma82

It works on ESP32.

@ayushsharma82 : it was fixed in https://github.com/ayushsharma82/WebSerial/pull/92 and released in 2.0.5. I think @tobiasfaust is not using the latest version. I am testing it with HighPerf.ino and it works fine.

image image

mathieucarbou avatar Sep 06 '24 07:09 mathieucarbou

For 8266: I saw some issues in the code. HighPerf mode does not compile. I am preparing a PR.

mathieucarbou avatar Sep 06 '24 07:09 mathieucarbou

ESP8266 works. Tested on D1 mini image image

mathieucarbou avatar Sep 06 '24 07:09 mathieucarbou

thank you, it works well now with ESP8266

tobiasfaust avatar Sep 08 '24 13:09 tobiasfaust

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 09 '24 06:10 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 14 '24 06:10 github-actions[bot]