Baud rate on Raspberry Pi /dev/ttyACM0 wrong on boot up.

First off, can I state, I don't know if this is an Arduino problem or a RPi problem, I originally posted this on the Raspberry Pi forums, but am cross-posting here for good measure.

I am currently building a cricket scoreboard, which the RPi sends a signal via USB to the Arduino from a webpage input, I have the Arduino IDE installed on the RPi and when the power is reset to everything, the baud rate of /dev/ttyACM0 gets reset to 9600 baud, but everything I've read says the default baud rate should be 115,200, the sketch on the Arduino has Serial.begin(115200); in its setup, so that should override it anyway I'd have thought.

Soon as the RPi is booted, I get the following:

pi@scoreboard:~ $ stty -F /dev/ttyACM0
speed 9600 baud; line = 0;
-brkint -imaxbel

If I then open the Arduino IDE (v2.1.0) and go straight to the Serial Monitor, I get

pi@scoreboard:~ $ stty -F /dev/ttyACM0
speed 115200 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

and the scoreboard will then work until the next reboot.

I have added init_uart_baud=115200 into /boot/config.txt to see if that helped, it didn't (and it was stated to me the USB serial isn't a uart, so my command has no effect), can someone else suggest what could be happening please, and how to remedy it ?

Thanks.

The Serial.begin() only affects the Arduino board. You have to set the baud rate on the RPi using a suitable RPi command or program.

I presume you have some program (other than the Serial Monitor) running on your RPi to take the data from the Arduino. That is the program that needs to set the RPi baud rate. I suspect you are relying on the Arduino IDE to set the baud rate.

What program are you using? Post the code.

Maybe this Python - Arduino demo will help to clarify.

...R

If I then open the Arduino IDE (v2.1.0) and go straight to the Serial Monitor, I get

How is that possible? The latest release is 1.6.10