Re: garmin forerunner 305

2008-11-04 Thread Bruce Cran
On Tue, Nov 04, 2008 at 08:28:05AM -0500, Bob McConnell wrote:
 On Behalf Of Bruce Cran
  On Thu, 4 Sep 2008 20:24:02 +0100
  Bruce Cran [EMAIL PROTECTED] wrote:
  
  On Thu, 4 Sep 2008 11:51:33 -0300
  Joey Mingrone [EMAIL PROTECTED] wrote:
  
   Has anyone had any success collecting data from a Garmin Forerunner
   305?
   
   When I connect the device I see the kernel messages:
   Sep  4 11:39:22 jrm root: Unknown USB device: vendor 0x091e product
   0x0003 bus uhub1
   Sep  4 11:39:22 jrm kernel: ugen0: vendor 0x091e product 0x0003,
   class 255/255, rev 1.10/0.01, addr 2 on uhub1
   
   The documentation for the port astro/GPSMan seems to indicate it
   supports this model, but I haven't had any luck.
   
   % uname -a
   FreeBSD xxx.xxx 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #3: Thu Jun
 12
   18:47:50 ADT 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/xxx  i386
  
  Unfortunately Garmin use their own protocol for communicating between
  the GPS and the PC.  Under Linux it's supported by the garmin_gps
  driver but there's no equivalent for FreeBSD yet.
  
  
  Sorry, it turns out that's wrong: the gpsbabel developers recommend
 not
  using garmin_gps because apparently it often doesn't work.  Instead
  they recommend using gpsbabel's 'garmin' input/output format.  It
  interfaces to the device using libusb - which, fortunately for us runs
  on FreeBSD! I've just successfully read back GPS data into a GPX file
  using gpsbabel on FreeBSD 8-CURRENT and the 'usb2' usb stack. 
  
  I don't know if it'll work with the usb stack that's in shipping
  version of FreeBSD though, and even with the new stack I had to make a
  change to libgpsusb.c in gpsbabel to get it working.
 
 The best way to help fix these problems are:
 
 A) Submit a patch for the changes you made.
 
 B) Contact the maintainers and provide them with all of the details,
 what you found, what didn't work, what you modified and the final
 results. If you have traces or data captures, they may want to see them.
 They can't fix problems they don't understand. If they don't have access
 to that hardware, or something similar, they might even ask you to do
 some experiments for them to extend their knowledge. All of that will
 help them improve the quality of future releases.


It looks like it may be a bug in libusb20 or the usb2 stack. I've sent
an email to Hans and freebsd-usb@ and will see what they think.  I very
much suspect it's not a bug in gpsbabel itself because
USB_ENDPOINT_ADDRESS_MASK must exist for a reason, and removing the
masking was just a hack to get things working just now.

-- 
Bruce Cran 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: garmin forerunner 305

2008-11-04 Thread Bruce Cran
On Tue, 04 Nov 2008 14:57:14 +0300
Boris Samorodov [EMAIL PROTECTED] wrote:

 Bruce Cran [EMAIL PROTECTED] writes:
 
  I don't know if it'll work with the usb stack that's in shipping
  version of FreeBSD though, and even with the new stack I had to
  make a change to libgpsusb.c in gpsbabel to get it working.
 
 Can you submit a patch? Thanks!

Having just read about endpoint addresses I'm not sure who's wrong.
gpsbabel truncates the address to the first 4 bytes using
USB_ENDPOINT_ADDRESS_MASK from libusb20 while
the stack clearly wants the rest, including the top 'direction' bit.  In
fact in /sys/dev/usb2/core/usb2_device.c line 114 it masks out the
reserved bits but still keeps the direction bit. usb2_get_pipe_by_addr
was failing when passed address 1 because the full endpoint address is
0x81 (endpoint 1, direction IN).  It looks as though by changing EA_MASK
to be just the endpoint number would fix the problem, but I'm not
sure if that's correct.

-- 
Bruce Cran
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: garmin forerunner 305

2008-11-04 Thread Hans Petter Selasky
On Tuesday 04 November 2008, Bruce Cran wrote:
 On Tue, 04 Nov 2008 14:57:14 +0300

 Boris Samorodov [EMAIL PROTECTED] wrote:
  Bruce Cran [EMAIL PROTECTED] writes:
   I don't know if it'll work with the usb stack that's in shipping
   version of FreeBSD though, and even with the new stack I had to
   make a change to libgpsusb.c in gpsbabel to get it working.
 
  Can you submit a patch? Thanks!

 Having just read about endpoint addresses I'm not sure who's wrong.
 gpsbabel truncates the address to the first 4 bytes using
 USB_ENDPOINT_ADDRESS_MASK from libusb20 while
 the stack clearly wants the rest, including the top 'direction' bit.  In
 fact in /sys/dev/usb2/core/usb2_device.c line 114 it masks out the
 reserved bits but still keeps the direction bit. usb2_get_pipe_by_addr
 was failing when passed address 1 because the full endpoint address is
 0x81 (endpoint 1, direction IN).  It looks as though by changing EA_MASK
 to be just the endpoint number would fix the problem, but I'm not
 sure if that's correct.

Hi,

I'm going to fix this in libusb20. In the callbacks in libusb20 we know the 
direction and I will simply just fix it there. The applications I tested so 
far passed the correct endpoint value.

--HPS

int
usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes,
int size, int timeout)
{
return (usb_std_io(dev, ep, bytes, size, timeout, 0));
}

int
usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes,
int size, int timeout)
{
return (usb_std_io(dev, ep, bytes, size, timeout, 0));
}

int
usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes,
int size, int timeout)
{
return (usb_std_io(dev, ep, bytes, size, timeout, 1));
}

int
usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes,
int size, int timeout)
{
return (usb_std_io(dev, ep, bytes, size, timeout, 1));
}
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: garmin forerunner 305

2008-11-04 Thread Bob McConnell
On Behalf Of Bruce Cran
 On Thu, 4 Sep 2008 20:24:02 +0100
 Bruce Cran [EMAIL PROTECTED] wrote:
 
 On Thu, 4 Sep 2008 11:51:33 -0300
 Joey Mingrone [EMAIL PROTECTED] wrote:
 
  Has anyone had any success collecting data from a Garmin Forerunner
  305?
  
  When I connect the device I see the kernel messages:
  Sep  4 11:39:22 jrm root: Unknown USB device: vendor 0x091e product
  0x0003 bus uhub1
  Sep  4 11:39:22 jrm kernel: ugen0: vendor 0x091e product 0x0003,
  class 255/255, rev 1.10/0.01, addr 2 on uhub1
  
  The documentation for the port astro/GPSMan seems to indicate it
  supports this model, but I haven't had any luck.
  
  % uname -a
  FreeBSD xxx.xxx 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #3: Thu Jun
12
  18:47:50 ADT 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/xxx  i386
 
 Unfortunately Garmin use their own protocol for communicating between
 the GPS and the PC.  Under Linux it's supported by the garmin_gps
 driver but there's no equivalent for FreeBSD yet.
 
 
 Sorry, it turns out that's wrong: the gpsbabel developers recommend
not
 using garmin_gps because apparently it often doesn't work.  Instead
 they recommend using gpsbabel's 'garmin' input/output format.  It
 interfaces to the device using libusb - which, fortunately for us runs
 on FreeBSD! I've just successfully read back GPS data into a GPX file
 using gpsbabel on FreeBSD 8-CURRENT and the 'usb2' usb stack. 
 
 I don't know if it'll work with the usb stack that's in shipping
 version of FreeBSD though, and even with the new stack I had to make a
 change to libgpsusb.c in gpsbabel to get it working.

The best way to help fix these problems are:

A) Submit a patch for the changes you made.

B) Contact the maintainers and provide them with all of the details,
what you found, what didn't work, what you modified and the final
results. If you have traces or data captures, they may want to see them.
They can't fix problems they don't understand. If they don't have access
to that hardware, or something similar, they might even ask you to do
some experiments for them to extend their knowledge. All of that will
help them improve the quality of future releases.

Bob McConnell
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: garmin forerunner 305

