Comments (6)
From what I see, the TX buffer on the esp side is full. Most probably the air data rate cannot keep up with the resolution/FPS and you get a lot of frame drops.
In your log, you can see the TX buffer percentage as 94-97%, which is a lot. It should hang at around 0-20% with occasional spikes.
What data rate are you using?
from esp32-cam-fpv.
When logging the rate using:
LOG("WLAN S: %d, R: %d, E: %d, D: %d, %%: %d || FPS: %d, D: %d || D: %d, E: %d, WIFI_RATE: %d\n",
s_stats.wlan_data_sent, s_stats.wlan_data_received, s_stats.wlan_error_count, s_stats.wlan_received_packets_dropped, s_wlan_outgoing_queue.size() * 100 / s_wlan_outgoing_queue.capacity(),
(int)s_stats.video_frames, s_stats.video_data, s_stats.sd_data, s_stats.sd_drops, get_wifi_fixed_rate());
It gives: WLAN S: 50184, R: 0, E: 0, D: 0, % : 97 || FPS: 25, D: 629476 || D: 0, E: 0, WIFI_RATE: 13
,
13
corresponds to RATE_G_54M_ODFM
.
This is confirmed by WireShark:
Seems plenty fast to me, weird that the TX buffer is getting filled then.
from esp32-cam-fpv.
In this last log, it's even worse: It's trying to send ~600K of data per second, and it only manages 50K.
My guess is that due to the very noisy environment, it cannot find enough free air capacity to send the data. AFAIK the esp still checks for other wifi traffic before sending, even in package injection mode.
Try a different channel or modulation. Faster rates might give you better results as they occupy less air time, therefore less chances of collisions.
I also did all my tests at home in a super noisy environment and had to choose a more or less free channel to get anything reliable, or drop the FPS/resolution to reduce the air time as much as possible to get good results.
Try MCS7 for the data rate, at a lower resolution and watch for buffer overflows. You should be able to tune it for good performance.
Note that the firmware doesn't do any sanity checks if you try to fit too much data through the air. There should be some checks added to the ground station when the air rate is too low for the selected resolution/fps combo, but I never got around to adding these.
from esp32-cam-fpv.
Your logic makes total sense, but when I run the iperf example, using a softAP I get:
[ 1] 0.0000-60.0055 sec 87.8 MBytes 12.3 Mbits/sec
So that is way more. But when I manually send packets using espnow, I again get max ~80 KB/sec. When running iperf when connected to my regular WiFi I get a bit less performance:
[ 3] 0.0000-59.9971 sec 47.6 MBytes 6.66 Mbits/sec
Still way better than the raw sending. Very weird if you ask me.
from esp32-cam-fpv.
I got it working! Turns out I need to touch the backside of the esp32 antenna, and then it starts sending quite well, although still not perfect. You can't really make this stuff up. I'm getting up to 30 FPS but not much beyond, also got really intermittent latency.
from esp32-cam-fpv.
I think that when you touch the backside, you're 'muting' all other noise in the air, so the ESP cannot receive much else, and it thinks it's quiet out there, therefore sending all of its data.
You could try to put it in a faraday cage (microwave, aluminum foil, smth) and see if that improves performance.
from esp32-cam-fpv.
Related Issues (20)
- esp-idf 4.3 + latest code(56ee43e) constantly reboot HOT 14
- Makefile with specific dir, which is NOT avaliable HOT 2
- Is it possible to run the gs program on laptop? HOT 2
- gs compiles ok, but it doesn't work properly HOT 9
- gs get stuck full cpu and no popup window. HOT 1
- latest code(9610792) no video on RPI Window HOT 35
- Undefined reference issues when compiling gs code. HOT 14
- Milestone for airunit-firmware and gs desktop program (requested.) HOT 8
- Mouse Y-Axis Offset bug HOT 2
- VFPS and stucky problems HOT 14
- IDF4.4.4 sd_enqueue_proc stack issue HOT 2
- Any idea to improve the low latency when using higher resolution HOT 1
- Idea for exposing the raw video stream on a GPIO pin. HOT 1
- Laptop build HOT 14
- Problem while running make -j4 HOT 1
- What Range can we expect with this setup
- OpenGL Shader errors when running on AMD64 Ubuntu 23.04 HOT 1
- `esp_wifi_config_80211_tx_rate` not declared HOT 1
- Error in pcap_activate: That device doesn't support monitor mode HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-cam-fpv.