USB Connection Problem

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

USB Connection Problem

Postby Qubits » Sun May 04, 2014 1:53 pm

Hello,

i try to connect my EV3 via USB to upload code.
The EV3 was installed as a network card correctly (win 7).
I gave the EV3 an IP address of the same subnet that I use my local network card with (which is connected to the router).
I can ping the ev3 successfully. However, when trying to upload code, i get:

Using the EV3 menu for upload and to execute program
Creating the jar file or uploading the program failed
java.rmi.ConnectException: Connection refused to host: 192.168.178.222; nested exception is:
java.net.ConnectException: Connection refused: connect
Caused by java.net.ConnectException: Connection refused: connect

what could be the problem? I get the same error when I try to connect to the EV3 with winscp (connection refused)
I use the latest .81 beta.
Qubits
New User
 
Posts: 4
Joined: Sun May 04, 2014 1:49 pm

Re: USB Connection Problem

Postby gloomyandy » Sun May 04, 2014 2:01 pm

How have you assigned the IP address to the EV3? Normally the EV3 will serve up and IP address to your computer via DHCP and you can then use 10.0.1.1 to connect to the EV3. Unless you really know what it is you are doing then it is probably not a good idea to mess around with this!

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4083
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: USB Connection Problem

Postby Qubits » Sun May 04, 2014 2:12 pm

Hi, yes thank you.

It seems the IP is set to 10.0.1.1 internally on the EV3. When I use this address it works.
If course I had to change the IP of my PC network card to that subnet, too.

However, since the EV3s need to be used at a school (and many EV3s) I need to know how to change the internal IP adresses.
Can you tell me how to do it?
Qubits
New User
 
Posts: 4
Joined: Sun May 04, 2014 1:49 pm

Re: USB Connection Problem

Postby gloomyandy » Sun May 04, 2014 2:22 pm

You do not need to have a different IP address for you EV3s unless you plan to connect more than one to the same PC at the same time. The USB based network will simply be a private connection between the PC and EV3 and the multiple EV3s will not interfere with each other. If you simply leave the default settings of the RNDIS device as they are (which is normally to obtain the IP address automatically), things should just work as the EV3 is all setup to serve an IP address to the PC, you should not have to assign an address to the PC RNDIS interface manually (it may take a short while for the address to be assigned, in a class room situation you may want to avoid this by assigning the address in advance, but again you can use the same address on multiple PCs so long as you only have a single EV3 attached at a time).

Do you plan to have more than one EV3 connected to the same PC at the same time? If so then you will need to change the IP address of the EV3, and you will probably have to use the obtain IP address automatically to ensure the interface has an address on the correct sub-net.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4083
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: USB Connection Problem

Postby Qubits » Sun May 04, 2014 2:38 pm

Thank you for the info.
I came a step closer to the solution by simply installing a loopback adapter to windows, so my physical ethernet card doesn't have to be part of the ev3 subnet.
However I need to change the IP adress because the school Lan uses the 10.x.x.x subnet. Every PCs is members of this subnet.
So when we attach multiple robots at differents PCs there will be IP adress conflicts, I guess?
We don't use more than one EV3 on one PC though.
Qubits
New User
 
Posts: 4
Joined: Sun May 04, 2014 1:49 pm

Re: USB Connection Problem

Postby gloomyandy » Sun May 04, 2014 2:52 pm

Hi in which case you can use the same address on all of your EV3s but it simply needs to be one that is not on 10.*.*.*. You can do this by placing a file called netaddress on the fat32 partition before you boot the sdcard for the first time (which is when leJOS gets installed). This file should contain a single line of text that looks like:
X.Y.Z.D
in which case the address of the EV3 will be X.Y.Z.D and the built in dhcp server will serve addresses X.Y.Z.D0 to X.Y.Z.D9 so for instance if the file contains 192.168.0.2 then the address of the EV3 will be 192.168.0.2 and the DHCP server will hand out addresses to the PC in the range 192.168.0.20 to 192.68.0.29.

Note that it may be that this file needs to have Linux line terminators as it will eventually be read by a Linux shell script.

You can also do the same thing by changing the file /home/root/lejos/bin/netaddress on the Linux partition of an already installed sd card (assuming you have the tools to be able to access the partition).

I'm not sure why you needed to install a loopback adapter. What was that for?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4083
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: USB Connection Problem

Postby Qubits » Sun May 04, 2014 4:07 pm

Hi,

at home I have the following setup where I do testing right now:
physical ethernet and wifi card @ 192.168.178.x subnet
the USB RNDIS EV3 card and a just installed loopback adapter.
Ev3 Brick is set to default 10.0.1.1 currently
I run Windows 7 and can reproduce the following:

When setting the RNDIS adapter to dhcp (default) it doesn't get an ip assinged from the brick. it defaults to the 169.254.x.x range that means no dhcp found.
with that setting I can not ping the brick.

When I set the RNDIS adapter manually to an IP of the 10.x.x.x range, like 10.0.1.22, I can ping both 10.0.1.22 and 10.0.1.1
You are right about the loopback adapter. It's not needed. It was before I realised that the brick and NDIS adapter use 2 different IPs and are not the same.

So basically the question remains why the RNDIS adapter doesn't get an IP assigned by the brick.
I made a vanilla install, no changes made.


I already tried changing the netadress file before. I set it to 192.168.178.222
The IP was correctly displayed in the brick LCD.
Manually putting the RNDIS in the same subnet, I was not able to ping the brick.
Maybe it was because the last part of the IP hat 3 digits. I will try again.

Edit: Interesting, I changed to IP 192.168.1.1 now and now even dhcp works. :)
Thanks again for the help!
Qubits
New User
 
Posts: 4
Joined: Sun May 04, 2014 1:49 pm

Re: USB Connection Problem

Postby krischy » Thu Oct 23, 2014 2:40 pm

I had to do 3 config steps which were not discribed somewhere together
1. Install the USB-Ethernet-Gadget driver (see https://github.com/ev3dev/ev3dev/wiki/S ... Networking)
2. Configure the new Network Interface on TCPv4 to have static IP address 10.0.1.2 (or something in the network of the brick)
3. In eclipse: Window->Preferences->leJOS ev3: Connect to named brick "10.0.1.2" (my brick has a "natural" name given - but that name does not work here, although it works in leJOS ev3control "search")
Hope this helps someone to save time ...
krischy
New User
 
Posts: 1
Joined: Thu Oct 23, 2014 1:18 pm

Re: USB Connection Problem

Postby gloomyandy » Thu Oct 23, 2014 2:47 pm

You should not need to set an IP address on the interface. Just use DHCP to obtain an address from the EV3.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4083
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff