-
Notifications
You must be signed in to change notification settings - Fork 17
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
Poor performance over WiFi on ESP32 #41
Comments
I think this may be related to this issue. Perhaps you can try the suggestion made there? |
Did this solve your problem? |
No. Adding |
The problem is on the computer side, at least it was when I ran into this issue. Apparently, short messages are bundled in one package for efficiency reasons. This may be beneficial for high throughput applications, but not for low volume, low latency applications like the ones we have. Which library do you need to alter? If it is the I also found this note I made a while ago. Perhaps you can try to add this to the top of your script? |
The following modification gives a significant performance gain. from serial.urlhandler import protocol_socket
protocol_socket.time.sleep = lambda x: None
from simple_rpc import Interface
with Interface('socket://REPLACE_IP:1025') as interface:
last_millis = 0
while True:
millis = interface.millis()
if last_millis > 0:
print(millis - last_millis)
last_millis = millis Example: $ python test.py
71
55
66
83
56
153
56
57
56
57
58
71
... |
I will close this issue for now. Please feel free to reopen it if the problem persists. |
It appears to take about ~300 ms to call one RPC over WiFi. I'm using an Adafruit ESP32-S2 TFT Feather board.
Arduino code:
Using a quick script to query
millis()
continuously:results in approximately 300 ms between timestamps from the Arduino:
Trying something similar using
Serial
instead ofWiFiClient
as theStream
interface for the RPC results 0-1 ms between calls. Is there something that can be done to improve the latency?The text was updated successfully, but these errors were encountered: