Arduino interaction

Posted on March 16, 2008
Filed Under Maemo, N800, N810, Tutorials, serial, video |

As promised in my previous post. So this one was a bit harder to implement, because I couldn’t find working kernel modules, and had to compile them myself. There is a good discussion about arduino in ITT forums, and other blog posts, but still this was something I wanted to try.


Nokia N810 meets an Arduiono board and a servo… on Vimeo.

So the important part obviously is not the crappy board with a sensor and a servo, but the fact that by enabling a few kernel modules the OS2008 recognizes the connected arduino as /dev/ttyUSBx that can be used to communicate with the boards firmware. Steps to follow:

1. Get the basics set up as described for example in my previous post.

Remember to put your device in UTG host mode.

2. Download the modules, and as root, install them.
The serial port becomes available as /dev/ttyUSB0

Nokia-N810-50-2:/media/mmc2# insmod usbserial.ko
Nokia-N810-50-2:/media/mmc2# insmod ftdi_sio.ko

Nokia-N810-50-2:/media/mmc2# dmesg

*clip*
[ 250.898437] usbcore: registered new interface driver usbserial
[ 250.898437] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 250.898437] usbcore: registered new interface driver usbserial_generic
[ 250.898437] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 251.242187] cx3110x: PSM dynamic with 100 ms CAM timeout.
[ 257.632812] drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
[ 257.632812] usbcore: registered new interface driver ftdi_sio
[ 257.632812] drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver
[ 268.445312] cx3110x: PSM dynamic with 200 ms CAM timeout.
[ 275.148437] musb_stage0_irq 646: CONNECT (a_host) devctl 5d
[ 275.148437] hub 1-0:1.0: state 8 ports 1 chg 0000 evt 0000
[ 275.148437] usb usb1: usb auto-resume
[ 275.148437] usb usb1: finish resume
[ 275.148437] hub 1-0:1.0: hub_resume
[ 275.171875] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
[ 275.335937] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0×101
[ 275.460937] usb 1-1: new full speed USB device using musb_hdrc and address 2
[ 275.593750] usb 1-1: ep0 maxpacket = 8
[ 275.593750] usb 1-1: default language 0×0409
[ 275.593750] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=3
[ 275.593750] usb 1-1: Product: FT232R USB UART
[ 275.593750] usb 1-1: Manufacturer: FTDI
[ 275.593750] usb 1-1: SerialNumber: A4001tPd
[ 275.593750] usb 1-1: device v0403 p6001 is not supported
[ 275.593750] usb 1-1: uevent
[ 275.593750] usb 1-1: usb_probe_device
[ 275.593750] usb 1-1: configuration #1 chosen from 1 choice
[ 275.593750] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
[ 275.593750] usb 1-1:1.0: uevent
[ 275.593750] usbtest 1-1:1.0: usb_probe_interface
[ 275.593750] usbtest 1-1:1.0: usb_probe_interface - got id
[ 275.593750] usbserial_generic 1-1:1.0: usb_probe_interface
[ 275.593750] usbserial_generic 1-1:1.0: usb_probe_interface - got id
[ 275.593750] ftdi_sio 1-1:1.0: usb_probe_interface
[ 275.593750] ftdi_sio 1-1:1.0: usb_probe_interface - got id
[ 275.593750] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[ 275.593750] drivers/usb/serial/ftdi_sio.c: Detected FT232RL
[ 275.601562] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 275.601562] drivers/usb/core/inode.c: creating file ‘002′
[ 275.601562] hub 1-0:1.0: 110mA power budget left
[ 275.601562] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 275.601562] hub 1-0:1.0: port 1 enable change, status 00000103

Nokia-N810-50-2:/media/mmc2# ls -lah /dev/ttyUSB*
crw-rw—- 1 root dialout 188, 0 Mar 16 18:34 /dev/ttyUSB0

3. Get a serial program pySerial miniterm example is a good test environment.

Nokia-N810-50-2:/media/mmc2/arduino/pyserial-2.2/examples# export PYTHONPATH=/media/mmc2/arduino/pyserial-2.2/

Nokia-N810-50-2:/media/mmc2/arduino/pyserial-2.2/examples# python miniterm.py –port=/dev/ttyUSB0
— Miniterm — type Ctrl-D to quit
ยค????9a95a101a101a101a101a1…

The data displayed is some pressure-sensor data, but by pressing ‘q’ and ‘w’ those characters get sent trough serial to the arduino board that then turns the servo left or right.

4. Figure out what to use it for :)

For the summary, I should mention, that I’ve also compiled phidget motor, serial, servo etc. modules and numerous others. And I see no reason why they shouldn’t work. Please post a comment if you try them.

Actually I challenge you to try to use the most unikely usb devices with nokia internet tables.

Modules can be downloaded here.

Links:

Next up, webcam….

Comments

6 Responses to “Arduino interaction”

  1. USB OTG goes webcam : Location-aware mobility on March 19th, 2008 11:08

    [...] time in my mini series of testing USB on the N810 tablet - I bring you external webcam. The following video shows [...]

  2. cmdowns on April 8th, 2008 17:58

    Any idea is the nokia n8xxs could communicate to the bt arduino through bt?

  3. Michael Bunsen on April 8th, 2008 20:02

    Thank you for pioneering Arduino interaction with the Nokia n810! I thought it might be easier with a bluetooth module, but I didn’t want to go that route. What are you using for software on the Nokia? I’d love to be able to run Processing java applets to interact with an Arduino, maybe using Jalimo? Or maybe it would be easier to interact with Flash. Please post any more progress you have. Great site!

  4. laptop battery on September 1st, 2008 02:44

    We focus on bring the best http://www.batteryfast.com/asus/m3000.htm asus m3000 battery sales to our customers and strong desire our customers can buy their satisfaction asus m3000 laptop battery. We are committed to providing customers with high-quality, high-capacity and low price m3000 laptop batteries.

  5. Anuj on November 15th, 2008 12:27

    I am trying to connect Arduino to Nokia810, and I followed the steps mentioned above. For me the installation of the kernel modules goes absolutely fine. However, when I give the “dmesg” command, my output stops at “drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver”. The rest of it doesn’t happen and eventually I don’t see the serial port as USB0 on my machine. Could you tell me what the problem might be?

  6. Anuj on November 16th, 2008 03:08

    Problem solved, thanks!

Leave a Reply




*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word