libusb-1.0

220 views
Skip to first unread message

Leon Botha

unread,
Jan 21, 2013, 9:09:50 AM1/21/13
to fo...@googlegroups.com
Dear Developers

Can you "re-write" the usb section to use libusb-1.0 instead of libusb-0.1?

I am using Openwrt on a "Carambola" unit and i am unable to get it to work.
From the little knowledge i have, it seems that it is NOT detecting the device correctly. I do not see the Product and user id been detected, but if i look as Hotplug, it is detecting the correct values.
If someone is willing to assist, i am prepared to try.

It seems that you need to specify libusb-1.0 in the make file, change usb.h to libusb.h and change the usb functions to libusb-1.0 from libusb-0.1

Leon

Doug

unread,
Jan 28, 2013, 1:05:40 PM1/28/13
to fo...@googlegroups.com
I am certainly not an expert on this but I do have FOWSR running. Can't you load both usb libraries? What Unix OS are you using? I have it running on Debian Lenny and on SUSE 10.3 without problems.

I doubt there will be any more development of FOWSR although it would be nice if there was. I haven't seen any comments from them in all the time I have been on this list. FOWSR is a nice simple utility that basically does what it is suppose to.

Doug

Gerry

unread,
Jan 28, 2013, 1:39:42 PM1/28/13
to fo...@googlegroups.com
Also no expert here, but ...
He's using OpenWrt for his linux version.
(What version of openwrt, though ...)

Yes, people do load both libraries --
There's a libusb-compat that should work for fowsr. But there's a libusb-0.1 ipk
out there somewhere too.

There's a lot of information on the web about openwrt and libusb and fowsr.

I've actually tried compiling fowsr with libusb-1.0 and have been unsuccessful.
I'm using a chumby to talk to the weather station. (arm arch)
I have been successful using fowsr on the chumby, but in the end
I switched to a custom build of wwsr which also uses libusb-0.1.4

If you get it to work, please share!

Gerry
> --
> Du mottar denne meldingen fordi du abonnerer pᅵ Google-gruppen
> ᅵfowsrᅵ.
> Hvis du vil avslutte abonnementet pᅵ denne gruppen, sender du en
> e-post til fowsr+un...@googlegroups.com.
> Du finner flere alternativer pᅵ
> https://groups.google.com/groups/opt_out.
> ᅵ
> ᅵ
>
>

--
Gerry Skerbitz
gs...@skerbitz.org

Leon Botha

unread,
Jan 29, 2013, 2:07:49 AM1/29/13
to fo...@googlegroups.com, gs...@skerbitz.org
Hi Doug / Gerry

There is a "OpenWrt" fowsr package avalable, but i was unsuccessful in getting it to work.
I then compiled one from source for my unit and i had the same issue.

Looking at the errors and "Google" it seems that it works on Linux 2.4 and not on 2.6.
I narrow it down to libusb-0.1 that is not enumerating the usb correctley. libusb-0.1 does find the devices, is unable to get the product and device id.

So if i can get some help, i am willing to try get libusb-1.0 as it seems that it works

Leon

Doug

unread,
Feb 2, 2013, 3:30:10 AM2/2/13
to fo...@googlegroups.com
Specifically what error are you getting? Did you download and install the libusb-compat-0.1.4
from this site -  http://www.libusb.org/   ?

Doug

--
Du mottar denne meldingen fordi du abonnerer på Google-gruppen «fowsr».
For å melde seg av denne gruppen og slutte å motta e-poster fra den, send en e-post til fowsr+un...@googlegroups.com.
Du finner flere alternativer på https://groups.google.com/groups/opt_out.
 
 


Doug Crompton

unread,
Feb 2, 2013, 2:31:36 PM2/2/13
to fo...@googlegroups.com
I am running FOWSR on Debian Lenny with a 2.6 kernel on NSLU2 hardware. I did not have any problems. I don't remember if I loaded  libusb .1  but I suspect I did. Unfortunately the system is remotely located and I can't log into it so I can't tell you any more detail until I get there in a few weeks.

You can get more info here -    http://www.libusb.org/wiki/APIs

I have run so many different SW packages on this system that I am not sure what I loaded. I could have loaded the libusb development package also.  But I think you definitely want to load the latest libusb-compat-0.1  package.
 
Doug

