[Beaglebone] Save serial data onto the memory


I am trying to save the data received onto the memory card and I need some pointers to that since I am completely new to this.
I configured the mux modes of UART1 and UART2 to act as recievers. Right now what I am doing is using minicom to monitor the data received from those pins. I just run the minicom application on board and the board is connected to computer via USB. The serial data received through pins is being displayed on the screen.
Instead I want to just store the serial data obtained through pins onto the memory of beaglebone. Can anyone please give me pointers on how to do that?
If I want to store the data as a text file how would I do that?


use the pipe command

google linux pipe command

'Command | tee filename' or 'command >> filename' (sans quotes).


Pardon me for being ignorant but the data is not from executing any command. A particular pin has to be constantly monitored and whenever data comes through it, that data has to be stored or appended to some file. How do I do that on Beaglebone?
If the question is not beaglebone specific, can you please direct me to materials/links which can help.


You will need to create a program that reads the serial ports and either dump it to a file or the console
if it dumps it to the console use the pipe commands to store it to a file

have you ever written a program before ?

this can be done in C, C++, java,python,basic ect.

I would expect that you can “cat /dev/ttywhatever > filename” after the serial port parameters are setup, but I have never tried it.

The question is very incomplete:

  By serial interface you mean what?
      A normal RS232 interface?
      An I2C interface?
      An SPI interface?
      A CAN interface?
      A very high speed serial interface?
      An 1-wire interface?

  What is the data rate?

  After knowing that and the voltage levels required, you can design the interface with the BBone.

  The BBone processor may ( or may not ) support the voltage levels, in the latter case you may need electrical buffers.
  The BBone processor may support the communication protocol of our interface, or may not, and in that case you may need to implement the required software.

  What operative system will you use?
  The file will be where? SDcard, network, USB Pen?

  Please read things about embedded computing, microprocessor interfacing, and linux.

  If the data rate is small, and if you want to write to an SDcard, and this is your first "adventure" on this area, get an Arduino and start with that.

  The Arduino is very, very simple for beginners.

  The BBone is much, but much more powerful.

  Best reagrds

  Paulo Ferreira

Read your mails in the wrong order.

If the serial port is correctly configured ( let's suppose it is /dev/tty02 ):

1) On the command line

cat /dev/tty02 >> myfile.txt

2) Write a program ( any language ) that reads a char from a file ( /dev/tty02 ) and writes is to my file.txt.

3) Read the fine manual of minicom and start it with "minicom -C my file,txt" and then all that appears on the screen also goes to that file.


Paulo Ferreira

Thanks! that helped