Wael Khalil | 2 Mar 2006 11:36
Picon
Favicon

Help

Hi guys
I'm only a student
I'm trying to connect two computers together using the usual USB cable which ends with two male connectors on both sides
so I cut the power wire within the cable
and connected the two computers to their USB ports
I used the jusb API for Windows and javax-usb to do that
but java didn't recognize any device on any port even though I know that the root hub
is a device (isn't it)
 
So I'm asking your help because I have to handle this project to my supervisor in no time (Pleeeeeeeeeeeeeeease)
1- I want to ask you guys is it about the cable:
I mean that did I ruin the cable when I cut the power wire in it?!!!
Could it work if I didn't cut that wire (I thought that the ports might be damaged or even the motherboard culd be damaged also) is my thought right or not.
 
Note: There's a USB device in the market which can be used to connect two windows systems together, I am not allowed to use it.
 
2- Or is the whole idea is wrong and I can't connect two PCs through usb ports
using Javax-usb?
 
3- Can I do this through USB hub?
 
If the answer is Yes I can connect the PCs by the help of Java over USB ports
please send me a solution (How to connect the PCs) and a code to begin with.
 
and if I can't do it please tell me why.
 
and thanks a lot already
Wael El-Khalil

Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
Roger Lindsjö | 2 Mar 2006 14:49

Re: Help


Wael Khalil wrote:
> Hi guys
> I'm only a student
> I'm trying to connect two computers together using the usual USB cable 
> which ends with two male connectors on both sides
> so I cut the power wire within the cable
> and connected the two computers to their USB ports
> I used the jusb API for Windows and javax-usb to do that
> but java didn't recognize any device on any port even though I know that 
> the root hub
> is a device (isn't it)

> So I'm asking your help because I have to handle this project to my 
> supervisor in no time (Pleeeeeeeeeeeeeeease)
> 1- I want to ask you guys is it about the cable:
> I mean that did I ruin the cable when I cut the power wire in it?!!!
> Could it work if I didn't cut that wire (I thought that the ports might 
> be damaged or even the motherboard culd be damaged also) is my thought 
> right or not.

You should NOT connect the 2 computers with a home made cable, it will 
not work, and if the computers are on different potential levels you 
could get a power rush.

(Earlier I connected 2 ungrounded computers using a BNC cable, and you 
could actually see sparks going from from one of the computers to the 
shield of the cable before they connected and had a common ground via 
the cable shield.)

> Not e: There's a USB device in the market which can be used to connect 
> two windows systems together, I am not allowed to use it.

Too bad, that's probably the only way you could connect two computers 
using USB.

> 2- Or is the whole idea is wrong and I can't connect two PCs through usb 
> ports
> using Javax-usb?

Javax.usb is for communicating with the devices. With the special cables 
used to connect two computers there is actually a device in the middle 
which both computers (hosts) talks to.

> 3- Can I do this through USB hub?
>  
> If the answer is Yes I can connect the PCs by the help of Java over USB 
> ports
> please send me a solution (How to connect the PCs) and a code to begin with.
>  
> and if I can't do it please tell me why.

There are several technical reasons why this can not work, USb does not 
use a protocol with collision detection or some other kind of 
collaboration to get multiple devices to share a common cable. Instead 
there is a host (the computer) which tells each device when it can send 
data. Now, if you take 2 computers and connect them together they will 
both try to control the bus.

For more information of how this actually works I'd recommend reading 
the specifications at www.usb.org.

//Roger

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Wael Khalil | 2 Mar 2006 17:48
Picon
Favicon

Thanks a lot

Thanks a lot Rojer
you've been a good help
can I ask again:
if I connected the 2 computers using the special link (that you've talked about)
the one with the device in the middle
can I use javax-usb to communicate with it in both PCs
or I need to have its Java driver installed (like the JUSB API)
 
can you provide me some code to do the listening and transfer any data or even characters between the the PCs
 
and I will be grateful
 
thanks again

Yahoo! Mail
Use Photomail to share photos without annoying attachments.
Aravindakshan M R | 5 Mar 2006 08:19
Picon
Favicon

The version is :javax.usb.UsbException: Error while loading shared library libJavaxUsb.so : no JavaxUsb in java.library.path

Hi everyone,

          I have downloaded the following  three packages :         
                                 javax-usb_1.0.1.tar.bz2
                                 javax-usb-ri-linux_1.0.1.tar.bz2
                                javax-usb-ri_1.0.1.tar.bz2
And then build jar files using Ant. These jar files where were added to the classpath.Also the directory containing the javax.usb.properties was added to the classpath.
The simple program that i am trying to run is below:

import java.util.*;
import javax.usb.*;
public class trial {
   
    /** Creates a new instance of trial */
public static void main(String args[])
{
try
{       
   UsbServices servee=UsbHostManager.getUsbServices();
 
}
catch(Exception e) { System.out.println("The version is :" +e);}
   
}
}

The above program gets compiled but it doesnot run and gives the error message shown in the subject.
Kindly help regarding this as quickly as possible.

Thank you
Aravind

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
Wael Khalil | 5 Mar 2006 12:56
Picon
Favicon

Help Again

My name is Wael
I want to ask about how to run the javax-usb API on JBuilder without doing the >ant command

On Windows XP
Is there a way to make JBuilder recognize the javax-usb

If there's any code examples to write or read from a usb device (like usb storage device or the device used to connect to PCs together) using javax-usb I'll be thankful if you send it

thank you already

Wael El-Khalil


Yahoo! Mail
Use Photomail to share photos without annoying attachments.
Dan Streetman | 6 Mar 2006 16:55
Picon

Re: The version is :javax.usb.UsbException: Error while loading shared library libJavaxUsb.so : no JavaxUsb in java.library.path


Please see the FAQ:
http://javax-usb.org/faq.html#linux_imp_jar_file

On Sat, 4 Mar 2006, Aravindakshan M R wrote:

>Hi everyone,
> 
>           I have downloaded the following  three packages :          
>                                  javax-usb_1.0.1.tar.bz2
>                                  javax-usb-ri-linux_1.0.1.tar.bz2
>                                 javax-usb-ri_1.0.1.tar.bz2
> And then build jar files using Ant. These jar files where were added to the classpath.Also the directory
containing the     javax.usb.properties was added to the classpath.
> The simple program that i am trying to run is below:
> 
> import java.util.*;
> import javax.usb.*;
> public class trial {
>     
>     /** Creates a new instance of trial */
> public static void main(String args[])
> {
> try
> {        
>    UsbServices servee=UsbHostManager.getUsbServices();
>   
> }
> catch(Exception e) { System.out.println("The version is :" +e);}
>     
> }
> }
> 
> The above program gets compiled but it doesnot run and gives the error message shown in the subject.
> Kindly help regarding this as quickly as possible.
> 
> Thank you
> Aravind
> 
>		
>---------------------------------
>Brings words and photos together (easily) with
> PhotoMail  - it's free and works with Yahoo! Mail.

--

-- 
Dan Streetman
ddstreet <at> ieee.org
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Gmane