2008-11-04 Thread Boris Samorodov
Bruce Cran [EMAIL PROTECTED] writes:

 I don't know if it'll work with the usb stack that's in shipping
 version of FreeBSD though, and even with the new stack I had to make a
 change to libgpsusb.c in gpsbabel to get it working.

Can you submit a patch? Thanks!


WBR
-- 
Boris Samorodov (bsam)
Research Engineer, http://www.ipt.ru Telephone  Internet SP
FreeBSD committer, http://www.FreeBSD.org The Power To Serve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: garmin forerunner 305

2008-11-03 Thread Bruce Cran
On Thu, 4 Sep 2008 20:24:02 +0100
Bruce Cran [EMAIL PROTECTED] wrote:

 On Thu, 4 Sep 2008 11:51:33 -0300
 Joey Mingrone [EMAIL PROTECTED] wrote:
 
  Hi,
  
  Has anyone had any success collecting data from a Garmin Forerunner
  305?
  
  When I connect the device I see the kernel messages:
  Sep  4 11:39:22 jrm root: Unknown USB device: vendor 0x091e product
  0x0003 bus uhub1
  Sep  4 11:39:22 jrm kernel: ugen0: vendor 0x091e product 0x0003,
  class 255/255, rev 1.10/0.01, addr 2 on uhub1
  
  The documentation for the port astro/GPSMan seems to indicate it
  supports this model, but I haven't had any luck.
  
  % uname -a
  FreeBSD xxx.xxx 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #3: Thu Jun 12
  18:47:50 ADT 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/xxx  i386
 
 Unfortunately Garmin use their own protocol for communicating between
 the GPS and the PC.  Under Linux it's supported by the garmin_gps
 driver but there's no equivalent for FreeBSD yet.
 

Sorry, it turns out that's wrong: the gpsbabel developers recommend not
using garmin_gps because apparently it often doesn't work.  Instead
they recommend using gpsbabel's 'garmin' input/output format.  It
interfaces to the device using libusb - which, fortunately for us runs
on FreeBSD! I've just successfully read back GPS data into a GPX file
using gpsbabel on FreeBSD 8-CURRENT and the 'usb2' usb stack. 

I don't know if it'll work with the usb stack that's in shipping
version of FreeBSD though, and even with the new stack I had to make a
change to libgpsusb.c in gpsbabel to get it working.

-- 
Bruce Cran
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


garmin forerunner 305

2008-09-04 Thread Joey Mingrone
Hi,

Has anyone had any success collecting data from a Garmin Forerunner 305?

When I connect the device I see the kernel messages:
Sep  4 11:39:22 jrm root: Unknown USB device: vendor 0x091e product
0x0003 bus uhub1
Sep  4 11:39:22 jrm kernel: ugen0: vendor 0x091e product 0x0003,
class 255/255, rev 1.10/0.01, addr 2 on uhub1

The documentation for the port astro/GPSMan seems to indicate it
supports this model, but I haven't had any luck.

% uname -a
FreeBSD xxx.xxx 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #3: Thu Jun 12
18:47:50 ADT 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/xxx  i386

Thanks,

Joey
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: garmin forerunner 305

2008-09-04 Thread Bruce Cran
On Thu, 4 Sep 2008 11:51:33 -0300
Joey Mingrone [EMAIL PROTECTED] wrote:

 Hi,
 
 Has anyone had any success collecting data from a Garmin Forerunner
 305?
 
 When I connect the device I see the kernel messages:
 Sep  4 11:39:22 jrm root: Unknown USB device: vendor 0x091e product
 0x0003 bus uhub1
 Sep  4 11:39:22 jrm kernel: ugen0: vendor 0x091e product 0x0003,
 class 255/255, rev 1.10/0.01, addr 2 on uhub1
 
 The documentation for the port astro/GPSMan seems to indicate it
 supports this model, but I haven't had any luck.
 
 % uname -a
 FreeBSD xxx.xxx 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #3: Thu Jun 12
 18:47:50 ADT 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/xxx  i386

Unfortunately Garmin use their own protocol for communicating between
the GPS and the PC.  Under Linux it's supported by the garmin_gps
driver but there's no equivalent for FreeBSD yet.

-- 
Bruce Cran
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]