Richard Clegg | 18 Mar 16:43 2008
Picon

Latest source code from CVS and Fedora Core 6 & 8

Hi,
 
I have been testing the latest source code from CVS on Fedora Core 6 and 8 and it looks like the code is not using the correct identifiers for the device nodes at /dev/bus/usb/*/*.
 
Fedora Core 6 and 8 use device nodes of the form:
 
/dev/bus/usb/001/001
/dev/bus/usb/002/001
/dev/bus/usb/003/001
etc
 
but the latest javax-usb source code is trying to access the device nodes:
 
/dev/bus/usb/1/1
/dev/bus/usb/2/1
/dev/bus/usb/3/1
etc
 
and is failing.
 
Changing the following lines in javax-usb-ri-linux/jni/JavaxUsbKernel.c and then recompiling seemed to solve the problem:
 
#define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%d/%d"
changed to
#define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%3.03d/%3.03d"
 
#define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%d/%d"
changed to
#define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%3d/%3d"
Does anyone know if the use of leading zeroes in the naming of the device nodes under /dev/bus/usb/ is specific to Fedora Core or is it used on all Linux distributions?
 
Regards,
 
Richard

Rise to the challenge for Sport Relief with Yahoo! for Good
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
Roger Lindsjö | 18 Mar 19:52 2008
Picon

Re: Latest source code from CVS and Fedora Core 6 & 8

Richard Clegg wrote:
> Hi,
>  
> I have been testing the latest source code from CVS on Fedora Core 6 
> and 8 and it looks like the code is not using the correct identifiers 
> for the device nodes at /dev/bus/usb/*/*.
>  
> Fedora Core 6 and 8 use device nodes of the form:
>  
> /dev/bus/usb/001/001
> /dev/bus/usb/002/001
> /dev/bus/usb/003/001
> etc
>  
> but the latest javax-usb source code is trying to access the device 
> nodes:
>  
> /dev/bus/usb/1/1
> /dev/bus/usb/2/1
> /dev/bus/usb/3/1
> etc
>  
> and is failing.
>  
> Changing the following lines in 
> javax-usb-ri-linux/jni/JavaxUsbKernel.c and then recompiling seemed to 
> solve the problem:
>  
> #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%d/%d"
> changed to
> #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%3.03d/%3.03d"
>  
> #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%d/%d"
> changed to
> #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%3d/%3d"
> Does anyone know if the use of leading zeroes in the naming of the 
> device nodes under /dev/bus/usb/ is specific to Fedora Core or is it 
> used on all Linux distributions?
>
It seems to vary, and I guess that Dan's system has no leading zeroes 
while my (fedora 7) does. I made the same changes as you to get it 
running. I think we have to improve the code which handles those files a 
bit.

//Roger Lindsjö

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
Dan Streetman | 18 Mar 20:18 2008
Picon

Re: Latest source code from CVS and Fedora Core 6 & 8

I think newer systems may also have nodes (symlinks, really) somewhere
in the /sys filesystem, but I haven't actually dug into it so I'm not
sure.

On Tue, Mar 18, 2008 at 2:52 PM, Roger Lindsjö <roger <at> tilialacus.net> wrote:
> Richard Clegg wrote:
>  > Hi,
>  >
>  > I have been testing the latest source code from CVS on Fedora Core 6
>  > and 8 and it looks like the code is not using the correct identifiers
>  > for the device nodes at /dev/bus/usb/*/*.
>  >
>  > Fedora Core 6 and 8 use device nodes of the form:
>  >
>  > /dev/bus/usb/001/001
>  > /dev/bus/usb/002/001
>  > /dev/bus/usb/003/001
>  > etc
>  >
>  > but the latest javax-usb source code is trying to access the device
>  > nodes:
>  >
>  > /dev/bus/usb/1/1
>  > /dev/bus/usb/2/1
>  > /dev/bus/usb/3/1
>  > etc
>  >
>  > and is failing.
>  >
>  > Changing the following lines in
>  > javax-usb-ri-linux/jni/JavaxUsbKernel.c and then recompiling seemed to
>  > solve the problem:
>  >
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%3.03d/%3.03d"
>  >
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%3d/%3d"
>  > Does anyone know if the use of leading zeroes in the naming of the
>  > device nodes under /dev/bus/usb/ is specific to Fedora Core or is it
>  > used on all Linux distributions?
>  >
>  It seems to vary, and I guess that Dan's system has no leading zeroes
>  while my (fedora 7) does. I made the same changes as you to get it
>  running. I think we have to improve the code which handles those files a
>  bit.
>
>  //Roger Lindsjö
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  javax-usb-devel mailing list
>  javax-usb-devel <at> lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
Richard Clegg | 19 Mar 11:08 2008
Picon

Re: Latest source code from CVS and Fedora Core 6 & 8

Hi,

 

Thank you for the responses.

 

Below are some results of further investigations on Fedora Core 8.

 

Fedora Core 8 (kernel-2..6.23.1-42) appears to use the following rule in 50-udev-default.rules to name the USB device nodes:

 

SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

 

where DEVTYPE, BUSNUM and DEVNUM are the event environment variables associated with the uevent that is generated when the USB device is inserted.

 

The /sys file system includes information about the device node name for each USB device but I cannot find any symlinks to the nodes. For example,

 

/sys/bus/usb/devices/usb1 contains devnum and busnum files which hold the device number and bus number of the usb1 device (an EHCI Host Controller, in this case). The numbers stored in these files do not have leading zeroes. There is also a uevent file, which contains the name of the device node and the values of the BUSNUM and DEVNUM variables. See an example uevent file below:

 

MAJOR=189
MINOR=0
DEVTYPE=usb_device
DRIVER=usb
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
DEVICE=/proc/bus/usb/001/001
PRODUCT=0/0/206
TYPE=9/0/1
BUSNUM=001
DEVNUM=001

 
Regards,
 
Richard

----- Original Message ----
From: Dan Streetman <ddstreet <at> ieee.org>
To: Roger Lindsjö <roger <at> tilialacus.net>
Cc: Richard Clegg <cleggr24 <at> yahoo.co.uk>; javax-usb-devel <at> lists.sourceforge.net
Sent: Tuesday, 18 March, 2008 9:18:56 PM
Subject: Re: [javax-usb-devel] Latest source code from CVS and Fedora Core 6 & 8

I think newer systems may also have nodes (symlinks, really) somewhere
in the /sys filesystem, but I haven't actually dug into it so I'm not
sure.

On Tue, Mar 18, 2008 at 2:52 PM, Roger Lindsjö <roger <at> tilialacus.net> wrote:
> Richard Clegg wrote:
>  > Hi,
>  >
>  > I have been testing the latest source code from CVS on Fedora Core 6
>  > and 8 and it looks like the code is not using the correct identifiers
>  > for the device nodes at /dev/bus/usb/*/*.
>  >
>  > Fedora Core 6 and 8 use device nodes of the form:
>  >
>  > /dev/bus/usb/001/001
>  > /dev/bus/usb/002/001
>  > /dev/bus/usb/003/001
>  > etc
>  >
>  > but the latest javax-usb source code is trying to access the device
>  > nodes:
>  >
>  > /dev/bus/usb/1/1
>  > /dev/bus/usb/2/1
>  > /dev/bus/usb/3/1
>  > etc
>  >
>  > and is failing.
>  >
>  > Changing the following lines in
>  > javax-usb-ri-linux/jni/JavaxUsbKernel.c and then recompiling seemed to
>  > solve the problem:
>  >
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%3.03d/%3.03d"
>  >
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%3d/%3d"
>  > Does anyone know if the use of leading zeroes in the naming of the
>  > device nodes under /dev/bus/usb/ is specific to Fedora Core or is it
>  > used on all Linux distributions?
>  >
>  It seems to vary, and I guess that Dan's system has no leading zeroes
>  while my (fedora 7) does. I made the same changes as you to get it
>  running. I think we have to improve the code which handles those files a
>  bit.
>
>  //Roger Lindsjö
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>


Rise to the challenge for Sport Relief with Yahoo! for Good
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
Nick Papior Andersen | 19 Mar 20:56 2008
Picon

Read-write acces and root running on ubuntu

Hi all i have a small request...

First of all, I want to read data from a scientific instrument, that is connected via the usb-interface...

The way to here:

1. I tried getting the javax.usb to work under xubuntu 7.10.
This i can now do but with this output:
So i am guessing that my configuration of the javax.usb is correct. And there it's a problem with the OS.
"
Found 1 devices total.
Found 0 devices with vendor ID0x0951 product ID 0x1602.
Found 1 devices with device class 0x09.
Found 0 devices with manufacturer string "Kingston Technology".
"

2. I then found out that this proparly is due to read/write access on the usbfs filesystem.
By using the command "mount" I get a list of all the devices i have mounted...
In this list the "usbfs" filesystem isn't displayed..
So:

3. I try load it like this:
"sudo mount -o devmode=3D666 -t usbfs usbfs /proc/bus/usb"
I then run "java FindUsbDevice" with exactly the same output as last time (see 1.)!!!

4. Searching the net i find these commands, which i run:
"sudo rmmod usbhid"
,
"sudo rmmod hid"
and
"java FindUsbDevice"

But to no prevail!!! Same output!

5. I also tried running:
"sudo java FindUsbDevice"
And then i get:
"
Exception in thread "main" java.lang.UnsupportedClassVersi

onError: FindUsbDevice (Unsupported major.minor version 50.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
"


I am blank... What could the problem be?
I am guessing that the "sudo java FindUsbDevice" is due to the classpath not being the same on the root-account?

Thanks Nick
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
Kustaa Nyholm | 21 Mar 09:56 2008

Status of Mac OS X and Windows implementations?

Hi List,

I tried to search the archives but could not realy get an answer.

For long time I've been searching (or rather waiting) for a viable
cross platform USB API for Java.

So far I've been using 'libusb' through 'jna' and it has realy been
easy for modest needs.

However, the future of that (too) project seems in doubt, the new
project 'owner' making
doubtfull choises.

So that is where javax-usb comes in. Seeing that is an official JSR it
should have a better future, 
I hope. And about time too that we had a common USB API on Java!
Review
ballot in 2000
and now it is 2008 and no other 'official' implementation than the
Linux-RI. I like Linux
and run three different distros on this Mac, but the reality is that
the 90% of my users are
on Windows, 8% are on Mac and 2% are on Linux ....

So is anyone working on Mac OS X port/implementation? 

I noticed that in addition to what is on the project website someone
had done some work
on the Windows implementation using 'libusb'.  

If there is no work already done on Mac and if I can find the time I
might make hava a go at it.

Which road should one take, start from the Linux-RI, or from the
existing Windows-libusb 
code, or from the Ricoh BSD code, after all, Mac OS X is BSD at some
level? Or is there
a licensing issue with the Ricoh code?

br Kusti

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Karthikeyan | 26 Mar 03:09 2008
Picon

Karthikeyan sent you a friend request on Yaari...

Karthikeyan Balachandar wants you to join Yaari!

Is Karthikeyan your friend?

Yes, Karthikeyan is my friend!      No, Karthikeyan isn't my friend.

Please respond or Karthikeyan might think you said no :(

Thanks,
The Yaari Team

____
You are receiving this message because someone you know registered for Yaari and listed you as a contact.
If you prefer not to receive this email tell us here.
If you have any concerns regarding the content of this message, please email abuse <at> yaari.com.
Yaari LLC, 358 Angier Ave, Atlanta, GA 30312
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Gmane