Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing Issue - Need delay between multiple WebSerial.println commands #65

Closed
JMWilton opened this issue May 26, 2023 · 6 comments
Closed
Labels

Comments

@JMWilton
Copy link

When executing the following code:
WebSerial.println(WiFi.localIP());
//delay(500);
WebSerial.println("joe was here");
// delay(500);
WebSerial.println("this is now");

The output is:
image

When executing the following code:
WebSerial.println(WiFi.localIP());
delay(500);
WebSerial.println("joe was here");
delay(500);
WebSerial.println("this is now");

The output is:
image

It appears that subsequent WebSerial.println commands overwrite the previous WebSerial.println command if there is an insufficient delay. It would be expected that no delay should be necessary.

@JMWilton
Copy link
Author

JMWilton commented Jun 6, 2023

I have implemented a workaround:
int SerialMonitorDelay = 0;
template void SerialMonitor_Println (T param) {if (SerialMonitorDelay>0) {WebSerial.println(param); delay (SerialMonitorDelay);}} // Workaround to eliminate overwriting previous output
template void SerialMonitor_Print (T param) {if (SerialMonitorDelay>0) {WebSerial.print (param); delay (SerialMonitorDelay);}} // Workaround to eliminate overwriting previous output

SerialMonitorDelay is set to a non-zero value via a message from the client web page. This eliminates a delay if no client is attached. The delay can be controlled by the value sent from the client page. Monitoring can be turned back off by sending a zero value.

@asjdf
Copy link

asjdf commented Jun 8, 2023

I thought you just fill the send-queue. This issue wasn't caused by this lib.

@JMWilton
Copy link
Author

JMWilton commented Jun 8, 2023

I now suspect that the html receive event code might be reentered before it finishes its work.

@asjdf
Copy link

asjdf commented Jun 9, 2023

I thought this issue might be help

asjdf/WebSerialLite#4 (comment)

Copy link
Contributor

github-actions bot commented Jun 4, 2024

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 github-actions bot added the Stale label Jun 4, 2024
Copy link
Contributor

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants