I have enabled a serial port in Virtual Box, and redirected the output to the file D:\1.bin:

enter image description here

I have sent some data using the following command in cmd in Windows XP inside Virtual Box:

echo Hello > COM1

Also I have sent the same data to the serial port in Ubuntu 9.04 inside Virtual Box:

echo Hello > /dev/ttyS0

But the result saved in D:\1.bin was only the string "Hello" without the extra data like parity and stop bit.

Is there a way to be able to receive the "raw bytes" sent on the serial port?


Parity and stop bits will not be included in this file.

The "raw data" refers to the payload... parity and stop bits are related to the framing and verification of the "raw data" on the physical medium.

It's also worth mentioning that UARTs can typically operate in 7-bit (text-only) and 8-bit (binary) modes.

The typical 8N1 that you see referrs to:

  • 1 implicit start bit
  • 8-bit data
  • No parity
  • 1 stop bit

This would come to 10-bits per 8-bits of data, which wouldn't work well in a file that stores 8-bits per byte anyway - add parity or another stop bit and you exacerbate the situation further.

Additionally, once you become interested in the framing, you should really also be interested in timing information such as baud rate and frame-spacing - something that your commands don't even configure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.