Does 0.5.0 support remote access?

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

Moderators: roger, gloomyandy, skoehler

Does 0.5.0 support remote access?

Postby comix » Sun Dec 29, 2013 1:40 am

Hi, I just tried to remote access my ev3 under this tutorial: http://sourceforge.net/p/lejos/wiki/Rem ... 0an%20EV3/

However, I got this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: MyEV3RemoteAccess
Caused by: java.lang.ClassNotFoundException: MyEV3RemoteAccess
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I can running the hello world program using the ant builder.

Does 0.5.0 support remote access? Or I messed up anything?

BTW, I scp the EV3SensorMonitor to my ev3, after clicking execute, it died... Is it a BUG? And does 0.5 support ultrasonic sensor? I can not find tutorial of this part.

Thanks
comix
New User
 
Posts: 11
Joined: Fri Dec 27, 2013 2:05 am

Re: Does 0.5.0 support remote access?

Postby Aswin » Sun Dec 29, 2013 9:42 am

Hi,

Alpha 0.5 supports both the NXT and EV3 ultrasonic sensors. The classes are called NXTUltrasonicSensor and EV3UltrasonicSensor, they are found in lejos.hardware.sensor.

Both US sensors support multiple modes (see lejos.hardware.sensor.SensorModes). After having instantiated the sensor class you query the class for a SampleProvider (see lejos.robotics.SampleProvider) that implements the mode of your choice using the getMode() method. The SampleProvider method fetchSample() will deliver you the readings from the sensor.
All sensors in the sensor framework Now support this same mechanism.

Two more things about these sensors. The readings are in meters as this is the standard in the sensor framework. The out of range value no longer is 255, nor 0.255. It now is Float.POSITIVE_INFINITY.

Aswin
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Does 0.5.0 support remote access?

Postby gloomyandy » Sun Dec 29, 2013 9:56 am

That stack trace seems to indicate that it Can't find your main class (which is I assume what MyEV3RemoteAccess is). How are you building and running your program. Are you sure that you have things configured correctly?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3646
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Does 0.5.0 support remote access?

Postby comix » Sun Dec 29, 2013 1:29 pm

gloomyandy wrote:That stack trace seems to indicate that it Can't find your main class (which is I assume what MyEV3RemoteAccess is). How are you building and running your program. Are you sure that you have things configured correctly?


Hi Andy,

Actually I'm not sure the correctness of configuration...

What I did was just click on the Run button in eclipse, which was like a green arrow.

Could you tell me more to do it? Thanks
comix
New User
 
Posts: 11
Joined: Fri Dec 27, 2013 2:05 am

Re: Does 0.5.0 support remote access?

Postby lawrie » Wed Jan 01, 2014 4:51 pm

Hi comix,

As Andy says, it looks like your Eclipse configuration is broken in some way, if you cannot run the main class of a project that you just created. Perhaps you should try a very simple Java test program that does not use leJOS to see if your Eclipse configuration is working at all. What operating system are you on? Your problem could be the same as the one mcrosbie hit on MAC OS X, where the project specified Java 7 but only Java 6 was installed. Posting the contents of your .classpath file would be useful.

Remote control does work but there was a problem with the EV3Menu project and you will have to update your menu to the latest head version to do remote control - see viewtopic.php?f=18&t=5107&start=30#p21405.

The EV3SensorMonitor program does work, but it had some problems so I have just made some changes to it. Again you will need to pull the head version from git to get that.

I am changing all the sample projects to set ev3.host to 10.0.1.1 but to allow a local.properties file to override it. If you are using Wifi, you will need to create a local.properties file and add:

Code: Select all
ev3.host=ip-address


to it. Replace ip-address with the IP address that the menu program shows on the EV3 LCD.

You should then be able to run the ant build file to build EV3SensorMonitor and copy it to the samples directory on the EV3. You can then run it from the Samples screen in the menu.

Note, however, that EV3SensorMonitor sends a lot of output to System.out and to see this, you need to run EV3Control or EV3ConsoleViewer from ev3tools.
Press Enter+Down to finish the sensor monitor.

The sensor monitor is mainly useful to see if a sensor is working. It monitors what sensors you plug into the EV3 and then calls some of the methods such as fetchSample and parameterless get methods from the sensor class.

Lawrie
lawrie
leJOS Team Member
 
Posts: 843
Joined: Mon Feb 05, 2007 1:27 pm

Re: Does 0.5.0 support remote access?

Postby comix » Thu Jan 02, 2014 4:06 pm

lawrie wrote:Hi comix,

As Andy says, it looks like your Eclipse configuration is broken in some way, if you cannot run the main class of a project that you just created. Perhaps you should try a very simple Java test program that does not use leJOS to see if your Eclipse configuration is working at all. What operating system are you on? Your problem could be the same as the one mcrosbie hit on MAC OS X, where the project specified Java 7 but only Java 6 was installed. Posting the contents of your .classpath file would be useful.

Remote control does work but there was a problem with the EV3Menu project and you will have to update your menu to the latest head version to do remote control - see viewtopic.php?f=18&t=5107&start=30#p21405.

The EV3SensorMonitor program does work, but it had some problems so I have just made some changes to it. Again you will need to pull the head version from git to get that.

I am changing all the sample projects to set ev3.host to 10.0.1.1 but to allow a local.properties file to override it. If you are using Wifi, you will need to create a local.properties file and add:

Code: Select all
ev3.host=ip-address


to it. Replace ip-address with the IP address that the menu program shows on the EV3 LCD.

You should then be able to run the ant build file to build EV3SensorMonitor and copy it to the samples directory on the EV3. You can then run it from the Samples screen in the menu.

Note, however, that EV3SensorMonitor sends a lot of output to System.out and to see this, you need to run EV3Control or EV3ConsoleViewer from ev3tools.
Press Enter+Down to finish the sensor monitor.

The sensor monitor is mainly useful to see if a sensor is working. It monitors what sensors you plug into the EV3 and then calls some of the methods such as fetchSample and parameterless get methods from the sensor class.

Lawrie


Hi Lawrie,

You are right, I am using MAC OS, so I update the JAVA7, then I can compile the program. But this time it cannot find the ev3 brick

Code: Select all
System.out.print("Connecting...");
RemoteEV3 ev3 = new RemoteEV3("10.0.1.1");      
TextLCD lcd = ev3.getTextLCD();


Since I'm using the bluetooth, so I use 10.0.1.1 as the address. But what I got was:

Exception in thread "main" lejos.hardware.port.PortException: java.rmi.ConnectException: Connection refused to host: 192.168.0.9; nested exception is:
java.net.ConnectException: Operation timed out
at lejos.remote.ev3.RemoteEV3.getTextLCD(Unknown Source)
at RemoteLCD.main(RemoteLCD.java:10)
Caused by: java.rmi.ConnectException: Connection refused to host: 192.168.0.9; nested exception is:
java.net.ConnectException: Operation timed out
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
at com.sun.proxy.$Proxy0.getTextLCD(Unknown Source)
... 2 more
Caused by: java.net.ConnectException: Operation timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 8 more

I'm using tag 0.5.0 alpha. Thanks
comix
New User
 
Posts: 11
Joined: Fri Dec 27, 2013 2:05 am

Re: Does 0.5.0 support remote access?

Postby gloomyandy » Thu Jan 02, 2014 4:21 pm

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

Re: Does 0.5.0 support remote access?

Postby lawrie » Thu Jan 02, 2014 4:29 pm

As I said, you need to get the head version of EV3Menu (not the 0.5.0 tag), and use the ant build file to update the menu program on the EV3, and reboot the EV3, for remote access to work, as the 0.5.0 version of menu program had a bug.

Or you could update the EV3Menu project manually. The only change is to replace the only occurrence of "192.168.0.9" in GraphicStartup.java by lastIp.
lawrie
leJOS Team Member
 
Posts: 843
Joined: Mon Feb 05, 2007 1:27 pm

Re: Does 0.5.0 support remote access?

Postby comix » Thu Jan 02, 2014 10:49 pm

Thank you all!

I changed the EV3menu code. And It works.
comix
New User
 
Posts: 11
Joined: Fri Dec 27, 2013 2:05 am


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff