forkineye / espasynce131 Goto Github PK
View Code? Open in Web Editor NEWAsynchronous E1.31 (sACN) library for Arduino ESP8266 and ESP32
Asynchronous E1.31 (sACN) library for Arduino ESP8266 and ESP32
Can someone give me a clue how to use this with ethernet? i am using a w5500 shield, fixed ip-adress (ping-able). the multicast won't start with e131.begin(E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT);
in Async_UDP, it uses igmp_joingroup, which returns a ESP_ERR_INVALID_STATE, that's what i found out so far. I don't know where to look now :/ Help is appreciated.
for better understanding: inside the initMulticast function, i changed this line: ifaddr.addr = static_cast<uint32_t>(Ethernet.localIP()); so it uses the ethernet ip instead of the wifi one. sadly it's not enough.
Thanks for a geat library!
When trying to compile the example sketch E131_Test.ino, I get the following compile error:
\Arduino\libraries\ESP_Async_E1.31/RingBuf.h:50:18: error: extended character “ is not valid in an identifier
50 | #warning “This library only fully supports AVR and ESP8266 Boards.”
The sketch comiles and runs fine on the core 2.7.4
Hi,
I'm currently working on functionality to add additional universes at runtime. Would you be interested in receiving a PR for this and if so, do you have preference for a particular naming convention?
Cheers
If this fails ->
pbuff = RingBuf_new(sizeof(e131_packet_t), buffers);
the problem is not caught. This causes a panic in isEmpty()
Thanks for the amazing library @forkineye!
This is not an issue, but rather an enhancement suggestion.
I've got a quite complex sketch called WLED for controlling WS2812b LEDs.
For ESP8266 at least, memory is very limited and using over 4kB of heap just for the buffer was not acceptable in my use case. So I removed the ring buffer and instead added a callback to the ESPAsyncE131::parsePacket
function that calls a method which directly writes the data to the LED output buffer. This reduces the memory usage of the library by 4466 bytes (buffers for 7 universes aka 1190 RGB LEDs).
It seems to work perfectly, at least for this use case.
Just wanted to let you know! If you are interested, here is my fork. (please note that I also removed the stats and error analysis code, as it was not relevant for my project)
Maybe the library could be enhanced by allocating 0
ring buffers, but instead have the user specify a callback.
The only real drawback I see with this is that all the processing has to be done in the callback, so doing anything time-intensive with the packet is of course not going to happen from system context. Are there other reasons for why you implemented the ring buffer?
Thanks once again for your hard work, this library is very useful!
What about parallel output such as arduino UNO's ports in esp8266(12e)?
If single pin can handle 700 led so far on Esp 01, is it possible to manage more pixel using parallel output?
According UDP connections data processing and FPS nearly about 25 to 30.
Hello, I was reviewing the example code and the readme. It states to create a buffer for each universe using:
ESPAsyncE131 e131(UNIVERSE_COUNT);
Where is am lost is how do I increment the universe when pulling packets in the following code? I see e131.pull but was not sure how to increment.
`e131_packet_t packet;
e131.pull(&packet); // Pull packet from ring buffer
Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n",
htons(packet.universe), // The Universe for this packet
htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data
e131.stats.num_packets, // Packet counter
e131.stats.packet_errors, // Packet error counter
packet.property_values[1]); // Dimmer data for Channel 1`
I am trying to write a simple piece of code for assessing frames per second processing, but I am lost on how to get to the last channel. For my code I will need to get to the last channel of the last universe, but I am unclear how to get there. I am sure it is simple, but unfortunely programming in Arduino language is not my strong point. Any help appreciated.
FYI I did try simply increasing the number 1 to the last channel I am sending from xlights, but that did not work.
Hi,
I'm a bit of a newbie with how arduino and the libraries work together and can't get the example in this fork to work.
I know that ESP32 uses #include <WiFi.h>
instead of #include <ESP8266WiFi.h>
like the ESP8266 does but I still can't compile the code.
This is what the console says:
Multiple libraries were found for "WiFi.h"
Used: C:\Users\bbsup\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi
In file included from C:\Users\bbsup\AppData\Local\Temp\arduino_modified_sketch_74994\ESP8266_Test.ino:22:0:
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
C:\Users\bbsup\Documents\Arduino\libraries\ESP_Async_E1.31/ESPAsyncE131.h:23:25: fatal error: ESPAsyncUDP.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board TTGO LoRa32-OLED V1.
When building on VSCode I get the error:
.pio\libdeps\FastLEDVirtual_5-Pin\ESPAsyncUDP\src\AsyncUDP.cpp:5:28: fatal error: user_interface.h: No such file or directory
Any suggestions?
Does this library allow for parsing of packets on devices with multiple network interfaces? Can't seem to find much in the way of the examples.
It looks like the E131 library did allow for this.
On the ESP32 the library will stop reading packets after a while. With one universe in unicast mode it happens randomly. With 10 universes it stops immediately. I tried increasing the buffer slots to 30 and it will stop receiving packets when I send 4 universes of data from xLights. I am using the ESP32 1.3 rc1 ardunio core with a manual edit to the "AsyncUDP.cpp" library to workaround the issue described here espressif/arduino-esp32#2685
Thanks,
Scott
Hello,
This has been already mentioned in #8 , I spent a significant amount of time trying to figure this out.
Basically the problem is with using ringbuffer which for some reason breaks ESP32 sooner or later. Apparently it's because of the way ESP32 uses multiple cores but I don't really knpw.
I am transferring a relatively large amount of data (24 universes), which works surprisingly well generally until it suddenly stops. It can happen within a few seconds or after a couple of minutes. The interesting thing is lot of other parts of the program still keep working and I have no clue why.
For a long time, I tried to fix the issue in my code, but eventually the warnings-
"This library only fully supports AVR and ESP8266 Boards."
"Operations on the buffer in ISRs are not safe!"
drew my attention I decided to get rid of ringbuffer. This took some time but once it was done there have been no issues even if I run at 60fps for hours.
I have a larger bytearray wsRawData in my code and am simply using memcpy in the callback like this -
void onNewPacketReceived(e131_packet_t* packet, void* userInfo) {
uint16_t offset = (htons(packet->universe) - 1) * CHANNELS_PER_UNIVERSE;
memcpy(wsRawData+offset, packet->property_values + 1, CHANNELS_PER_UNIVERSE); // +1 to skip the start code }
Here packet is sbuff (which I made public) not pbuff.
Now I don't know what's the best way to fix this for the library itself because my implementation is similar to #9 but it does force you to go to a lower level and deal with the data yourself which is not ideal.
I found this from Espressif but not sure how to implement this or if it's even possible.
Has anybody modified this to use WiFiManager so credentials do not have to be hard coded?
I use dynamically created object with
ESPAsyncE131 *e131; ... e131 = new ESPAsyncE131(UNIVERSE_COUNT);
and use it until necessary.
Next when I need to change params for object (for example amount of universe, start universe, etc.) I destroy object with delete[] e131
and try to re-create it and almost immediately have a crash with either wdt error or an error of access to invalid memory area.
I didn`t see in code of library any destructor and free buffers code.
Which is the correct way to destroy object and/or re-create it with changed parameters?
sorry to trouble but have include the espasynch library but when tring to compile arduino sketch keep getting the same error.
ESPAsyncE131.h:23:25: fatal error: ESPAsyncUDP.h: No such file or directory
#include <ESPAsyncUDP.h>
tried every thing but cant find a work through. read your comments for previous s=errors but didnt help me over come the error. trying to compile pinkyleds https://github.com/pinkywafer/PinkyLEDs
Hi,
I can't run the example with PlatformIO, what should i do?
I try doing sACN receiver by this and ESP32-S2, but I have 7 second delay on local network. I try to do on ethernet with W5500 (on ESPAsyncE131.h change #ifdef ESP32 #include <Ethernet.h> #include <EthernetUdp.h> #include <AsyncUDP.h> and some change in example code) and everything works fine (with one restart), but also I have 7 second delay from my lightpost. Where can be the mistake?
I need help to create 8 channel relay switch board using this library, want to controle those relay using Xlights.
Using example code I am able to recieve data from xlights to nodemcu in serial monitor. any one can provide code to run on nodemcu code to controle 8 channel relay and it would be great if you can suggest any framework for the same.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.