I have a problem with the Serial connection between Nvidia TX2 and Arduino Due and have the following error:
Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
After reading some suggestions on different forums I decided that my problem is with the buffer size of the Serial on Arduino and I want to change it.
But it is different for different versions of Arduino IDE. My current one is 1.8.19 and I was looking for the following file to change the buffer size: hardwareserial.h
like in this topic: link to similar topic
I have found this file in the current directory: /usr/share/arduino/hardware/arduino/cores/arduino:
The closest thing I've found was in HardwareSerial.cpp file
I've commented the line "#define SERIAL_BUFFER_SIZE 64"
and added the line "#define SERIAL_BUFFER_SIZE 512"
And uploaded my code to Arduino Due, but it didn't do any changes and I got the same error.
It may be something else but I am sure that I made changes in the wrong place.
In other topics, I saw people point to the library RingBuffer but I can't find this library in my Arduino folder.
The question is how to change the buffer size for Serial messages in my configuration:
Arduino Due
Arduino IDE 1.8.19
OS: Ubuntu 18.04
Note that you'll need to change the Serial files used for Due, which are NOT in usr/share/arduino.hardware, but rather someplace like:
~/Arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/RingBuffer.h
Thank you! That is what I was looking for.. couldn't find the right folder at first, because it is not "arduino15" but ".arduino15" (with period at the beginning) in my case and it is hidden folder.
So, just in case it will be helpful for someone else, in my case the whole path to the RingBuffer.h file is: /home/myusername/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino
And here I was able to find RingBuffer.h file.
Inside the file, there is a line: #define SERIAL_BUFFER_SIZE 128
Great. Sorry about the missing "."; the windows filename is different and doesn't have a dot. (and also hidden and difficult to find since not included in "search".)