PDA

View Full Version : how best to collect data from the usb port


flyinghigh
2007-08-10, 21:53
Hi,

I am looking at connecting an analogue/digital monitor to the 770 USB port.

the a/d emits about 1kbytes in async sentences every couple of secs at 9.6

If this was a Linux laptop, I would think about reading the port with perl, and creatings something akin to gpsd, however perl looks a bit too big for a 770

What do folks think ?

ArnimS
2007-08-16, 13:30
Hi,

I am looking at connecting an analogue/digital monitor to the 770 USB port.

the a/d emits about 1kbytes in async sentences every couple of secs at 9.6

If this was a Linux laptop, I would think about reading the port with perl, and creatings something akin to gpsd, however perl looks a bit too big for a 770

What do folks think ?

Maybe this can help get you started.

http://maemo.org/community/wiki/UsbNetworking

Strider
2007-08-16, 16:08
Why are you pointing him at networking? It's a serial device! :confused:

Perl works fine; it just doesn't have all the CPAN to call on as standard.

First get your hardware working. You'll need to feed power to the usb to serial adapter and to the 770 to get the usb host working. That's the fun part.

The software should be fairly straightforward unless the usb to serial kernel module isn't on the 770 out of the box. Sorry, can't check atm, mine is elsewhere :-(

flyinghigh
2007-08-18, 18:48
When I originally posted, I did not realise Perl was in the Maemo 2.0 build - that makes things a bit easier. Although I have no appetite to install scratch box so that I can compile the CPAN Device::Serial module

I had a poke around in /dev and cannot see a usb device, I guess it only gets created by hot plug.

I am coming seriously unstuck here with my lack of understanding of Linux serial devices

jethro.itt
2007-08-20, 12:54
First you should find out what type of USB device your data acquisition card is. If it is a serial device, you need a kernel module for it: usb-serial. No such module seems to be provided with 770/N800, as far as I can tell.

If your USB device provides custom endpoints instead, you need to write a driver for it yourself. Typically libusb is used for that. Looks like libusb is available for N800 at least, I have no 770 to check at the moment.

I don't know about Perl, but atleast in Python 2.5 it is possible to write wrappers for C libraries (the "dl" module), so that libusb can be used without writing an extension module in C.

flyinghigh
2007-08-21, 00:03
The data card is a serial device, so I will use a serial to usb converter.

PYusb looks promising, but does not appear to have been ported to either N770 or N800, so if there is someone out there who has the interest to do it I would be a very happy to test it.

PYusb could also be leveraged to allow folks to plug in digital cameras etc.