Hello everyone, I have a question about Teensy 4.1, Ethernet, Art-Net and OctoWS2811.
I started with an Arduino Mega 2650 and was able to output two universes each with an Ethernet shield on two pins. Then I noticed that the computing power was nowhere near enough and compared several boards and ended up with the Teensy 4.1. I use this with an Ethernet kit which is also sold via pjrc. Now I have adapted my code a little and am stuck with the following problem:
The code won't compile - I keep getting error messages saying that something is being initialized twice. If I comment out the Ethernet.h library (and also the EthernetUDP.h ) my code compiles and is uploaded. Logically, I can't receive Art-Net then - so my LEDs remain dark. I tried to switch to a different Ethernet library - NativeEthernet, and the NativeEthernetUDP to go with it. The code then compiles but I don't get a signal on any subnet in any universe. The only thing I see is the pattern that is generated by the init() function.
I loaded the OctoWS2811 basic test without Art-Net, modified it and tested it with 3 strips. That worked, which means that my strips are wired correctly.
I also tried working without the OctoWS2811 library.
I wrote everything together by hand (the hardest part was probably how to receive subnet data). The problem with this solution, which worked quite well, was that I had individual if loops and I think these are processed one after the other. So everything arrived slightly later on the second than on the first and everything arrived again later on the third than on the second and so on.
My questions:
Is it true that the OctoWS2811 library in conjunction with the appropriate adapter assigns the pins on the Teensy itself? So strip one with length X on pin 2...
How do I regulate in the programming that subnet 1 universe 0 arrives at pin 7 (out 3)? Since you can send a maximum of 16 universes per subnet, it should look like this schematically: Out 1 - Pin 2 - Sub 0 - Universe 0-7, Out 1 - Pin 12 - Sub 0 - Universe 8-15, Out 3 - Pin 7- Sub 1 - Universe 0-7 and so on... in my attempt without the Octo library it worked like this:
In setup:
and in the loop:
Can someone help? Even if I delete all Ethernet libraries and install the Ethernet by Paul Stoffregen specifically for the Teensy, I still can't get it to compile.
Attached a .txt-file with the errors copied from the arduino ide
I started with an Arduino Mega 2650 and was able to output two universes each with an Ethernet shield on two pins. Then I noticed that the computing power was nowhere near enough and compared several boards and ended up with the Teensy 4.1. I use this with an Ethernet kit which is also sold via pjrc. Now I have adapted my code a little and am stuck with the following problem:
The code won't compile - I keep getting error messages saying that something is being initialized twice. If I comment out the Ethernet.h library (and also the EthernetUDP.h ) my code compiles and is uploaded. Logically, I can't receive Art-Net then - so my LEDs remain dark. I tried to switch to a different Ethernet library - NativeEthernet, and the NativeEthernetUDP to go with it. The code then compiles but I don't get a signal on any subnet in any universe. The only thing I see is the pattern that is generated by the init() function.
I loaded the OctoWS2811 basic test without Art-Net, modified it and tested it with 3 strips. That worked, which means that my strips are wired correctly.
I also tried working without the OctoWS2811 library.
I wrote everything together by hand (the hardest part was probably how to receive subnet data). The problem with this solution, which worked quite well, was that I had individual if loops and I think these are processed one after the other. So everything arrived slightly later on the second than on the first and everything arrived again later on the third than on the second and so on.
My questions:
Is it true that the OctoWS2811 library in conjunction with the appropriate adapter assigns the pins on the Teensy itself? So strip one with length X on pin 2...
How do I regulate in the programming that subnet 1 universe 0 arrives at pin 7 (out 3)? Since you can send a maximum of 16 universes per subnet, it should look like this schematically: Out 1 - Pin 2 - Sub 0 - Universe 0-7, Out 1 - Pin 12 - Sub 0 - Universe 8-15, Out 3 - Pin 7- Sub 1 - Universe 0-7 and so on... in my attempt without the Octo library it worked like this:
Code:
const byte dataPinOut1 = 2; // 0 - 7 / sub 0
const byte dataPinOut2 = 14; // 8 - 15 / sub 0
byte SubnetID1 = {0}; // for PinOut1
byte UniverseID1 = {0}; // for PinOut1
short selectStartUniverse1 = ((SubnetID1*16)+UniverseID1); // for PinOut1
byte SubnetID2 = {0}; // for PinOut2
byte UniverseID2 = {8}; // for PinOut2
short selectStartUniverse2 = ((SubnetID2*16)+UniverseID2); // for PinOut2
Code:
artnet.begin(mac, ip);
ledsOut1.begin();
ledsOut2.begin();
artnet.setBroadcast(broadcast);
Code:
if(r == ART_DMX && uni == startUniverseOut1){
data = artnet.getDmxFrame();
for (int i = 0; i < numLedsOut1; i++){
ledsOut1.setPixelColor(i, data[i * channelsPerLed], data[i * channelsPerLed + 1], data[i * channelsPerLed + 2]);
}
ledsOut1.show();
}
if(r == ART_DMX && uni == startUniverseOut2){
data = artnet.getDmxFrame();
for (int i = 0; i < numLedsOut2; i++){
ledsOut2.setPixelColor(i, data[i * channelsPerLed], data[i * channelsPerLed + 1], data[i * channelsPerLed + 2]);
}
ledsOut2.show();
}
Can someone help? Even if I delete all Ethernet libraries and install the Ethernet by Paul Stoffregen specifically for the Teensy, I still can't get it to compile.
Attached a .txt-file with the errors copied from the arduino ide