Hi @flowb ,
Thank you so much for your previous reply—fixing that error resolved the issue, which I really appreciate!
However, I’m running into a new challenge. With my original file, I was getting light output from the LEDs, but after making the change, none of the LEDs light up anymore.
I assumed my Artnet node would automatically accept all the universes and distribute the DMX data across the available LEDs. But since no LEDs are lighting up, I suspect this might be an addressing issue.(?)
Does anyone have any advice or insights into what might be going wrong? I’d be really grateful for your help!
Thanks in advance for your time and support!
The teensy code:
#include <Artnet.h>
#include <NativeEthernet.h>
#include <NativeEthernetUdp.h>
#include <SPI.h>
#include <OctoWS2811.h>
#include <FastLED.h>
// To help with logevity of LEDs and Octo Board
// Brightness is set to ~50%
#define BRIGHTNESS 150
// Throttling refresh for when using 24+ universes
// ie. 510 leds / 3 universes per pin
#define FRAMES_PER_SECOND 30
// Turn on / off Serial logs for debugging
#define DEBUG 0
// OctoWS2811 settings
const int numPins = 8;
// These are the Octo default pins, can be changed as needed
byte pinList[numPins] = { 2, 14, 7, 8, 6, 20, 21, 5};
// Equivelent to 2 DMX universes
const int ledsPerStrip = 190; //20=1universe
// Octo will always have 8 strips
// Just recasting num of pins as strips for clarity below
// change for your setup
const byte numStrips = numPins;
const int numLeds = ledsPerStrip * numStrips;
// Total number of channels you want to receive (1 led = 3 channels)
const int numberOfChannels = numLeds * 3;
// Define your FastLED pixels
CRGB rgbarray[numPins * ledsPerStrip];
// Memory buffer to artnet data
DMAMEM int displayMemory[ledsPerStrip * numPins * 3 / 4];
int drawingMemory[ledsPerStrip * numPins * 3 / 4];
// Initialize Octo library using FastLED Controller
OctoWS2811 octo(ledsPerStrip, displayMemory, drawingMemory, WS2811_GRB | WS2811_800kHz, numPins, pinList);
template <EOrder RGB_ORDER = GRB,
uint8_t CHIP = WS2811_800kHz>
class CTeensy4Controller : public CPixelLEDController<RGB_ORDER, 8, 0xFF>
{
OctoWS2811 *pocto;
public:
CTeensy4Controller(OctoWS2811 *_pocto)
: pocto(_pocto){};
virtual void init() {}
virtual void showPixels(PixelController<RGB_ORDER, 8, 0xFF> &pixels)
{
uint32_t i = 0;
while (pixels.has(1))
{
uint8_t r = pixels.loadAndScale0();
uint8_t g = pixels.loadAndScale1();
uint8_t b = pixels.loadAndScale2();
pocto->setPixel(i++, g, r, b);
pixels.stepDithering();
pixels.advanceData();
}
pocto->show();
}
};
// Artnet settings
Artnet artnet;
// CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as 0.
const int startUniverse = 0;
// Check if we got all universes
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;
int previousDataLength = 0;
// Change ip and mac address for your setup
// on macos, this mac address is for local host "ether" address
// for me this was the mac address of `en0`
// If using a Pi, you'll want to change it to the Pi's mac address. Remember to update when changing devices or enviriments
byte mac[] = {0x3c, 0x22, 0xfb, 0x87, 0x16, 0x1b};
// Network IP addresses
// On mac using a ethernet dongle, the IP is configured in the OSX network settings.
// You wanna set the IP you set for the dongle as the IP here.
// For every device, the IP will be different. Make sure to update when changing devices or enviroments
//byte ip[] = {10, 0, 0, 20};
//byte ip[] = {192, 168, 1, 12};
byte ip[] = {169, 254, 216, 100};
// From Blinky Light's blog to allow for Fast LED integration + Pin selection
// https://blinkylights.blog/2021/02/03/using-teensy-4-1-with-fastled/
CTeensy4Controller<GRB, WS2811_800kHz> *pcontroller;
void setup()
{
Serial.begin(115200);
Serial.println("Studio Jordan Shaw");
Serial.println("Teensy OctoWS28 Artnet Node");
Serial.println("=================");
Serial.println("Version: V0.2.1");
artnet.begin(mac, ip);
octo.begin();
pcontroller = new CTeensy4Controller<GRB, WS2811_800kHz>(&octo);
FastLED.addLeds(pcontroller, rgbarray, numPins * ledsPerStrip).setCorrection(TypicalLEDStrip);
FastLED.delay(1000/FRAMES_PER_SECOND);
initTest();
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
}
void loop()
{
// we call the read function inside the loop
artnet.read();