RGB matrix Panel + Serial1 receive

Hi, so I'm having issues receiving data through the Serial1 from another Arduino since I'm using a matrix display with the RGBmatrixPanel library which has interrupts that pause the reading of Serial1, therefore giving me non complete data.

I've tried many things such as making my own interrupt for reading the serial but I'm not quite sure how to give it highest priority. I've also quickly tried using I2C with Wire.h but no luck.
According to this, the serial has its own interrupt but still seems to be interrupted by the matrix library.

The body I'm sending is this (just a testing example in JSON):

{"time":{"year":2023,"month":6,"day":13,"hour":18,"minute":26,"second":22},"trains":[{"name":"Boissy-Saint-Léger","time":"20230613T182950","lateness":0},{"name":"Boissy-Saint-Léger","time":"20230613T183740","lateness":0},{"name":"Boissy-Saint-Léger","time":"20230613T184220","lateness":0}]}

and I'm receiving this:

{"tme":{year":023,"onth":,"day:13,"hur":1,"minte":26"secod":22}5,aes"}"me:issaitée"tm:"0613370"ltss:,{n":Bss-nt-ge"tie20303182"atne"0

I know its quite long and there's quite a bit of information but I want to make sure I know what is what.

I'm using an Arduino MEGA2560 R3

Would someone know how to approach this ?

Please post the sketch that you are having trouble with

this will not working.

Train_DisplayV0_2.zip (4.7 KB)
Here's the entire project with functions and everything.
Although to replicate this you would need another hooked up Arduino with this code
Serial_test.zip (1.3 KB)

But to summarise:

void setup() {
//Setup of Serial
//Setup of Matrix display
}

void loop() {

// Check for Serial message, if true read and if successful read to JSON (the json part was commented out to check if it was causing problems, it's not)

// Other stuff not relevant

// Set display parameters 

// Submit display parameters

}

To me this is more of an approach problem rather than code, let me know if you have any ideas

Idea - the avr controller is too weak for this, use a stm32, rp2040 or esp32. There are a other libraries for RGB panels rather than RGBMatrixPanel

Is th ematrix using WS2812?

For Ws2812 the protocol is bitbanged and to get the timing right interrupts are disabled.

I see two options here:

  1. Get rid of the bitbanging (e.g. Inefficient NeoPixel Control Solved With Hardware Hackery | Hackaday)
  2. Synchronize the serial communication
    sync
    When in "Ready to receive" mode the matrix is not updated.
    You could use two GPIOs for this or maybe one byte on the serial.

No, nothing similar

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.