-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Performance drop on Wifi (30%) and BT (60%) with latest build? #2125
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
Comments
Have you tried to swap the boards in order to verify if it is not an issue with the hardware? |
I tried with several boards before, because i expected a hardware problem. It's clearly reproducable on different kind of hardware, the drop comes in when comparing code running on newest core. |
Im not saying it is, but it may be because change in SW coex settings as per my suggestion was changed to wifi performance. In other hand you report that both, bt and wifi performance drop. |
@chegawara my code does not send any data neither on BT nor on Wifi, it uses only the monitor mode for sniffing. I think 2-3ms is for sniffing a very long time, i guess the monitor mode packet capture driver on esp32 will run much faster. So we may see here a performance problem on low layer. Any ideas how to further analyze this? |
I would rather try to open issue in esp-idf repo, because like you said it can be in low level driver. |
I did intentionally open this issue here, because as far a i can see with platformio both my build version are based on same version of ESP-IDF core. So it looks like it must be something came in with latest changes in arduino-esp32 core. Maybe something which causes side effekt on esp32 drivers. |
@chegewara : could you please point me to the code affected by "change in SW coex settings as per my suggestion"? I would like try to check if this change could have impact on my use case. |
This is change in arduino-esp32 v1.0.1-rc1 im talking about: It changes some bt and wifi library, but i dont know how. |
@chegewara Thank you very much for this pointer. Since the change came in exactly at the same time when i discovered the issue in my software, i think it is the hot scent to the magic what happened. https://github.com/espressif/esp32-wifi-lib/blob/master/libcoexist.a |
@chegewara i tested different coexist settings by switching it during runtime with Maybe @nkolban can help here? |
Kolban is busy and is not working with esp32 or ble now. |
empirically saying: the best results for BLE scan here is when SW coexistence is fully disabled, using only HW switching (ie. it disables BLE for a while and use the radio for wifi, then disables wifi and uses BLE...), this doens't work for classical BT, only BLE+Wifi |
@copercini my sniffer is using Wifi+BT+BLE in parallel. How can disable SW coexist from within arduino-esp32 framework? |
@cyberman54 no, AFIK you can't use Wifi+BT without SW coexistence =/ |
Strange, because last version (1.0.0) was compiled with SW balanced. |
When i disable BT in new version, Wifi sniffing values climb to the same level as i see with previous version when Wifi + BT enabled. How can i set balanced coexist with new version, so that configuration of previous version is restored? |
@cyberman54 Maybe its not the SW settings problem, it can be change in esp-idf and SW setting enabled is affecting your app performance no matter what option is chosen. |
@chegawara i guess this is exactly my problem. But how can i solve this? The settings are in the precompiled libs, i guess? |
Do you use active BLE scanning? BLE needs to send out a scan request via radio, so this will be affected by any coexistence of Wifi.
… Am 01.12.2018 um 19:16 schrieb Verkehrsrot ***@***.***>:
@chegawara i guess this is exactly my problem. But how can i solve this? The settings are in the precompiled libs, i guess?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#2125 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIfahkJF-8SNTQIQ-3PY02K-Z8t4yLdnks5u0sd0gaJpZM4Y3n6J>.
|
@kscheff no, i do passive sniffing (not scanning!). My code does not transmit, so no active BLE scan. |
@cyberman54 you have 3 options:
|
@chegewara that means, there is no way to set SW balanced option during runtime?
but this does not seem to have any effect. |
@me-no-dev may i ping you on this problem? |
Additional finding: if i deactivate bluetooth in my app by NOT calling
then the board compiled with current (02.12.18) arduino-esp32 core version shows exactly the same Wifi sniffing results as the board compiled with previos core (before 26.11.18). If i enable bluetooth on the board with current core, using BT start code shown above, the Wifi sniffing results immediately lower by 30%, compared with board using old core running Wifi + BT in parallel. I think this proves that it is some kind of coexist side effect, not a performance issue. |
Looks like this was the change causing this problem: |
Maybe or maybe not, you cant know that without testing with old settings. Maybe performance drop is caused by esp-idf changes itself and with SW balanced performance drop will be even worse. |
@chegewara wara to test this i would need current build, but excluding commit #9233db8 . |
Use this sdkconfig in project: only you have to do is |
@chegewara so i am now set with my toolchain and can now compile libraries with tailored sdkconfig settings, thanks to your instruction. 👍 But which of the generated libraries shall i use for linking to my app? Only libesp32.a? |
Never been doing this, but i would start with all libraries from this: or at least those you think you need to change, like wifi, bt and coex. |
I am using the ESP32 to receive data via the scan response paket, so this requires an active scan. One strange observation is that the ESP32 seems to have a very limited receiving distance compared to an iPhone. So customers are unhappy with the narrow receiving range. But when the iPhone is doing an active scan, suddenly the ESP32 receives data in a greater distance radius. First I thought it is related to any other field disturbance, but it is reproducible... so this might also be related to the BLE (coex?) configuration. Therefore I need to dig into the same direction in order to overcome the limited range problem.
… Am 02.12.2018 um 23:45 schrieb chegewara ***@***.***>:
Never been doing this, but i would start with all libraries from this:
9233db8
or at least those you think you need to change, like wif, bt and coex.
There is few more people around here who has better knowledge in this topic.
@copercini @lbernstone
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I now have my toolchain ready to compile esp32 libs after customizing sdkconfig, so could start with testing szenarios. I made some slight progress in testing and want to share results. Test setup is: two same esp32 hardware boards, same external antenna (U.FL connected), same RF conditions (nearly the same, both antennas close together in a medium busy environment of moving Wifi/BT clients, around 100 per hour). Board A: fixed configuration; runs previous ardunio-esp32 core with coexist=no Test 1: B = coexist=yes (no libs modified), bluetooth enabled. Result: 30% loss on wifi, 60% loss on bt sniffing Test 2: B = coexist=yes (no libs modified), bluetooth enabled in sdkconfig, but disabled during runtime by calling btStop(). Result: 5-10% loss in wifi sniffing Test 3: B = coexist=no (libesp32.a changed), bluetooth enabled in sdkconfig, but disabled during runtime by calling btStop(). Result: same as A, no loss. So we have the proof, that the coexist setting in sdkconfig triggers this issue. But why? Could be I will try to go deeper in analysis. |
@kscheff iphone will probably have 2,4 GHz foil antenna inside. Those antennas usually have better dB level than the simple on chip pcb antenna of ESP32. So if you do active BT scan with iphone you will probably reach more bluetooth beacons in range than you would with ESP32 antenna. But ESP32 receives the answers of the BT clients, too. So far just theory, but would explain your finding and if valid this would not be caused by coexist software. |
On my side there are many ESP32 devices out in the field and I get reports that different firmware gets different results. But its far away from expected performance. Some devices do not even reach 5 meters. The issue here is that I have not good access and I have only access via the users (which are already a bit upset). The devices operate mainly in Bluetooth mode, but Firmware gets updated only via WiFi mode. So that’s why your findings might open up some tests on my side to play around with the same parameters. Thanks for sharing these.
… Am 04.12.2018 um 23:11 schrieb Verkehrsrot ***@***.***>:
@kscheff iphone will probably have 2,4 GHz foil antenna inside. Those antennas usually have better dB level than the simple on chip pcb antenna of ESP32. So if you so active BT scan with iphone you will probably reach more bluetooth beacons in range than you would with ESP32 antenna. But ESP32 receives the answers of the BT clients, too. So far just theory, but could explain you finding and if valid this would not be caused by coexist software.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@kscheff 5 meters range is sure far too low. |
@cyberman54 earlier version of arduino was compiled WITH SW coex but set to balanced. Could you try this option either since you already have prepared environment, please? |
@chegewara you're right, thanks for the hint. I will continue my test over weekend by reproducing the correct settings before and current. Changes in CONFIG_SW_COEXIST were: Does anyone here know the meaning of PREFERENCE_VALUE? I can't find anything on this, not in the ESP32 Docs, not with Google Search... In earlier version settings in sdkconfig are:
In current version it's:
|
|
okay, understood, VALUE is redundant NUM for preference setting. ENABLE {0, 1} * VALUE {0, 1, 2} During runtime we have option to switch BT on/off by btStart() / btStop(). So alltogether 12 options to test. I will try to full explore this over weekend. |
Actually only 4 options. |
We expect that it should be like that, but how do we know? coexist lib is not open sourced yet. |
Did the test by re-compiling libesp32.a with different settings in make menuconfig. Shows no effect at all. https://github.com/espressif/esp32-bt-lib/commits/master/libbtdm_app.a |
@cyberman54 This is what i am trying to suggest from beginning. |
@chegewara if i had listen to you, this would have saved me lot of time wasted on this :-( |
I would not say its waste of time. You learned how to use arduino as component, alos you can try to open issue in esp-idf repository. |
Allright, we close this here. It's an ESP-IDF issue. |
To complete this: I also tried build my code with all current (08th Dec 2018) libs of current esp-idf. Coexist then shows upgraded version 1.1.2, but the performance drop when wifi/bt sniffing in parallel persists, regardless of coexist settings in sdkconfig. If i disable bluetooth i get same wifi sniffing results i got before with previous version and wifi/bt sniffing operated simultaneously. Very bad :-( |
I am using this Arduino core for wifi and bluetooth packet sniffing on ESP32 devies, using monitor mode of ESP32 wifi stack and using ESP32 BT/BLE stack. The project can be found here.
I assessed that with latest build of arduino-esp32 core the overall performance on both wifi and bt sniffing decreased dramatically.
Test setup was 2 identical hardware boards with identical application software, but one build using arduino-esp32 core version 2.10000.0 (version number in platformio) and other one build using latest code of this repo by 26th Nov. 18.
The board build with latest code sniffs ~60% less bluetooth and ~30% less wifi devices compared with that one build on older code (under same conditions in same time).
I have no idea how to further analyze this. Since both BT and Wifi are affected this could mean a general performance drop on core 0 (running BT and Wifi stack), or a problem with the 2,4 GHz radio driver?
My code for bt and wifi sniffing can be found here:
Wifi sniffing
BT sniffing
The text was updated successfully, but these errors were encountered: