Help - Search - Members - Calendar
Full Version: Got Earthmate USB GPS, now what?
OESF Forums > Distros, Development, and Model Specific Forums > Model Specific Forums > 6000 - Tosa
lwong
I took the plunge and got the Delorme Earthmate USB GPS.

The 6000 recognize it right away as "Delorme USB Earthmate". dmesg says something about

USB HID v1.00 Pointer [Delorme Publishing Delorme Earthmate] on usb 1.27.0

Now what do I do? I installed qpegps but the defualt path is

-p /dev/ttyS0 -s -4800

Is that for connection through serial cale? What should I change it to?

One good thing about the setup is that the Z can power the GPS all by itself. The bad is that if qpegps is run in 640x480 mode, it looks skewed.

Please help me set this up.

Thanks

FW
dmilligan
I am guessing /dev/ttyUSBXXX - you will probably need to run the gpsd prior to running qpegps as it seems to always want to default to ttyS0.
lwong
Could you elaborate a little as I am not familiar w/ the program (or linux) at all.

Do I actually need to install gpsd seperately? and how do I tell what "USBXXX" I should put?

Thanks

FW
Gondola
I got one of the iRiver adapters (great deal btw).

I plugged in my DeLorme Earthmate, and it is recognized (courtesy of dmesg):

hub.c: USB new device connect on bus1/1, assigned device number 11: USB HID v1.00 Pointer [DeLorme Publishing DeLorme USB Earthmate] on usb1:11.0

I installed zGPS and manually edited the .zGPS.conf to point to /dev/ttyUSB1 but I'm not getting any results.

Since the ttyUSB1 file already exists in /dev, I don't need to prepare it ahead of time do I? From my reading online it may be necessary to get a new kernel to compensate for the fact that it identifies as a HID.

I like the Earthmate because it's USB (saves me the CF slot for other things if necessary, like a nice big 4gb CF drive), and it comes with a nice long cable. And I already had it anyway.

If someone could give me some more information on using USB GPS's, I would really appreciate it, as I think others would as well.
Gondola
I've tried to put "-p /dev/ttyUSB1" on the gpeGPS dialog box, but no luck.

It will re-run gpsd on the fly; I tested it by changing to ttyS0 through ttyS4. In the Data Status window, under gpsd, the gpsd box will go green if I use ttyS0 through 3. So there's something about ttyUSB0 and ttyUSB1 which won't even allow gpsd to run.

None of the other boxes ever show anything other than red.

I even added the "-T e" to force it into Earthmate mode.

There's some kind of USB issue here, but I'm just no familiar enough with USB on Linux.
Gondola
Bump.

I did some Googling in an attempt to figure out this problem, and I ran across these links:

http://trans.civil.northwestern.edu/~jay/gpsd.html

http://geocities.com/i0xox0i/

I would appreciate if someone with more knowledge of the Zaurus kernel please read through these pages. It seems to me that there are two options; recompile gpsd for the Zaurus as stated in the first link; or patch the kernel as detailed in the second link.

I don't have a compile environment set up for the Zaurus yet, as I've only recently gotten the Zaurus. GPS in the car is a killer app for me.

All you gurus out there, please help! smile.gif
Gondola
Bump.
hellbilly
QUOTE(Gondola @ Jan 27 2005, 11:18 AM)
Bump.

I did some Googling in an attempt to figure out this problem, and I ran across these links:

http://trans.civil.northwestern.edu/~jay/gpsd.html

http://geocities.com/i0xox0i/

I would appreciate if someone with more knowledge of the Zaurus kernel please read through these pages.  It seems to me that there are two options; recompile gpsd for the Zaurus as stated in the first link; or patch the kernel as detailed in the second link.

I don't have a compile environment set up for the Zaurus yet, as I've only recently gotten the Zaurus.  GPS in the car is a killer app for me.

All you gurus out there, please help! smile.gif

did you ever figure this out?
i am trying to get the usb gps that came with streets and trips working.
*
lardman
QUOTE
I would appreciate if someone with more knowledge of the Zaurus kernel please read through these pages. It seems to me that there are two options;


QUOTE
recompile gpsd for the Zaurus as stated in the first link;


This is part of the solution outlined there - you also need to have the USB devfs enabled. I'm not sure whether this is enabled by default on the Z.

Anyone? In any case the patch against gpsd is on the web page, just patch it and build and see whether it works.

Otherwise there's always the kernel module which probably wouldn't be too hard to build. Which kernel are you running (the standard Sharp one I suppose, not OpenZaurus by chance)?


Si
Gondola
Actually, it turns out that it's more complex than that.

The posted 2.4.x patch does not work with the Sharp kernel sources. I tried that. Someone with more programming experience may be able to update the kernel, but it's not a cut-and-dry kernel patch.

The other option, recompiling gpsd, requires some libs that I didn't have, and I got lost trying to figure out what libs I needed to get it working, and how to compile them. I think it may need a kernel change either way. I couldn't get it working, even though I was able to get a compile environment set up and I was able to compile and run a QTopia sample app.

I would really appreciate someone looking into this. Having recently lost my job, I don't see myself wasting the money for a new non-USB GPS, since the Z is not something I use for work.

Once I have a working GPS, I'd love to work on some map conversion projects, etc, but my Linux C programming skills are meager to say the least. I'm more comfortable with Perl and PHP.


QUOTE(lardman @ Apr 3 2005, 06:16 PM)
QUOTE
I would appreciate if someone with more knowledge of the Zaurus kernel please read through these pages. It seems to me that there are two options;


QUOTE
recompile gpsd for the Zaurus as stated in the first link;


This is part of the solution outlined there - you also need to have the USB devfs enabled. I'm not sure whether this is enabled by default on the Z.

Anyone? In any case the patch against gpsd is on the web page, just patch it and build and see whether it works.

Otherwise there's always the kernel module which probably wouldn't be too hard to build. Which kernel are you running (the standard Sharp one I suppose, not OpenZaurus by chance)?


Si
*

Gondola
Bump.

I'm still interested in getting my GPS working before my upcoming road trip, wedding, and honeymoon. I'm going to be driving from NC to IN, flying to Vegas for honeymoon, flying back to IN, then driving back to NC. I'd like to have the GPS available for the trip, but I need someone with more expertise than I to patch the kernel and compile the patched GPSd.

I'll use OZ 3.5.3 if you want to compile for that platform, or stock Sharp ROM, whatever.. as long as I can use a browser and a GPS app.
lardman
Sorry, I lost track of this thread.

I note from:http://geocities.com/i0xox0i/ that the cypress_m8 module is in the 2.6 kernel now, however that won't help you as I don't think 2.6 is available for the 6000 yet.

I've compiled gped with the emul patch in OE, I've also almost compiled emul itslef, though it fails building sirfmon - is this required?

The .bb files and the emul lib and the ipk of gpsd are all here:

http://students.bath.ac.uk/enpsgp/Zaurus/emul/

Bit of a hack job I'm afraid, but I'm a bit busy - perhaps one of the OE gurus - hrw, mickeyl, etc., will take a look at the emul .bb file and be able to fix it (very easily I imagine).

I saw this:

QUOTE
You need libusb ( >=0.1.8 ) and kernel 2.6 to compile..


on http://trans.civil.northwestern.edu/~jay/gpsd.html

does this mean you'll need 2.6.x to run it, if so you're out of luck I suppose.


Si
lardman
Right, Mickeyl has given me a hand, and now the sirftest and emul_test binaries build fine - packaging is still a bit broken (easy to fix I imagine but I don't have time atm).

Si
Gondola
QUOTE(lardman @ May 8 2005, 02:18 PM)
Right, Mickeyl has given me a hand, and now the sirftest and emul_test binaries build fine - packaging is still a bit broken (easy to fix I imagine but I don't have time atm).

Si
*


The 2.4 kernel required patches to use the custom version of gpsd at http://trans.civil.northwestern.edu/~jay/gpsd.html but I'm not sure about the Earthmate Userland library since there's so little on their page about what it is and how to use it. From what I understand, they are different ways to solve the same problem.

So you said you compiled it for OE, so what should I be using? OZ 3.5.3, Opie or GPE?
Sharp stock?
lardman
QUOTE
The 2.4 kernel required patches to use the custom version of gpsd at http://trans.civil.northwestern.edu/~jay/gpsd.html


Where?

This:

QUOTE
The patch is retiring. Please take a look at the kernel mode driver by Lonnie Mendez. The driver is working and it is only a mater of time for it to go into the official Linux kernel tree.


Looks like he's talking about a module, however it appears that it's for 2.6.x.

This:

QUOTE
To use this GPS, we have two choices. The first one is to write a kernel module for this USB2Serial chip. However the current ( upto kerenl 2.6.5 ) usb2serial framework need to be patched in order to support interrupt transactions. The other approach is to utilize the USB DEVFS interface and communicate with the device directly from user space. The later method turned out to be easy.


seems to give two options:

1. patch the kernel to get over the difficulties caused by the usb2serial framework. I don't know whether this problem exists in 2.4.18, I don't know whether the code even exists in 2.4.18. I also don't know where one would find a patch (it seems to me that you would have to patch it yourself).

2. Use USB devfs (I don't know whether this is even supported on 2.4.18), even if it is, I'm afraid I'm not set up to build a kernel for anything other than a c7x0 atm anyway, however someone else may well be able to do so.

I imagine that libusb uses the USB (dev)fs so you will probably have no use for it.

Here (http://geocities.com/i0xox0i/), I read this:

QUOTE
There is also the EarthMate Userland Library project located here: http://emul.berlios.de
for people using Linux 2.4.x/2.6.x, Mac OS X/Darwin, and BSD.


Note the 2.4.x part.

I have provided the emul lib, and gpsd patched to use it. I've no idea if it'll work or not I'm afraid, but you can only try it out.

QUOTE
So you said you compiled it for OE, so what should I be using? OZ 3.5.3, Opie or GPE?


OZ 3.5.3, probably Opie, though GPE is an option - depends on what you want by way of apps, or whether you want to use an existing Qtopia (Sharp ROM) app (which will require Opie).

Take a look in the feeds and see if anything catches your eye, or ask on #openzaurus.

Link to images here: http://www.openzaurus.org/official/unstable/3.5.3/sl6000/
Link to main feed: http://www.openzaurus.org/official/unstable/3.5.3/feed/


Si
Gondola
Although I've used Linux for years, I've spent 99% of my time on Perl, PHP, and MySQL. I don't have much experience with drivers (except for following explicit directions) and kernel modules (same).

So what I'm gathering from your posts is that I should just install the libraries (libusb and libemul) that you compiled, and install the gpsd binary that you compiled, and if everything worked right in compiler land, gpsd should work?

That would be great if it works. I'll let you know if it works for me. I know there was at least one other person in these forums with the same problem, hopefully he'll see these updates as well, and maybe we can get his feedback also.
Gondola
Tried to ipkg install the libusb you had up on that page; http://students.bath.ac.uk/enpsgp/Zaurus/e...-r1_armv5te.ipk

QUOTE
Installing.. blah blah
ipkg_conf_write_status_files: Can't open status file: /mnt/card/packages//usr/lib/ipkg/status for writing: Read-only file system.


The double slash (//) is not a typo.

When I try to usr sirfmon or emul_test I get errors.

sirmon wants a device name. I used
mknod /dev/usb/ttyUSB1 c 180 0
although I wasn't sure if that was correct or not.

But it just tells me No such device.

emul_test:

QUOTE
em_open: Device or resource busy
Check node permissions and device attachment.


Same error as before I ran mknod

I saw a page somewhere in the OE documents which had specific mknod instructions, but for the life of me I can't find it sad.gif
Gondola
Ok, it looks like maybe the mknod should be "mknod /dev/ttyUSBx c 188 x" since doing an ls in /dev shows me a couple existing ttyUSBx entries, and it says

"crw-rw---- 1 root root 188, 0 May 9 15:36 /dev/ttyUSB0"
"crw-rw---- 1 root root 188, 1 May 9 15:36 /dev/ttyUSB1"

I rebooted my machine, did a "mknod /dev/ttyUSB2 c 188 2"

But sirfmon still says /dev/ttyUSB2: No such device.
lardman
I hadn't thought you'd need libusb, however after reading this (http://emul.berlios.de/about.php) I think you might (it might be worth trying to find some program which will test whether libusb is working - in fact I don't even know what it's supposed to do).

I'm working exclusively from http://emul.berlios.de/ as this is the one linked from http://geocities.com/i0xox0i/ with some kind of indication that it'll work on 2.4.x (the other site seems to me to be concerned with 2.6.x kernel modules which won't work for you until the 2.6.11 kernel is ported to the 6000).

QUOTE
Installing.. blah blah
ipkg_conf_write_status_files: Can't open status file: /mnt/card/packages//usr/lib/ipkg/status for writing: Read-only file system.


I saw someone saying this had happened to them - I asked whether their card was mounted ro or rw - I can't remember what the problem was though I'm afraid. Perhaps umount the card and try running fsck on it.

mknod /dev/ttyUSB0 c 188 0
mknod /dev/ttyUSB1 c 188 1
mknod /dev/ttyUSB2 c 188 2
mknod /dev/ttyUSB3 c 188 3
.
.
.
mknod /dev/ttyUSB15 c 188 15

appears to be correct.

Next question is whether the driver for the device is loaded, and whether/how it's bound to the dev entry. My (admittedly not very in-depth) understanding is that you'll get this binding if you use the kernel module (which acts as the usb-serial convertor).

I don;t think this is what you're going to be doing - the patched gpsd uses the emul lib which uses libusb which talks to the usb device directly (that's my guess anyway).

Try to install the libusb, stick the emul lib in (and create the symlinks to the major and .so files), the see if gpsd or the two test programs will work.


Si

(a bit of an explanation: http://www.mp3car.com/vbulletin/showthread.php?t=24211)

Last user comment on this page might also be interesting to investigate:
http://www.qbik.ch/usb/devices/showdev.php?id=2272
(the one from David Tauriainen)

Explanation of what emul is: http://s2.selwerd.nl/~dirk-jan/gpsdrive/ar...e/msg04332.html

Plus the entire README from emul source code:

QUOTE
EarthMate Userland Library v1.0.2
emul's dependencies are as follows:

libpthread
libusb >= 0.1.8

The library has moved away from automake and friends.  For your target
install, please link the appropriate makefile.  For example, someone doing
an install with Mac OS X or OpenDarwin should issue the command:
$ln -s Makefile.darwin Makefile

To install, please take a look at the Makefile and make sure the
PREFIX variable is set to your liking.  The default is '/usr'.  If this
is acceptable, it should be simple enough to enter the command below
and hit enter:

$ make install

To see if things are working, there are two programs which utilize
this library.  Those are: emul_test and sirfmon.  If all goes well,
simply running emul_test should start spewing NMEA (or binary garbage)
on the terminal.  A quick way to get the unit to switch back into nmea
mode is to physically replug it.  There is also the excellent utility
'sirfmon' written mostly by Eric S. Raymond which can be run with this
library via the command:
$ sirfmon emate    (it also works with regular tty devices)

You can switch the unit between sirf and nmea with the sirfmon utility.
By default, the unit is switched into sirf mode when starting sirfmon.  To
go back to nmea, simply enter 'n' at the command line.

Both sirfmon and emul_test are installed by default.  emul_test can be
passed the argument 'd1' - 'd8' to activate emul library debugging.

For information regarding the gpsd patch in directory patches,
please view the readme file in that directory.

Documentation for the library can be found in html/ courtesy of doxygen.
man keywords are 'emul.h' and 'serconfig'.


If you want to help out, with porting/patches/bug reports/success
stories/etc, please do.  Visit the project page at:
http://developer.berlios.de/projects/emul/



My tests and trials:

  Machines tested with library:
amd athlon 1500/256MB ddr266/ehci-ohci-uhci
abit bh6 p3 667/256MB PC133/ali ehci-ohci, uhci bus onboard

2.4 linux kernel notice:

Host controllers that are usb 2.0 compatible bundled with ohci bridges for
usb 1.1 gave me some trouble.  For instance, trying to read from the interrupt
in pipe will return -22 (or EINVAL) for whichever reason.  This problem does not
seem to exist on the 2.5/2.6 kernels.  A quick and dirty solution is to connect
a usb 1.1 hub on one of the controllers port hubs and then plug the earthmate
into that.  I'm not sure if this is the same for ehci/uhci controllers as
well... I surely hope not.  For people with plain jane usb 1.1 busses there
should be no problem.

RedHat Linux 9.0 (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) kernel
2.4.20-8)
Before compiling, I had to change MANDIR to 'MANDIR=$(PREFIX)/share/man'.
Otherwise it compiled cleanly.  The version of libusb that comes default with
rh9 is 0.1.6, which does not contain the necessary functions for interrupt
transactions.  I had to first package a new rpm of libusb-0.1.10a and then force
it to install using the --force flag.  I also grabbed the latest usbutils and
repacked that as well (for lsusb tool).  On the first run, the system completely
locked up. Apparently when connected to the uhci usb bus the system would oops.
I then tried upgrading the kernel to something a little more recent from
kernel.org. With 2.4.22/2.4.24/2.4.30 no lockups occured.  sirfmon, both the
version packaged with the library and the one accompanying gpsd, worked well.
The library utilites, such as emul_test, did not however.  This problem should
be fixed at this point.  I also ran gpsd-2.21 with success.

Gentoo Linux 2005.0 (gcc 3.4.3 / kernel 2.6.11):
Compiled without trouble.  It just works, but then again I'm developing emul
on this platform.

Slackware 10.1 (gcc 3.3.4 / kernel 2.4.29):
Compiled without trouble.  The sirfmon utility works fairly well at rates
below or at 9600bps.  Anything higher will start
choking the emul applications, including gpsd.

OpenDarwin 7.2.1 (gcc 3.3):
Compiled without trouble.  The only usb controller which seemed to work was
an Ali based ehci/ohci controller, and even then only one of the two ports
worked.  I'm sure someone with ppc hardware could easily have this working.
When running the test applications, they work quite well now.  Before a certain
bug was fixed, they would fail on the read process.  gpsd should work fine with
this.

Mac OS X:
I'm guessing this library will work based on what happened with OpenDarwin.

BSD Folks:
BSD support is coming along slowly.

NetBSD 2.0 (gcc 3.3.3):
Compiled without trouble.  In order to avoid using userconf manually on every
boot to disable uhid/uhidev, the uhid interface needs to be disabled in the
kernel by recompiling it.  This is of course very inconvenient for someone with
usb mice, etc.  With userconf, at boot I had to issue the command 'boot -c' in
order to get into the userconf dialog.  Then, to disable the hid interface,
issue the commands: disable 349 and disable 350.  The emul_test program works
fine, however the lines never drop... that is something that should be fixed.
The em_select() function seems to be at blame for why sirfmon and emul_test2
fail to work properly.

FreeBSD:
Avoid this library... use the ucycom module instead.  Someone, namely
'brick', has reported the module working fine with the earthmate on FreeBSD
6.0-CURRENT.  The node created by ucycom should be used with gpsd.  If you
however would want to still use this library... who am I to stop you!  Something
to look into for disabling ucycom/uhid without obtaining a migraine would be
this:

http://www.freebsd.org/doc/en_US.ISO8859-1...vice-hints.html

Good Luck!
lardman
It's just occured to me that libusb may well be different for different kernel versions - I'm set to build for 2.6.11 so you may want to ask hrw in the upgrades thread if he'll build libusb for 2.4.18.

Also, even if the above isn't true, note that the ipk I've given you will require an arch of armv5te (iirc) - this will probably have to be added to /etc/ipkg/arch.conf - use a lowish number (I think high numbers are given preference), or just add it temporarily and remove it once it's installed.


Si
Gondola
I appreciate your help, lardman. I'll try to muddle through and see what I can do tomorrow.

Thanks!
lardman
Okay, do the following:

1. hrw has added libusb to the upgrades feed - install that version
2. Stick my libemul.so.1.0.5 in /usr/lib, create the following symlinks:

libemul.so.1.0.5 -> libemul.so.1.0
libemul.so.1.0 -> libemul.so.1
libemul.so.1 -> libemul.so
(' cd /usr/lib && ln -s libemul.so.1.0.5 libemul.so.1.0', etc.)

3. stick sirfmon and emul_test in /usr/bin (you might need to chmod +x the files as I think they've passed though my WinXP machine)
4. Plug in the GPS
5. Try sirfmon and emul_test (I've no idea what they should do - but please post and tell us)
6. make temporary alteration to /etc/ipkg/arch.conf (post the contents here if you need help) so you can install the next ipk
7. Install my gpsd-emul_2.20-r2_armv5te.ipk
8. Run gpsd with fingers crossed wink.gif


Si
Gondola
Ok, some results...

armv5te was already in my /etc/ipk/arch.conf file.

Installed the libusb from the 3.5.3 upgrades feed. No problems.

I had to mknod for ttyUSB2 again (lsusb showed the earthmate on device 2) and when I check the ttyUSB files I see

crw-rw---- .. ttyUSB0
crw-rw---- ... ttyUSB1
crw-rw-rw- ... ttyUSB2

ttyUSB2 has a different file mask. Should I just chmod 777 it?

When I went to install the gpsd ipk, I got the same read-only error, and errors about missing libgps, so I remounted my sd card as rw (mount /dev/mmcda1 -o remount,rw) and tried again.

No more read-only errors, but the same libgps error;

"Starting gpsd; error while loading shared libraries: libgps.so.10; cannot open shared object file: No such file or directory
success"

So I went to the oz353 feed and found libgps.so.10 and installed that. It wouldn't install from the SD card, complained it couldn't create the symlinks. think it just tried to create symlinks to the card, which is vfat, not ext2. So I manually copied the libgps.so.10.0.0 file to /usr/lib, created symlinks for libgps.so.10 and libgps.so.

Now when I try to run sirfmon I get:

"# sirfmon emate
sirfmon: error while loading shared libraries: libgps.so.10: ELF file version does not match current one."

Same error when I try to run gpsd. Does that mean I screwed up the installation of the libgps file in some way?

emul_test still gives me "em_open: Device or resource busy
Check node permissions and device attachment."
lardman
QUOTE
the card, which is vfat, not ext2


Can you format it ext2? It will save a lot of hassle. Or are you installing everything to root now anyway?

QUOTE
"# sirfmon emate
sirfmon: error while loading shared libraries: libgps.so.10: ELF file version does not match current one."


QUOTE
Same error when I try to run gpsd. Does that mean I screwed up the installation of the libgps file in some way?


I don't know I'm afraid.

QUOTE
I had to mknod for ttyUSB2 again (lsusb showed the earthmate on device 2) and when I check the ttyUSB files I see

crw-rw---- .. ttyUSB0
crw-rw---- ... ttyUSB1
crw-rw-rw- ... ttyUSB2

ttyUSB2 has a different file mask. Should I just chmod 777 it?


AFAIK you need to do this - you'd only do this if you were using the kernel modules which makes the gps act like a serial adaptor.


Si
Gondola
Well, after a couple hours I was able to get everything set up right.

- 1gb SD card is now partitioned, 375mb vfat, the rest ext2
- Installed libusb
- Installed gpsd
- Installed qpegps

gpsd runs without crashing. qpegps runs, and detects gpsd... but I can't get the gps to respond, go green, anything. telnet to localhost 2947 to talk to gpsd manually, it's not getting any data (obviously, otherwise it would go green) and the X variable is 0, meaning the gps is inactive. When I unplug/replug it into the USB port, it blinks red a few times then goes dark. I've tried it outside to see if it would go green outside, but nothing.

I'm really about at my end.
lardman
QUOTE
- Installed libusb
- Installed gpsd
- Installed qpegps


Did you 'install' (or rather copy to /usr/lib) libemul? - this is needed to communicate between gpsd and libusb. I presume you did do so otherwise gpsd would have failed to start.

Does emul_test, etc. work? This should be your first step.


Si
lardman
There's one more issue (of course), qpegps doesn't work with the latest versions of gpsd - even if gpsd is spewing data out, qpegps won't recognise it and will remain red - so if you can find out when the changes occurred in gpsd, I'll see if I can find an old version and perform the emul patch on that.

Otherwise, you'll (or I'll) need to use the version of gpsd which the qpegps people have on their site, and try to patch that with the emul patch (sounds like a fair bit of work to do).

Anyway, the moral of the story is ignore qpegps for the time being and just test whether there are any comms by telneting to gpsd, and using emul_test.


Si
Gondola
The sirfmon and emul_test programs aren't working.

QUOTE
root@tosa:/home/gondola# sirfmon emate
emate: No such file or directory
root@tosa:/home/gondola# emul_test
        em_open: Device or resource busy
        Check node permissions and device attachment.
root@tosa:/home/gondola# emul_test d1
em_open - Successfuly opened device.
em_open: dettached driver hid from device
em_open: failed to claim device
        em_open: Device or resource busy
        Check node permissions and device attachment.


There appears to be something possibly wrong with my libusb install.

QUOTE
root@tosa:/home/gondola# find / -name libusb*
/usr/bin/libusb-config
/usr/lib/ipkg/info/libusb.list
/usr/lib/ipkg/info/libusb.postinst
/usr/lib/ipkg/info/libusb.control
/usr/lib/libusbpp-0.1.so.4
/usr/lib/libusb-0.1.so.4
/usr/lib/libusbpp-0.1.so.4.4.2
/usr/lib/libusb-0.1.so.4.4.2


Although
QUOTE
root@tosa:/home/gondola# ipkg info 'libusb*'
Package: libusb
Version: 0.1.10a-r1
Depends: libstdc++6 (>= 3.4.3), libc6 (>= 2.3.2+cvs20040726), libgcc1 (>= 3.4.3)
Status: install user installed
Architecture: arm
Installed-Time: 1115829140


I tried to extract the ipk file to see if the filename matches the one in /usr/lib, but gunzip libusb.tar.gz says Invalid magic. Not sure how else to check it. The command line help for ipkg doesn't say anything about listing the contents of an ipk file, or I'm reading it wrong.
lardman
Are you online atm - come and talk in #openzaurus, it'll be easier.

In any case, to list the files in an installed package try:

ipkg files <package name>

I'm not sure that libusb is necessarily not working, might be worth looking for a different app which you could use to test though I suppose.

I'll have a quick look through the OE packages list.


Si
lardman
libusb must be working otherwise this would fail at em_open.

CODE
root@tosa:/home/gondola# emul_test d1
em_open - Successfuly opened device.
em_open: dettached driver hid from device
em_open: failed to claim device
       em_open: Device or resource busy
       Check node permissions and device attachment.


From looking at the code, it would appear that the emul lib is failing here:

CODE
       usb_set_configuration(em_device.udev, 1);
       ret = usb_claim_interface(em_device.udev, 0);
       if (ret < 0) {
               if (em_debug) fprintf(stderr, "em_open: failed to claim device\n");
               usb_close(em_device.udev);
               em_device.udev = NULL;
               return ret;
       }


So this is a problem with the interface being claimed (remember that the other usblib functions appear to work, so I wouldn't blame the lib) - not sure why, but it's a place to start.


Si
lardman
Next suggestion - see which module is grabbing the device (one of the HID ones) and rmmod it, then run the above code and see if that does anything to help.

I suggest this as the code which ought to do this:

CODE
usb_detach_kernel_driver_np(em_device.udev, 0);


Does return an error code if it fails, but it's not checked by emul.

Might also be worth running strace on it to make sure what it's attempting to open is the right thing (if the above doesn't work).


Si
Gondola
Ok, I need to verify the file names from the libusb package, so I'm trying to unpack the .ipk for it.

When I try to download ipkg-utils from the 3.5.3 feed it complains that python is a requirement that it can't satisfy. I tried installing python-core but I don't see a just plain python, and it won't install without it.
lardman
You don't need ipkg-utils.

You just need ipkg, the 'files' bit is a switch to pass to it.


Si
dignome
Hi guys. Sorry about all the confusion with the permissions message... it is sort of vague.

You need to make sure the permissions on the /proc/bus/usb/ nodes are set properly. There are a few ways of doing this, some more secure than others. This is an entry from /etc/fstab on my system:

none /proc/bus/usb usbfs defaults,devgid=85,devmode=0664 0 0

devgid is the group the devices will belong to, look in /etc/group:

usb:x:85:dignome

is my entry in /etc/group. Of course for the program, such as emul_test, to be able to access the usb device it must run under that group. devmode is the user/group/other permissions for the device nodes in /proc/bus/usb. If you don't want to mess with adding a group then set devmode=0666 which means that all the usb devices connected to the bus are vulnerable to any processes that might access them.

There should be no need to create any serial nodes in /dev as emul does indeed go through libusb via the /proc/bus/usb nodes.

As for gpsd... any plain jane gpsd package you download will not work with emul as of yet, as the emul framework for accessing the earthmate via libemul has not been merged. grab the latest 'gpsd patched' package which is available on the files section at:

http://developer.berlios.de/project/showfi...p?group_id=3373

You will need suitable compile tools installed in order to build the source package... I don't have any binary builds yet so this is necessary.


If you need further help, join #emul on irc.freenode.net or post back here.
zipmaster
so has anymore got it working using the emul thing?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.