OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

3 Pages V  < 1 2 3 >  
Reply to this topicStart new topic
> Got Earthmate USB GPS, now what?
Gondola
post May 9 2005, 10:20 AM
Post #16





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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.
Go to the top of the page
 
+Quote Post
Gondola
post May 9 2005, 11:19 AM
Post #17





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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
Go to the top of the page
 
+Quote Post
Gondola
post May 9 2005, 11:44 AM
Post #18





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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.
Go to the top of the page
 
+Quote Post
lardman
post May 9 2005, 02:45 PM
Post #19





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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!
Go to the top of the page
 
+Quote Post
lardman
post May 9 2005, 03:01 PM
Post #20





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
Gondola
post May 9 2005, 05:22 PM
Post #21





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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

Thanks!
Go to the top of the page
 
+Quote Post
lardman
post May 10 2005, 03:14 AM
Post #22





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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

This post has been edited by lardman: May 10 2005, 03:46 AM
Go to the top of the page
 
+Quote Post
Gondola
post May 10 2005, 04:38 AM
Post #23





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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."
Go to the top of the page
 
+Quote Post
lardman
post May 10 2005, 05:00 AM
Post #24





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
Gondola
post May 10 2005, 10:19 AM
Post #25





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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.
Go to the top of the page
 
+Quote Post
lardman
post May 10 2005, 02:14 PM
Post #26





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
lardman
post May 11 2005, 01:37 AM
Post #27





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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

This post has been edited by lardman: May 11 2005, 01:39 AM
Go to the top of the page
 
+Quote Post
Gondola
post May 11 2005, 08:45 AM
Post #28





Group: Members
Posts: 124
Joined: 11-January 05
Member No.: 6,189



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.
Go to the top of the page
 
+Quote Post
lardman
post May 11 2005, 08:50 AM
Post #29





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
lardman
post May 11 2005, 09:04 AM
Post #30





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th December 2014 - 02:13 PM