You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application using an ESP32-S3 that uses all three ports. 0 for the standard serial port, 1 for DMX, and 2 as a hardware serial port to commication with another board. That last port is SerialDISP in my code.
Everything is working fine except when there is incoming DMX data. The incoming packet size is not correct. If I comment out the ability to read from the SerialDISP port, the packet size is correct. I am not sure why there is any relationship between the two.
Any help would be appreciated. Below is the code from that area of my program.
`
while (SerialDISP.available() > 0 && newData == false) {
rc = SerialDISP.read();
if (recvInProgress == true) {
if (rc != endMarker) {
receivedChars[ndx] = rc;
ndx++;
if (ndx >= numChars) {
ndx = numChars - 1;
}
}
else {
receivedChars[ndx] = '\0'; // terminate the string
recvInProgress = false;
ndx = 0;
newData = true;
}
}
else if (rc == startMarker) {
recvInProgress = true;
}
}
if (newData) {
String strSerial = receivedChars;
DoCommand(strSerial);
newData = false;
}
// If ADC is done
if (ADC.ConversionIsDone == true) { ProcessADCData(); }
// DMX Packet received
if (dmx_receive(DMX.Port, &DMXpacket, DMX_TIMEOUT_TICK)) { // DMX_TIMEOUT_TICK
if (!DMXpacket.err) {
// Just get the incoming DMX data
dmx_read(DMX.Port, DMX.dataIn, DMXpacket.size);
memcpy(DMX.dataOut, DMX.dataIn, DMXpacket.size); // Copy the incoming DMX array into the outgoing DMX array
if (!DMX.IsThere) { Serial.println("DMX is there"); }
LED.Color = rgbBLU;
DMX.IsThere = true;
tmrDMXTest.IsOn = true;
tmrDMXTest.Start = millis(); //Reset the test timer so it does not fire
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I have an application using an ESP32-S3 that uses all three ports. 0 for the standard serial port, 1 for DMX, and 2 as a hardware serial port to commication with another board. That last port is SerialDISP in my code.
Everything is working fine except when there is incoming DMX data. The incoming packet size is not correct. If I comment out the ability to read from the SerialDISP port, the packet size is correct. I am not sure why there is any relationship between the two.
Any help would be appreciated. Below is the code from that area of my program.
`
while (SerialDISP.available() > 0 && newData == false) {
`
All reactions