Skip to content
Prev 36482 / 63424 Next

Serial connections?

I've done some microcontroller work over serial also. Unfortunately,
interfacing with a serial port is system dependent, and the mechanisms
can be quite different, as you probably know. It appears that Simon has
a solution below that will work if you are willing to accept the default
baud rate (9600 is way too slow for good sensor data), parity, etc.. or
use external tools. On POSIX systems, you would need access to the
termios.h header and the system ioctl function in order to change these
settings. Although I'm not 100% sure, I don't think R has this
capability ... yet. 

I'm new to the list, but I'd be surprised if the R developers that have
been around awhile haven't already considered adding support for ioctls
and the POSIX terminal interface. This makes me wonder why it's not
there. If there is no good reason, I'm starting to see a series of R
packages (or core extensions) developing. With a package for ioctls, we
could use all sorts of cool stuff, like Video4Linux2 (webcams, HAM
radio, tuners)...

When I collect sensor data over serial, I do it in python or write a
small C program to dump a single-column csv. Of course, R is excellent
for digital signal processing after that. Check out the DSP
( http://biostatmatt.com/archives/78 ) I did in R with some ECG data I
collected with an Atmel uC. 

-Matt
On Tue, 2010-04-20 at 11:05 -0400, Simon Urbanek wrote: