Comments (9)
My guess is that the problem is caused by the scheduling of the necessary tasks which need to run to make WiFi work
By default, the tick-rate (see https://github.com/esp-rs/esp-wifi/blob/main/esp-wifi/docs/tuning.md and
Line 92 in a69545d
cfg.toml
) and see if that is enough to get it workingfrom esp-wifi.
It looks like it helps a little bit, although it's hard to tell for sure. Even at 1 Hz it still flickers. I've recorded two videos to give a better idea of what it looks like.
100hz.mp4
1hz.mp4
from esp-wifi.
I could imagine increasing the tick rate might help. There might still be problems if some code is run in a critical section which will delay switching to the main task but it might help
IIRC in the very beginning the default was even 1000 Hz
The thing here is that with a very high tick rate the CPU will spend a lot of time in just switching tasks but it takes longer until each task gets a chance to run
from esp-wifi.
RMT is very timing-sensitive, as @bjoernQ is suggesting. In esp-idf there are configuration options to store the RMT code in RAM, so that cache misses don't interrupt the transmission (we don't have an equivalent in Rust yet :(). Increasing the priority might also help here, but as @bjoernQ mentioned if there are long critical sections there will still be flickering.
from esp-wifi.
In esp-idf there are configuration options to store the RMT code in RAM, so that cache misses don't interrupt the transmission
What do you mean here? I’m new to ESP and haven’t used IDF. My understanding is that the hal blocks on the transmission and copies new data into the peripheral’s ram while the transfer is going on (which should mayhaps happen in an interrupt?). Is there another place to store the data for the peripheral to use?
from esp-wifi.
Is your code open source? It might be easier to help if we can see the code. Other than that I can only suggest general advice.
from esp-wifi.
Yeah, here it is: https://github.com/darkwater/home-leds
firmware/src/main.rs
initializes esp-wifi amongst other things, and the call to RMT::transmit()
is in firmware/src/ws2812_driver.rs
from esp-wifi.
A simple fix might be to run https://github.com/darkwater/home-leds/blob/48f39c9e8b55ffb0704709e077bdb8b5e3c09aa0/firmware/src/ws2812_driver.rs#L79 in a critical section - it should be fast enough to not interfere with esp-wifi
from esp-wifi.
Thanks, that does solve the flickering. I'll open an issue on the hal repo because that logic should probably be done in an interrupt handler, or at least documented to be susceptible to interference.
from esp-wifi.
Related Issues (20)
- esp-wifi 0.3.0 does not compile for ESP32-C3, it depends on portable-atomic, and that doesnt build for RiscV HOT 5
- How to depend on esp-wifi in an external example HOT 3
- Long async ping time when idle HOT 3
- example/embassy_ble does not compile HOT 2
- esp-wifi lockup on esp32c3 when using the embassy InterruptExecutor HOT 3
- multiple definition of malloc, calloc, and free when used together with other crates providing them HOT 3
- [ESP32] esp-wifi crashes when trying to connect via BLE HOT 6
- NVS initialization error HOT 1
- ps-min-modem / ps-max-modem not working on esp32c3 HOT 2
- Blocking socket API need to implement `ReadReady` / `WriteReady`
- compile error HOT 2
- W (42148) wifi:m f null Getting This warning and then wifi is never reconnected in the execution HOT 1
- esp32c6 uses only password while config AuthMethod:None HOT 3
- Example code for my c6 chip has no println output
- Critical section feature conflict between esp-wifi and esp-idf-hal HOT 3
- #[interrupt] macro has been removed from esp-hal-procmacros HOT 6
- H2: Don't try to use `phy_bbpll_en_usb` HOT 1
- docs.rs failed to build HOT 3
- HTTPS support HOT 2
- [RISCV] Stable esp-wifi HOT 2
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 esp-wifi.