On Mon, 2023-04-17 at 15:14 -0500, Rick Snow wrote
Thank you all for your thoughts regarding this issue.
Right now, I don't have anything to offer that would help you. But you seem to have established that the hardware works and it seems the problem lies in the protocol or the transport. Single messages work, but when sending them in bulk they get corrupted.
In the source of comport.c, I find the line 132:
#define COMPORT_BUF_SIZE 16384
Assuming this defines the buffer size for sending data from Pd to the serial line, I think it is unlikely you hit a buffer overrun. Also, it seems comport is not threaded which makes me assume that it would simply block Pd if its buffer gets full.
What version of [comport] are you using? Have you tried different ones?
You could try a different (lower) baud rate. For that you'd have to adapt the [arduino] abstraction and the StandardFirmata sketch. Both are set to 57600.
Also, what does it need once the communications break? Do you need to power off the Arduino Mega before you can restore a working communication? Or does it help to close and open the serial port connection?
Roman