Comments (8)
the async lib is connected directly to the network stack and it gets it's data through callbacks. I do not think that those callbacks are interrupt based or we would not have had the need to call yield.
As for the WS2812B, what lib are you using and how is it pumping the data to the pixels? I2S, UART or bitbang?
The regular stuff (non-async) works much the same, but it's waiting for all the data to come instead of getting it as it comes, so maybe some yield is causing the network to spend time in a moment where the pixels should be getting data.
from espasyncwebserver.
Thanks, good to know about stack.
I'm using latest neopixelbus with bitbang800KHz for WS2812. I will investigate on this issue later, something to learn about Async since I'm using the whole, including, WebSocket, ArduinoJSON, SPIFFS, ....
By the way not sure if it's related but now calling WifI.scanNetworks() returns 0, did you noticed that point ? (But I'm connecting to my AP without any problem)
int n = WiFi.scanNetworks();
// Just to debug where we are
Debugf("found %d networks!",n);
Another question, from WebSocket handler, how to get the client IP from AsyncWebSocketClient * client ?
from espasyncwebserver.
yeah... need to add access to the client IP/Port...
as for WiFi.scanNetworks() do not call it inside async callbacks or run it in async mode and check for the result. If you are not calling it from there, then I have no clue
from espasyncwebserver.
here is access to IP/Port
8dfd328
from espasyncwebserver.
maybe you should try Uart or DMA mode for the pixels, since they have buffers to smooth things out :)
from espasyncwebserver.
yeah, but with GPIO of my project I can't use DMA or Uart.
But anyway, in fact LED are working fine (controlling them) it's just the animation (breathing) that seems impacted.
NeoPixel animation is run in main loop lot of time and I suspect Async task could sometime slow down main task and miss some breathing steps. I need to check this point, mainly the example I'm using is this one from NeoPixel Examples.
https://github.com/Makuna/NeoPixelBus/blob/master/examples/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino
I will merge basic AsyncWebServer into this sample just to see. My main project is so big and doing so much stuff that's it's difficult to isolate such kind of issues.
Anyway, thank you very much for you help
from espasyncwebserver.
yes, I suspect the animation is yielding somewhere and that switches the context and causes delay in between commands
from espasyncwebserver.
@me-no-dev
I've done some test, that's strange, on the main loop I'm calling a function so set builtin led and read on board switch (setting GPIO0 input, read it and setting back to output).
On board switch is on GPIO0 shared with WS2812, until async no flickering pb.
I tried to start/stop animation when realing GPIO as also disable/enable interrupts, but nothing really worked.
Anyway, not really an issue I've commented out the code that was reading GPIO0 and now all works fine with RGB Led and AsyncWebServer
Not sure to understand what the source of the problem but always not really good idea to share pin
Here my code for information
/* ======================================================================
Function: handle_key_led
Purpose : Manage on board Led and Push button of NodeMCU
Input : true to light on the led, false to light off
Output : true if button is pressed
Comments: on NodeMCU BUILTIN_LED is GPIO16 and switch (Flash) on GPIO 0
====================================================================== */
uint8_t handle_key_led( uint8_t level)
{
uint8_t btn=true;
digitalWrite(BUILTIN_LED, 1);
pinMode(BUILTIN_LED, OUTPUT);
digitalWrite(BUILTIN_LED, !level);
//animations.Pause();
//noInterrupts(); // Need 100% focus on instruction timing
// Flash is on GPIO0, so RGB LED
//pinMode(0, INPUT);
//btn = digitalRead(0);
//pinMode(0, OUTPUT); // set back to output
//interrupts();
//animations.Resume();
return !btn;
}
from espasyncwebserver.
Related Issues (20)
- fragmentation
- ESP8266 goin down when get JSON string. HOT 1
- where i can get request if i mast send JSON to all connected clients by timer ?! no good exapmles no information! HOT 2
- Serving SPIFFS from a subdirectory raises 500 status code on some files HOT 1
- error: cannot bind non-const lvalue reference of type 'ArduinoJson::V704PB2::JsonObject&' to an rvalue of type 'ArduinoJson::V704PB2::detail::enable_if<true, ArduinoJson::V704PB2::JsonObject>::type' {aka 'ArduinoJson::V704PB2::JsonObject'} HOT 1
- abracadabra in serial HOT 1
- after long time 8+ i have spam in serial
- AsyncWebServerRequest Questions HOT 2
- Send content with beginChunkedResponse
- Question: is it possible to replicate AsyncWebSocket with WebServer in arduino-esp32 v3.0.0 ? HOT 4
- AsyncWebServer Questions HOT 6
- Images won't load randomly
- Compiling issues HOT 7
- I Can't make the web explorer to offer to save credentials
- Change bool AsyncStaticWebHandler::canHandle to use exact match instead of String::startsWith(_uri)
- small ddos (press F5) crash: async_tcp ....watchdog got triggered
- Compilation Error for Newer ESP32 HOT 3
- possible memory leak at send_p?
- Forwarding Webserver with websockets
- Get new client ID at every refresh :( HOT 1
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 espasyncwebserver.