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:
- Arduino board
- Simple Servo Control example on arduino website
- some Chinook kernel modules compiled by me (usbserial.ko, ftdi_sio.ko, etc)
Next up, webcam….
Comments
14 Responses to “Arduino interaction”
Leave a Reply
[...] time in my mini series of testing USB on the N810 tablet - I bring you external webcam. The following video shows [...]
Any idea is the nokia n8xxs could communicate to the bt arduino through bt?
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!
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?
Problem solved, thanks!
I am unsure how you downloaded and installed the usbserial module, I have not been able to find it or figure out how to compile it on the nokia, some clarification would be appreciated.
[...] http://blog.locationist.net/2008/03/16/arduino-interaction/ [...]
Hello, I use your drive ftdi_sio to load a gateway Micaz… but when thw device is pluged in N810 I do dmesg and he show me the following message error:
“rejected 1 configuration due to insufficient available bus power”
Should you help me with this?
Thank’s
I was seeing the above plobem, and I noticed that this problem is related to communication between the module ftdi_sio and the kernel.
I’m using the module for micaz which is self-powered, but I think that ftdi_sio informs to kernel that it is bus-powered.
I downloaded the code module and will try to do a cross-compiling to N810, modifying the instruction about the power.
I’ll try…
i’ve been working on this whole of my day
but still no success
there are no ports called ttyusb0
i got ttyS0
i runned scan.py to scan available ports
also it says only available port is ttyS0
i did all the steps correctly except this one
Nokia-N810-50-2:/media/mmc2# ls -lah /dev/ttyUSB*
crw-rw—- 1 root dialout 188, 0 Mar 16 18:34 /dev/ttyUSB0
by the way my arduino is not an usb arduino
i mean it hasn’t got a usb output
instead of usb output it has serial-rs232
im using a rs232 to usb converter cable to connect it.
so..
how can i get it work?
what should i do?
Hi mclightning. The problem you have is because you don’t have the correct USB->serial driver modules loaded, and so the tablet won’t recognize it. You’d have to compile a suitable module for your adapter.
Arduino with USB uses an ftdi chip, that’s the reason i used the ftdi_dio.ko-module.
Hi everybody. I’ve Been busy and haven’t been answerin questions - sorry about that.
When it comes to bus power, dont’ try to run the arduino off of the tablet, use external power (and remember to change the jumer accordingly)
At the moment I’m not sure if my module will work in the latest maemo OS - hopefully someone can verify this.
Hopefully I’ll have time later on to do a new post about arduino and maemo.
Thanks for your interest!
i found another module for prolific serial converters which is named pl2303.ko.
:(
but still no ttyUSB0
i’ve got a driver cd that made this usb-serial converter work on pc.
there are .inf .dll files etc.
can i compile those files into a .ko file easily?
by the way
there is something wrong in my every dmesg respond
there are lots of lines that says
[13991.898437] EAC mode: play disabled, rec disabled
[13995.109375] EAC mode: play enabled, rec enabled
[14000.023437] EAC mode: play disabled, rec disabled
[14017.718750] EAC mode: play enabled, rec enabled
[14020.531250] EAC mode: play disabled, rec disabled
continously
and these lines too
[14219.914062] usb 1-1: usb auto-suspend
[14221.937500] hub 1-0:1.0: hub_suspend
[14221.937500] usb usb1: usb auto-suspend
full dmesg respond is here:
http://talk.maemo.org/showthread.php?t=30554&page=2