Comments (5)
It's hard to tell.
How many Art-Net frames per second?
How many Art-Net channels?
Only one LED, just brightness up and down?
Can you share your code, maybe a snipped?
The onDmxFrame()
should only be a one-liner, am I right?
In many cases it's just bad WiFi.
from artnetwifi.
- I use QLC+ to send Art-net Data ; I think it sends data at 30 fps.
- Only 1 Art-Net channel, in one universe
- Yes, I send fade up and fade down signal.
Here's my code :
#include <ArtnetWifi.h>
#include <Arduino.h>
// PWM
const int freq = 5000; // 5000 Hz
const int ledChannel = 0;
const int resolution = 8; // Résolution de 8 bits
// LED COB RGBW
const int ledPinR = 15;
int ledValueR;
// WIFI
const char* ssid = "xxxxx";
const char* password = "xxxxx";
WiFiUDP UdpSend;
// connect to wifi – returns true if successful or false if not
bool ConnectWifi(void)
{
bool state = true;
int i = 0;
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("Connecting to WiFi");
// Wait for connection
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (i > 20){
state = false;
break;
}
i++;
}
if (state) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(IPAddress(WiFi.localIP()));
} else {
Serial.println("");
Serial.println("Connection failed.");
}
return state;
}
// ARTNET
ArtnetWifi artnet;
const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as 0.
const int numberOfChannels = 3; // Total number of channels you want to receive
// Check if we got all universes
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;
void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data) {
sendFrame = 1;
// range check
if (universe < startUniverse)
{
return;
}
uint8_t index = universe - startUniverse;
if (index >= maxUniverses)
{
return;
}
// Store which universe has got in
universesReceived[index] = true;
for (int i = 0 ; i < maxUniverses ; i++)
{
if (!universesReceived[i])
{
sendFrame = 0;
break;
}
}
if (sendFrame) {
// PWM
ledcWrite(ledChannel, data[1]);
// Reset universeReceived to 0
memset(universesReceived, 0, maxUniverses);
}
}
void setup() {
Serial.begin(115200);
ConnectWifi();
// ARTNET
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
artnet.begin();
// PWM
// Configure le channel 0
ledcSetup(ledChannel, freq, resolution);
// Attache le channel 0 sur les 3 pins
ledcAttachPin(ledPinR, ledChannel);
}
void loop() {
// ARTNET
// we call the read function inside the loop
artnet.read();
}
If you think it might be the bad wifi, I would try to create a wifi access point with another ESP32.
from artnetwifi.
I tried to connect my PC & the esp32 to an esp32 wifi access point ; this doesn't work either.
from artnetwifi.
There is nothing wrong with the code.
I can reproduce the "error" only if my PC (Art-Net transmitter) is also connected via WiFi.
With a cable connection to my PC I don't see a problem at all. A test ran over many hours flawlessly.
So, as I said, bad WiFi is the problem in my opinion.
from artnetwifi.
I'm also having a similar delay problem -- my Artnet transmitter (PC program) is on ethernet, but sometimes it takes 20 seconds or more for the ESP32 to receive the DMX changes. And then sometimes it's immediate, so it's a very strange intermittent problem.
I'm sure it's not this library, but my question is-- where are those Art-Net packets going for 20 or 30 seconds before the ESP32 receives and processes them?
from artnetwifi.
Related Issues (20)
- startUniversity > 2 causes problems HOT 2
- Add buffer for 3 frames HOT 1
- LED strip stops working after some time with high FPS HOT 4
- LED state on receiving and not receiving HOT 1
- DMX-Workshop won't detect this HOT 4
- Send channels from 510 to 512
- I found an "ERROR" in your library with the software I'm using. HOT 3
- receive and transmit simultaneously HOT 2
- Const variables to Int variables HOT 2
- Unable to make a Artnet to DMX with esp_dmx HOT 4
- LED Panels Only Receiving Broadcast Artnet HOT 1
- BW16 (RTL8720DN) HOT 2
- add active universe in short name string HOT 1
- Add stop() function HOT 2
- Multiple ESP32 boards on one Universe with offset start adress HOT 1
- Error HOT 2
- Artnet Wifi connection lagging HOT 2
- Send Artnet to many host HOT 2
- error with #include <functional> HOT 3
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 artnetwifi.