Error - Inappropriate ioctl for device - no data download posssible :-(

479 views
Skip to first unread message

wieselflink

unread,
Aug 31, 2012, 7:32:21 AM8/31/12
to fo...@googlegroups.com
Hi all,

maybe someone has a idea and can explain why the data - download is not working ? 
I started like the description below : 

0) lsusb give me this answer :
------------------------------
root@brenner:/# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 1941:8021 Dream Link WH1080 Weather Station / USB Missile Launcher
Bus 001 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@brenner:/#

The weatherstation is recognized as a -> Dream Link WH1080 Weather Station / USB Missile Launcher

1) i am working with Debian squeeeze
2) i searched for all regarding / installed " libusb " with this -> 
---------------------------------------------------
root@brenner:/# find / -name libusb* -type f
/lib/libusb-0.1.so.4.4.4
/lib/libusb-1.0.so.0.0.0
/var/lib/dpkg/info/libusb-1.0-0.md5sums
/var/lib/dpkg/info/libusb-0.1-4.postinst
/var/lib/dpkg/info/libusbmuxd1.md5sums
/var/lib/dpkg/info/libusbmuxd1.list
/var/lib/dpkg/info/libusbmuxd1.shlibs
/var/lib/dpkg/info/libusb-dev.md5sums
/var/lib/dpkg/info/libusb-1.0-0.list
/var/lib/dpkg/info/libusb-1.0-0-dev.list
/var/lib/dpkg/info/libusbmuxd1.postinst
/var/lib/dpkg/info/libusb-0.1-4.list
/var/lib/dpkg/info/libusb-0.1-4.md5sums
/var/lib/dpkg/info/libusb-1.0-0.postrm
/var/lib/dpkg/info/libusb-dev.list
/var/lib/dpkg/info/libusbmuxd1.symbols
/var/lib/dpkg/info/libusbmuxd1.postrm
/var/lib/dpkg/info/libusb-1.0-0.shlibs
/var/lib/dpkg/info/libusb-1.0-0-dev.md5sums
/var/lib/dpkg/info/libusb-1.0-0.postinst
/var/lib/dpkg/info/libusb-0.1-4.postrm
/var/lib/dpkg/info/libusb-0.1-4.shlibs
/var/cache/apt/archives/libusb-1.0-0-dev_2%3a1.0.8-2_i386.deb
/var/cache/apt/archives/libusb-dev_2%3a0.1.12-16_i386.deb
/usr/lib/libusbmuxd.so.1.0.4
/usr/lib/libusb.la
/usr/lib/pkgconfig/libusb.pc
/usr/lib/pkgconfig/libusb-1.0.pc
/usr/lib/libusb.a
/usr/lib/libusb-1.0.la
/usr/lib/libusb-1.0.a
/usr/include/libusb-1.0/libusb.h
/usr/share/man/man1/libusb-config.1.gz
/usr/share/doc/libusb-1.0-0-dev/html/libusb_8h_source.html
/usr/share/doc-base/libusb-dev
/usr/share/doc-base/libusb-1.0-0-dev
/usr/bin/libusb-config

3) i downloaded the file ( fowsr-1.0-20110904.tar.gz 36.0 KB ) & found this :
---------------------------------------------------------------
root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0# ls -l
insgesamt 104
-rw-r--r-- 1 internet internet 50 18. Jul 2010 AUTHORS
-rw-r--r-- 1 internet internet 1214 4. Sep 2011 ChangeLog
-rw-r--r-- 1 internet internet 18002 10. Apr 2010 COPYING
-rw-r--r-- 1 internet internet 22437 3. Sep 2011 fowsr.c
-rw-r--r-- 1 internet internet 20350 25. Jan 2011 fowsr.h
-rwxr-xr-x 1 internet internet 810 29. Okt 2010 fowsr.sh
-rw-r--r-- 1 internet internet 190 16. Jul 2010 Makefile
-rw-r--r-- 1 internet internet 33 18. Jul 2010 NEWS
-rwxr-xr-x 1 internet internet 401 10. Okt 2010 pwsweather.sh
-rwxr-xr-x 1 internet internet 210 10. Apr 2010 pywws.sh
-rw-r--r-- 1 internet internet 2263 1. Mai 2010 README
-rwxr-xr-x 1 internet internet 433 10. Apr 2010 wunderground.sh
-rwxr-xr-x 1 internet internet 197 16. Jul 2010 xml.sh

4) now i started " make " and got this :
-------------------------------------
root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0# make
gcc -c -o fowsr.o fowsr.c
gcc -lusb -lm -o fowsr fowsr.o
root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0#

5) There are now two (2) new files in the folder :
--------------------------------------------------
-rwxr-xr-x 1 root root 23683 31. Aug 13:17 fowsr
-rw-r--r-- 1 root root 20768 31. Aug 13:17 fowsr.o

6) i start the program without any options and get this :
---------------------------------------------------------
root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0# ./fowsr
0805D800 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 001 on 005
usb_os_find_devices: Found 001 on 004
usb_os_find_devices: Found 001 on 003
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 003 on 001
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
usb_get_driver_np returned 0
interface 0 already claimed by driver \'usbhid\', attempting to detach it
usb_detach_kernel_driver_np returned 0
0805D804 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....
failed to release interface: 0
failed to close interface: 0

7) This is the result which is in the folder /var :
---------------------------------------------------

root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0# ls -l /var/
insgesamt 116
. . . . .
-rw-r--r-- 1 root root 65540 31. Aug 13:20 fowsr.dat
root@brenner:/home/internet/Download/Wetter-Station-Proggi/fowsr-1.0#
. . . . .
But it´s a empty file, no data and i have made ALL by root, who can write everywhere ! 

So now i do not know what i can do to get it working :-(

Who has a idea, or can tell me what was going wrong ?

Thanks in  advance 



wieselflink

unread,
Aug 31, 2012, 7:44:59 AM8/31/12
to fo...@googlegroups.com
Maybe some more information ? : 

The kernel told me this : 

Aug 31 13:08:24 brenner kernel: [ 603.632117] usb 1-1.4: new low speed USB device using ehci_hcd and address 3
Aug 31 13:08:24 brenner kernel: [ 603.733003] usb 1-1.4: New USB device found, idVendor=1941, idProduct=8021
Aug 31 13:08:24 brenner kernel: [ 603.733012] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Aug 31 13:08:24 brenner kernel: [ 603.734362] usb 1-1.4: configuration #1 chosen from 1 choice
Aug 31 13:08:24 brenner kernel: [ 603.966645] usbcore: registered new interface driver hiddev
Aug 31 13:08:24 brenner kernel: [ 603.978831] generic-usb 0003:1941:8021.0001: hiddev0,hidraw0: USB HID v1.00 Device [HID 1941:8021] on usb-0000:00:10.4-1.4/input0
Aug 31 13:08:24 brenner kernel: [ 603.978892] usbcore: registered new interface driver usbhid
Aug 31 13:08:24 brenner kernel: [ 603.979723] usbhid: v2.6:USB HID core driver

But even as at my first post, i am no programmer and so i do not know if this helps . . . .? 
Maybe somebody else can understand what´s going wrong ? 
Thanks 

wieselflink

unread,
Sep 2, 2012, 9:29:17 AM9/2/12
to fo...@googlegroups.com
And once more hi to all,

as DOUG as posted, i took a look to my fowsr.c file and made a egrep and found this :

# egrep 'product*' fowsr.c
struct usb_device *find_device(int vendor, int product) {
&& dev->descriptor.idProduct == product)
int CUSB_Open(int vendor, int product)
dev = find_device(vendor, product);
int product = 0x8021;
CUSB_Open(vendor, product);

even a egrep for " vendor " gave me this result : 

# egrep 'vendor*' fowsr.c
struct usb_device *find_device(int vendor, int product) {
if (dev->descriptor.idVendor == vendor
int CUSB_Open(int vendor, int product)
dev = find_device(vendor, product);
int vendor = 0x1941;
CUSB_Open(vendor, product);

This is the same what - lsusb - tells me :
-----------------------------------------------------------
# lsusb
. . . . 
Bus 001 Device 003: ID 1941:8021 Dream Link WH1080 Weather Station / USB Missile Launcher
Bus 001 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
. . . . . 

Next i changed the place for the output from - //var to : //var//log//fowsr// as you see : 
------------------------------------------------------------------------------------------------------------------------
# egrep '//var' fowsr.c
char fname[] = "//var//log//fowsr//fowsr.dat"; // cache file
CWF_Write('p',"//var//log//fowsr//pywws.log");
CWF_Write('s',"//var//log//fowsr//pwsweather.log");
CWF_Write('w',"//var//log//fowsr//wunderground.log");
CWF_Write('x',"//var//log//fowsr//fowsr.xml");

I made a empty file by using :
------------------------------------------
root@brenner:/var/log/fowsr# ls -l
insgesamt 0
-rw-r--r-- 1 root root 0 2. Sep 15:14 fowsr.dat
root@brenner:/var/log/fowsr#

Last i changed as DOUG has written the debug level from 255 to 1 : 
-------------------------------------------------------------------------------------------------
/***** The CUSB class *****/

int CUSB_Open(int vendor, int product)
{
int ret;
char buf[1000];

usb_init();
usb_set_debug(1);
usb_find_busses();
usb_find_devices();

dev = find_device(vendor, product);
assert(dev);

devh = usb_open(dev);
assert(devh);

After this i tried a new compile with this result : 
--------------------------------------------------------------------
# make
gcc -c -o fowsr.o fowsr.c
gcc -lusb -lm -o fowsr fowsr.o
root@brenner:/home/internet/tmp/fowsr-1.0#

As you see, there is the same problem as before : 
------------------------------------------------------------------------
root@brenner:/home/internet/tmp/fowsr-1.0# ./fowsr
0805D840 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....
usb_set_debug: Setting debugging level to 1 (on)
usb_get_driver_np returned -61
0805D844 | 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ | ....

failed to release interface: 0
failed to close interface: 0
root@brenner:/home/internet/tmp/fowsr-1.0#

So now i really do not know what i can do to get this - fowsr - working :-( 

Who has a idea, or can explain me what i can try ? - Thanks 

:
Am Freitag, 31. August 2012 13:32:21 UTC+2 schrieb wieselflink:

Doug

unread,
Sep 2, 2012, 12:58:59 PM9/2/12
to fo...@googlegroups.com
Did you try a 'fowsr -r'  or  -b or -d

They should return data from your weather station to the screen. From what I see there are no serious error messages. You can ignore the release and close messages at the end.  My guess from what I experienced here is that it is working. Tell us what you see when you do  the -r  or -b or -d ?  This display a memory position followed by a bunch of data. It won't make any sense but if it is there I think you are working.  If so then try  foswr -x  or -w   and it should make a log file in the directory you selected.  /var/log/fowsr.     I think you said you created the fowsr directory under log. If not you need to. Also I am running here as root. 

Doug

From: wieselflink <reginaldo...@gmx.de>
To: fo...@googlegroups.com
Sent: Sunday, September 2, 2012 9:29 AM
Subject: Re: Error - Inappropriate ioctl for device - no data download posssible :-(

Mario Agostini

unread,
Sep 22, 2013, 5:40:20 AM9/22/13
to fo...@googlegroups.com
Some issue here, my be I have not understand we'll watch I have to do, my English is not so good...
It seems that at the and Doug has been successfully in connecting his station but how?

I have understand that the error message is not so important if with fowsr-d I have the return of data in my ws 1080 and so it is for me.
It looks that the real trouble is the invoice of data to the wunderground account but watch solve it ?

Thanks very much and excuse me again for bad english

Reply all
Reply to author
Forward
0 new messages