-
I thought it would be a good idea to be able to test the WiFi code myself, so I purchased an Esp32 DevKit v1. This board has both WiFi and Bluetooth on board. New examples can be found here: @chrisflesher I used your example as a template, but I noticed a couple of things while testing the WiFi interface using the test code below. Perhaps you can help me.
Test code:
|
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 3 replies
-
I think I was able to get ~100 function calls per second by patching pyserial as you suggested. Before the patch I was getting ~3 calls per second which seems similar to what you are getting, maybe the patch is not working as expected on your machine? |
Beta Was this translation helpful? Give feedback.
-
I tried the following program just now with latest
|
Beta Was this translation helpful? Give feedback.
-
It might be the specific implementation for your microcontrollers Serial.h
file of readBytes?
…On Thu, Jan 21, 2021, 12:52 PM Jeroen F.J. Laros ***@***.***> wrote:
I traced the problem down to Serial.readBytes(), which takes about 240ms
to complete in this setup. I will try to see if I can reproduce this in
isolation.
The strange thing is, that the Bluetooth example works fine, so it is not
something deep in de ESP32 libraries.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKFJ2VO5YG2UX6IFIKGZD3S3BZWNANCNFSM4WLL2BLA>
.
|
Beta Was this translation helpful? Give feedback.
-
It doesn't look like it, it is not consistent. When I look at the network traffic, there is a long period between sending a command (requesting an RPC method) and receiving the acknowledgement. The subsequent sending of the parameter values and the return values are fast. My guess is that there is something going on with the serial-over-tcp code specifically. I will do some more debugging tomorrow. |
Beta Was this translation helpful? Give feedback.
-
One idea is to flash an LED when you receive the data to see where the
delay is occouring. This was helpful for me when debugging the issue
previously.
…On Thu, Jan 21, 2021 at 4:59 PM Jeroen F.J. Laros ***@***.***> wrote:
It doesn't look like it, it is not consistent.
When I look at the network traffic, there is a long period between sending
a command (requesting an RPC method) and receiving the acknowledgement. The
subsequent sending of the parameter values and the return values are fast.
My guess is that there is something going on with the serial-over-tcp code
specifically. I will do some more debugging tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKFJ2SSQZRSIYGIXQQ6FWLS3CWWRANCNFSM4WLL2BLA>
.
|
Beta Was this translation helpful? Give feedback.
-
I am using this snippet to do some rudimentary timing analysis. Fortunately I have the luxury of having multiple communication devices on this board. |
Beta Was this translation helpful? Give feedback.
-
Not sure if I'm helping but some other ideas for debugging:
- Using wireshark to see when ethernet packets are arriving
- Investigating the arduino-simple-rpc write process, if it is writing multiple small packets it may speed things up to combine them into one large packet before transmitting?
- Investigating the ESP32 WiFi implementation of `readBytes`
|
Beta Was this translation helpful? Give feedback.
-
I was using wireshark for the network traffic analysis and I indeed noticed that the data is highly fragmented. Although this does not seem to be the source of the problem, it is something to look into at a later stage. To give you an impression, this is the pattern I see when calling
So from this perspective, it looks like the first call to When I look at the timings on the board, I see the following:
From this perspective, the second call to So it seems that the first call to |
Beta Was this translation helpful? Give feedback.
-
I filed a bug report for this issue. |
Beta Was this translation helpful? Give feedback.
-
The issue was solved. |
Beta Was this translation helpful? Give feedback.
The issue was solved.