How can I remote control EV3 by PC with WiFi?

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

Moderators: roger, gloomyandy, skoehler

New User
Posts: 3
Joined: Sat Jul 05, 2014 11:18 am

How can I remote control EV3 by PC with WiFi?

Postby oo7680485 » Sat Jul 05, 2014 11:35 am

Hello everyone:

I have seen this viewtopic.php?f=18&t=5434

But I still don't know how to remote control EV3 by PC with Wifi

Could some help me~~~THX.


Code: Select all

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import javax.swing.JButton;
import javax.swing.JFrame;

import lejos.hardware.BrickFinder;
import lejos.remote.ev3.RMIRegulatedMotor;
import lejos.remote.ev3.RemoteEV3;

public class WiFiConnect extends JFrame{
   public WiFiConnect() {
         super("My Controller");
         RemoteEV3 ev3;
      try {
         ev3 = new RemoteEV3("");
         JButton rotate = new JButton("Rotate");
         final RMIRegulatedMotor left = ev3.createRegulatedMotor("A",'N');
         final RMIRegulatedMotor right = ev3.createRegulatedMotor("B",'N');

         rotate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
               try {
               } catch (RemoteException e) {
          addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                 try {
               } catch (RemoteException e1) {

      } catch (RemoteException e2) {
         // TODO Auto-generated catch block
      } catch (MalformedURLException e2) {
         // TODO Auto-generated catch block
      } catch (NotBoundException e2) {
         // TODO Auto-generated catch block
      public static void main(String[] args) {
         WiFiConnect control = new WiFiConnect();

error message:

Code: Select all

Exception in thread "main" lejos.hardware.DeviceException: unable to open port
   at Source)
   at lejos.hardware.motor.BaseRegulatedMotor.<init>(Unknown Source)
   at lejos.hardware.motor.NXTRegulatedMotor.<init>(Unknown Source)
   at lejos.remote.ev3.RMIRemoteRegulatedMotor.<init>(Unknown Source)
   at lejos.remote.ev3.RMIRemoteEV3.createRegulatedMotor(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
   at java.lang.reflect.Method.invoke(
   at sun.rmi.server.UnicastServerRef.dispatch(
   at sun.rmi.transport.Transport$
   at sun.rmi.transport.Transport$
   at Method)
   at sun.rmi.transport.Transport.serviceCall(
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
   at sun.rmi.transport.tcp.TCPTransport$
   at java.util.concurrent.ThreadPoolExecutor.runWorker(
   at java.util.concurrent.ThreadPoolExecutor$
   at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
   at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
   at sun.rmi.server.UnicastRef.invoke(Unknown Source)
   at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
   at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
   at com.sun.proxy.$Proxy0.createRegulatedMotor(Unknown Source)
   at lejos.remote.ev3.RemoteEV3.createRegulatedMotor(Unknown Source)
   at WiFiConnect.<init>(
   at WiFiConnect.main(

leJOS Team Member
Posts: 965
Joined: Mon Feb 05, 2007 1:27 pm

Re: How can I remote control EV3 by PC with WiFi?

Postby lawrie » Wed Jul 09, 2014 2:03 pm

If the motors are failing to open, then either you have the motors attached to the wrong port, or they are already open and have not been closed. Restart the EV3 and check that the motors are in the right ports and then see if the program works.

Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest