mathertel / DMXSerial

An Arduino library for sending and receiving DMX packets.
BSD 3-Clause "New" or "Revised" License
320 stars 76 forks source link

DMXSerial on arduino nano, receiving but corrupted data #66

Open keukenrol opened 1 year ago

keukenrol commented 1 year ago

/ EDIT: after getting another MAX485 board, it seemed this was the culprit! /

Hi

I have a small breakout board populated with an arduino nano and a MAX485 module. While the arduino does receive data from the module (RX led blinking), the data is not consistent.

I have uploaded the following sketch:

#include <DMXSerial.h>

void setup () 
{
  DMXSerial.init(DMXReceiver);

  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);

  DMXSerial.resetUpdated();
}

void loop() 
{
  if(DMXSerial.dataUpdated())
  {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(500);
    digitalWrite(LED_BUILTIN, LOW);
    DMXSerial.resetUpdated();
  }
}

If I understand correctly, if the DMX stream is interpreted correctly the led should be almost constantly on. The LED does blink, however on random occasions. There is no pattern in it at all. The data uploaded to the LEDs is not correct at all. I am using the Shehds USB to DMX adapter and QLC+ as software.

The goal would be to drive 10 P9813 RGB mosfet drivers, using FastLED as library.

Any idea what could be wrong? I have read about the internal oscillator of those dongles being sketchy, however all fixtures I have are working without issues thus their tolerance must be greater then? The data sent from QLC+ is using the default OpenDMX 30Hz setting.