Cc: gs...@skerbitz.org
Sent: Tuesday, January 29, 2013 2:07 AM
Subject: Re: libusb-1.0
--
Du mottar denne meldingen fordi du abonnerer på Google-gruppen «fowsr».
For å melde seg av denne gruppen og slutte å motta e-poster fra den, send en e-post til fowsr+un...@googlegroups.com.
Du finner flere alternativer på https://groups.google.com/groups/opt_out.
 
 


Leon Botha

unread,
Feb 4, 2013, 11:05:33 AM2/4/13
to fo...@googlegroups.com
Hi Doug

I have done the following:
  1. Reload new OpenWrt fowsr package that was compiled with libusb-compat
    1. fows -d
    2. i get: "usb_get_driver_np returned -61"
  2. Re-compile fowsr from source using libusb-compat that use libusb-1.0
    1. fowsr -d
    2. Get the same message as above
As Openwrt is a embedded linux with limited resources, ram and rom, it is very difficult to just load libraries.
I have tried other usb related libraries with zero success.
I have seen someone indicating that they are running fowsr on OpenWrt, but they have not posted their setup.

My feeling is that re-doing fowsr to use libusb-1.0 or usbhid will solve this issue.
My hardware is actually detecting the Fine offset hardware as a HID device:

Installing fowsr:
Installing fowsr (1.0-20110904-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/fowsr_1.0-20110904-1_ramips.ipk.
Installing libusb-compat (0.1.4-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/libusb-compat_0.1.4-1_ramips.ipk.
Installing libusb-1.0 (1.0.9-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/libusb-1.0_1.0.9-1_ramips.ipk.
Configuring libusb-1.0.
Configuring libusb-compat.
Configuring fowsr.

root@OpenWrt:/# cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 3.03
S:  Manufacturer=Linux 3.3.8 dwc_otg
S:  Product=DWC OTG Controller
S:  SerialNumber=dwc_otg.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1941 ProdID=8021 Rev= 1.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
root@OpenWrt:/#

Gerry

unread,
Feb 4, 2013, 11:24:30 AM2/4/13
to Leon Botha, fo...@googlegroups.com
-61 -- that's good.

It means that you have a usb connection and it tried to get stuff, right?
Anyway, check out this thread: http://forum.wdlxtv.com/viewtopic.php?f=33&t=3058

It says -- check out the permissions of the destination directory (the default
is /var/fowsr.dat )

I remember now that I recompiled my fowsr to point to /psp/fowsr.

Gerry



http://forum.wdlxtv.com/viewtopic.php?f=33&t=3058
On Mon, 4 Feb 2013, Leon Botha wrote:

> Hi Doug
>
> I have done the following:
> 1. Reload new OpenWrt fowsr package that was compiled with libusb-compat
> 1. fows -d
> 2. i get: "usb_get_driver_np returned -61"
> 2. Re-compile fowsr from source using libusb-compat that use libusb-1.0
> 1. fowsr -d
> 2. Get the same message as above
> As Openwrt is a embedded linux with limited resources, ram and rom, it is very difficult to just load libraries.
> I have tried other usb related libraries with zero success.
> I have seen someone indicating that they are running fowsr on OpenWrt, but they have not posted their setup.
>
> My feeling is that re-doing fowsr to use libusb-1.0 or usbhid will solve this issue.
> My hardware is actually detecting the Fine offset hardware as a HID device:
>
> Installing fowsr:
> Installing fowsr (1.0-20110904-1) to root...
> Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/fowsr_1.0-20110904-1_ramips.ipk.
> Installing libusb-compat (0.1.4-1) to root...
> Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/libusb-compat_0.1.4-1_ramips.ipk.
> Installing libusb-1.0 (1.0.9-1) to root...
> Downloading http://downloads.openwrt.org/snapshots/trunk/ramips/packages/libusb-1.0_1.0.9-1_ramips.ipk.
> Configuring libusb-1.0.
> Configuring libusb-compat.
> Configuring fowsr.
>
> root@OpenWrt:/# cat /proc/bus/usb/devices
>
> T:ᅵ Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=ᅵ 1 Spd=480ᅵ MxCh= 1
> B:ᅵ Alloc=ᅵ 0/800 us ( 0%), #Int=ᅵ 0, #Iso=ᅵ 0
> D:ᅵ Ver= 2.00 Cls=09(hubᅵ ) Sub=00 Prot=01 MxPS=64 #Cfgs=ᅵ 1
> P:ᅵ Vendor=1d6b ProdID=0002 Rev= 3.03
> S:ᅵ Manufacturer=Linux 3.3.8 dwc_otg
> S:ᅵ Product=DWC OTG Controller
> S:ᅵ SerialNumber=dwc_otg.0
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=ᅵ 0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hubᅵ ) Sub=00 Prot=00 Driver=hub
> E:ᅵ Ad=81(I) Atr=03(Int.) MxPS=ᅵᅵ 4 Ivl=256ms
>
> T:ᅵ Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=ᅵ 2 Spd=1.5ᅵ MxCh= 0
> D:ᅵ Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=ᅵ 1
> P:ᅵ Vendor=1941 ProdID=8021 Rev= 1.00
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HIDᅵ ) Sub=00 Prot=00 Driver=(none)
> E:ᅵ Ad=81(I) Atr=03(Int.) MxPS=ᅵᅵ 8 Ivl=10ms
> root@OpenWrt:/#
>
>
>
>
>
> On Monday, January 21, 2013 4:09:50 PM UTC+2, Leon Botha wrote:
> Dear Developers
>
> Can you "re-write" the usb section to use libusb-1.0 instead of libusb-0.1?
>
> I am using Openwrt on a "Carambola" unit and i am unable to get it to work.
> From the little knowledge i have, it seems that it is NOT detecting the device correctly. I do not see the Product and user id been detected,
> but if i look as Hotplug, it is detecting the correct values.
> If someone is willing to assist, i am prepared to try.
>
> It seems that you need to specify libusb-1.0 in the make file, change usb.h to libusb.h and change the usb functions to libusb-1.0 from
> libusb-0.1
>
> Leon
>
> --
> Du mottar denne meldingen fordi du abonnerer pᅵ Google-gruppen ᅵfowsrᅵ.
> For ᅵ melde seg av denne gruppen og slutte ᅵ motta e-poster fra den, send en e-post til fowsr+un...@googlegroups.com.

Doug Crompton

unread,
Feb 4, 2013, 10:55:15 PM2/4/13
to fo...@googlegroups.com
When I first started using FOWSR I assumed it was not working because of the error messages.

I recompiled with the most stupid USB error messages turned off. Read down in this archive to see what I did. You don't have to turn them off but I got tired of seeing them!

Anyhow don't assume it is not working because you got an error! Did you do a FOWSR -b or -d or -r  ?

These will tell you if there is data being read from the weather station. If they read back good then your problem as was pointed out might be directory permissions. I changed the code in mine to have the fowsr stuff at a different location - /var/log/fowsr   as I remember. Again I sent all that into this list awhile ago and it would be in the archives. If you can't get it and would like my comments I could go back and find them and forward to you.

Doug


Doug Crompton
WA3DSP
www.crompton.com
Sent: Monday, February 4, 2013 11:05 AM
Subject: Re: libusb-1.0

--
Du mottar denne meldingen fordi du abonnerer på Google-gruppen «fowsr».
For å melde seg av denne gruppen og slutte å motta e-poster fra den, send en e-post til fowsr+un...@googlegroups.com.
Du finner flere alternativer på https://groups.google.com/groups/opt_out.
 
 


Leon Botha

unread,
Feb 5, 2013, 10:59:31 AM2/5/13
to fo...@googlegroups.com
Hi Doug / Gerry

I ran fowsr -d,  and it does create a fowsr.dat file in /var. See below terminal capture. from this it seems to pass the checks and populate the buffer, but.....

The fowsr.dat file is 64kb off "0x00" and

root@OpenWrt:/usr/bin# fowsr -d
00414774 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....
usb_get_driver_np returned -61
read_period=0.0
units0=0.0
units_wind_speed=0.0
display_format0=0.0
display_format1=0.0
alarm_enable0=0.0
alarm_enable1=0.0
alarm_enable2=0.0
timezone=0.0
data_refreshed=0.000
data_count=0.000
current_pos=0.000
rel_pressure=0.000
abs_pressure=0.000
date_time=2000-00-00 00:00
alarm.hum_in.hi=0.0
alarm.hum_in.lo=0.0
alarm.temp_in.hi=0.000
alarm.temp_in.lo=0.000
alarm.hum_out.hi=0.0
alarm.hum_out.lo=0.0
alarm.temp_out.hi=0.000
alarm.temp_out.lo=0.000
alarm.windchill.hi=0.000
alarm.windchill.lo=0.000
alarm.dewpoint.hi=0.000
alarm.dewpoint.lo=0.000
alarm.abs_pressure.hi=0.000
alarm.abs_pressure.lo=0.000
alarm.rel_pressure.hi=0.000
alarm.rel_pressure.lo=0.000
alarm.wind_ave.bft=0.0
alarm.wind_ave.ms=0.0
alarm.wind_gust.bft=0.0
alarm.wind_gust.ms=0.0
alarm.wind_dir=0.0
alarm.rain.hour=0.000
alarm.rain.day=0.000
alarm.time=00:00
max.hum_in.val=0.0
max.hum_in.date=2000-00-00 00:00
max.hum_out.val=0.0
max.hum_out.date=2000-00-00 00:00
max.temp_in.val=0.000
max.temp_in.date=2000-00-00 00:00
max.temp_out.val=0.000
max.temp_out.date=2000-00-00 00:00
max.windchill.val=0.000
max.windchill.date=2000-00-00 00:00
max.dewpoint.val=0.000
max.dewpoint.date=2000-00-00 00:00
max.abs_pressure.val=0.000
max.abs_pressure.date=2000-00-00 00:00
max.rel_pressure.val=0.000
max.rel_pressure.date=2000-00-00 00:00
max.wind_ave.val=0.000
max.wind_ave.date=2000-00-00 00:00
max.wind_gust.val=0.000
max.wind_gust.date=2000-00-00 00:00
max.rain.hour.val=0.000
max.rain.hour.date=2000-00-00 00:00
max.rain.day.val=0.000
max.rain.day.date=2000-00-00 00:00
max.rain.week.val=0.000
max.rain.week.date=2000-00-00 00:00
max.rain.month.val=0.000
max.rain.month.date=2000-00-00 00:00
max.rain.total.val=0.000
max.rain.total.date=2000-00-00 00:00
min.hum_in.val=0.0
min.hum_in.date=2000-00-00 00:00
min.hum_out.val=0.0
min.hum_out.date=2000-00-00 00:00
min.temp_in.val=0.000
min.temp_in.date=2000-00-00 00:00
min.temp_out.val=0.000
min.temp_out.date=2000-00-00 00:00
min.windchill.val=0.000
min.windchill.date=2000-00-00 00:00
min.dewpoint.val=0.000
min.dewpoint.date=2000-00-00 00:00
min.abs_pressure.val=0.000
min.abs_pressure.date=2000-00-00 00:00
min.rel_pressure.val=0.000
min.rel_pressure.date=2000-00-00 00:00
00414770 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....
failed to release interface: 0
failed to close interface: 0
root@OpenWrt:/usr/bin#

From the info above it seems that ZERO data is received from the unit and all the locations are "0"

Leon


On Monday, January 21, 2013 4:09:50 PM UTC+2, Leon Botha wrote:

Doug

unread,
Feb 5, 2013, 11:08:32 PM2/5/13
to fo...@googlegroups.com
Have you tried talking to your station with the easyweather program in Windows to make sure the USB is working OK to your unit.
 
Doug
Sent: Tuesday, February 5, 2013 10:59 AM
Subject: Re: libusb-1.0

--

Leon Botha

unread,
Feb 6, 2013, 2:31:36 AM2/6/13
to fo...@googlegroups.com
Hi Doug

I use Sandaysoft Cumulus Weather Station Software to upload the data to WUnderground from a windows unit, and it works 100%.
I do not want the windows desktop running the whole time just for this.


Leon

On Monday, January 21, 2013 4:09:50 PM UTC+2, Leon Botha wrote:

Doug Crompton

unread,
Feb 6, 2013, 3:10:10 AM2/6/13
to fo...@googlegroups.com
Leon,

  What hardware is your openwrt on?
 
Doug
Sent: Wednesday, February 6, 2013 2:31 AM
Subject: Re: libusb-1.0

--

Leon Botha

unread,
Feb 6, 2013, 6:22:42 AM2/6/13
to fo...@googlegroups.com
Hi Doug

Look at - http://www.8devices.com/product/3/carambola


Leon

On Monday, January 21, 2013 4:09:50 PM UTC+2, Leon Botha wrote:

Doug Crompton

unread,
Feb 7, 2013, 2:57:43 AM2/7/13
to fo...@googlegroups.com
Ok, my quick opinion is this is a rather low linux capability card but for the money I guess it is good. Compared to the NSLU2 which is old now it seems to have less capability. There are a ton of small systems out there now. I think I would get one that could run real linux. I have Debian Lenny on my NSLU2
running FOWSR as well as many other things.

Doug
Sent: Wednesday, February 6, 2013 6:22 AM
Subject: Re: libusb-1.0

--
Reply all
Reply to author
Forward
0 new messages