Friday 29 October 2010

Connecting an Arduino to a Seagate Dockstar

Here's a quick summary of how to connect your arduino to a Seagate Dockstar.

Checking connection


1. Install Plugbox Linux on the Dockstar (via http://plugapps.com/index.php5?title=PlugApps:Pogoplug_Setboot )

2. Plug in arduino to Dockstar via USB cable

3. Check arduino recognised

[root@Plugbox ~]# dmesg
The bottom lines should look something like: -

[ 126.200168] usb 1-1.3: new full speed USB device using orion-ehci and address 4
[ 126.382290] usbcore: registered new interface driver usbserial
[ 126.382974] USB Serial support registered for generic
[ 126.383709] usbcore: registered new interface driver usbserial_generic
[ 126.383722] usbserial: USB Serial Driver core
[ 126.401088] USB Serial support registered for FTDI USB Serial Device
[ 126.401283] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[ 126.401569] usb 1-1.3: Detected FT232RL
[ 126.401582] usb 1-1.3: Number of endpoints 2
[ 126.401592] usb 1-1.3: Endpoint 1 MaxPacketSize 64
[ 126.401601] usb 1-1.3: Endpoint 2 MaxPacketSize 64
[ 126.401610] usb 1-1.3: Setting MaxPacketSize 64
[ 126.402330] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 126.403067] usbcore: registered new interface driver ftdi_sio
[ 126.403080] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver


4. Check which device to use

[root@Plugbox ~]# ls -ltr /dev/ttyU*
crw-rw---- 1 root uucp 188, 0 Oct 29 13:17 /dev/ttyUSB0

Communication via Command Line


1. Configure serial port (taken from http://www.arduino.cc/playground/Interfacing/LinuxTTY)

[root@Plugbox ~]# stty -F /dev/ttyUSB0 cs8 19200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
(19200 should match the baud rate set via Serial.begin(XXXX) in the arduino program)

2. Read data from arduino: -

[root@Plugbox ~]# cat /dev/ttyUSB0
3. Send data to arduino: -

[root@Plugbox ~]# echo "Hello Arduino" > /dev/ttyUSB0

Communication via Minicom


1. Install minicom

[root@Plugbox ~]# pacman -Sy minicom
2. Fire up minicom

[root@Plugbox ~]# minicom -D /dev/ttyUSB0 -b 19200

No comments:

Post a Comment