read UNO serial output with debian

i'd like to read the serial output of an arduino uno with a rather weak arm-"machine" running debian squeeze. i don't want nor need to program from there.

i tried connecting to /dev/ttyACM0 via pyserial and cu, but both are giving errors - so i suppose i'm lacking something.

but being limited on resources i'd like to avoid installing anything not needed - so can someone point me to what is the bare minimum needed to get this working?

tia.

i tried connecting to /dev/ttyACM0 via pyserial and cu, but both are giving errors - so i suppose i'm lacking something.

So are we - a clue as to what those errors are. Got one handy?

If you want it just to process the data in a shell script, you can do that with this little bash script:

#! /bin/bash

ARDUINO_PORT=/dev/ttyUSB0
ARDUINO_SPEED=19200

# Set speed for usb
stty -F $ARDUINO_PORT ispeed $ARDUINO_SPEED ospeed $ARDUINO_SPEED raw
exec 6<$ARDUINO_PORT

# Read data from Arduino
while read -u 6 f ;do

      # Remove trailing carriage return character added
      # by println to satisfy stupid MS-DOS Computers
      f=${f:0:${#f} - 1}

      # Do something with the data read
      echo "$(date) $f was read."      
done

This assumes that your Arduino is connected as /dev/ttyUSB0 after you plug it in. At least, that’s what I get on Ubuntu. A test code on the Arduino side is a very uninspiring blink program:

const int ledPin =  13;
const unsigned long interval = 3000;

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin (19200);
}

void loop() {
Serial.println ("Pleschberger!");
digitalWrite(ledPin, HIGH);
delay(interval);
Serial.println ("Wie Clint Eastwood: fragt ned - schießt gut");
digitalWrite(ledPin, LOW);
delay(interval);
}

Korman

thanks guys, esp. for making me try it once more.. hooking everything freshly up i now was able to screen into the arduino at once - no idea why it didn't work before..

and from that i realised that it's just been a rights-issue with pyserial - fwiw, it gave:

python tcp_serial_redirect.py -p /dev/ttyACM0

--- TCP/IP to Serial redirector --- type Ctrl-C / BREAK to quit --- /dev/ttyACM0 9600,8,N,1 --- Could not open serial port /dev/ttyACM0: could not open port /dev/ttyACM0: [Errno 5] Input/output error: '/dev/ttyACM0'

thanks, markus.