I'm transferring a binary file to an embedded device using a custom AT command set.
I'm running Lubuntu Linux on a virtual machine (Windows 7 host) and the virtual linux guest controls the physical serial port.
On Windows I have proprietary software to do that, on Linux I use the bash console.
I set the speed to 115200 baud with
stty -F /dev/ttyS0 115200
I check before and after and the speed goes from 9600 to 115200.
I send commands with
echo -ne "AT\r" > /dev/ttyS0
And I read the responses in another terminal where I launched
The problem is that when I need to flash a binary file in the device, I send the specific AT command and the device waits for a stream. Then I type
cat $myFile > /dev/ttyS0
And everything works, but it takes way more than it should. Almost 10 minutes for a 600k file when at 115200baud it should take around one minute.
What could be the bottleneck? Is it VirtualBox or is it the "cat" command? Is the speed stuck to default 9600 for some reason?