Been using Vixen via generic serial port (UART) and works perfect, but now want to to take it to the next level WiFi!
found forkineye’s github for using E131 (assuming vixen works with this protocol) but his fastLED is set to Ethernet
I whipped up a FastLED version, and wondering if anyone has tried to send data through Vixen via WiFi with a ESP-12E NodeMcu V3?
Does this look right for FastLED?
Code:
/
I modified an example from GitHub - forkineye/E131: E1.31 (sACN) library for Arduino with ESP8266 support
- This program is provided free for you to use in any way that you wish,
- subject to the laws and regulations where you are using it. Due diligence
- is strongly suggested before using this code. Please give credit where due.
The Author makes no warranty of any kind, express or implied, with regard
- to this program or the documentation contained in this document. The
- Author shall not be liable in any event for incidental or consequential
- damages in connection with, or arising out of, the furnishing, performance
- or use of these programs.
/
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <E131.h>
#include <FastLED.h>
const char ssid[] = “ssid”; /* Replace with your SSID /
const char passphrase[] = “password”; / Replace with your WPA2 passphrase /
#define NUM_PIXELS 170
#define DATA_PIN 3
E131 e131;
int initWifi() {
/ Switch to station mode and disconnect just in case /
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(secureRandom(100,500));
LOG_PORT.println(“”);
LOG_PORT.print(F("Connecting to "));
LOG_PORT.println(ssid);
WiFi.begin(ssid, passphrase);
uint32_t timeout = millis();
while (WiFi.status() != WL_CONNECTED) {
delay(500);
LOG_PORT.print(“.”);
if (millis() - timeout > CONNECT_TIMEOUT) {
LOG_PORT.println(“”);
LOG_PORT.println(F(“** Failed to connect *”));
break;
}
}
if (WiFi.status() == WL_CONNECTED) {
LOG_PORT.println("");
LOG_PORT.print(F("Connected with IP: "));
LOG_PORT.println(WiFi.localIP());
e131.begin(E131_MULTICAST, UNIVERSE_A, UNIVERSE_B - UNIVERSE_A + 1);
}
return WiFi.status();
}
void setup() {
LOG_PORT.begin(115200);
delay(10);
initWifi();
FastLED.addLeds<WS2811, DATA_PIN>((CRGB*)e131.data, NUM_PIXELS);
}
void loop() {
if(e131.parsePacket())
FastLED.show();
}
