4

I'm trying to connect my EV3 via Wifi to my Unity game. Is there a simple way to send a command to the EV3?

I gave the EV3 a fixed IP and I'm getting the broadcast which the device is sending. So there is a connection. Can I send a variable or something to my EV3?

2 Answers 2

1

First, you need to learn how to make a TCP connection to your EV3. There is a good guide on this here.

Then you need to learn about EV3 VM bytecodes and how to send direct commands.

Since you are using Unity, you may be able to use a pre-existing library such as the MonoBrick Communication Library or the Brian Peek library.

To send a variable, you need to use mailbox commands along with "Messaging" blocks in the EV3-G software.

1
  • this helped finding an answer. thank you. Feb 1, 2017 at 13:11
0

so... after talking to some people and having a sleeples night i switched to monobrick firmware and started a small webserver.

    namespace MonoBrickHelloWorld
{
    class Program
    {
        public static void Main (string[] args)
        {

            //LcdConsole.WriteLine ("Startup");

            HttpListener httpListener = new HttpListener();
            httpListener.Prefixes.Add("http://*:9090/");
            httpListener.Start();

            var run = true;

            (new ButtonEvents()).EscapePressed += () => run = false;

            while (run)
            {
                var context = httpListener.GetContext();
                Process(context);
            }
        } //Main Ende


        private static void Process(HttpListenerContext context)
        {
            string reqPath = context.Request.Url.AbsolutePath;


            //Console.WriteLine(reqPath);
            LcdConsole.WriteLine (reqPath);
            //

        }// Process End

    } //class Program end
}

i will split the url send to my ev3 and start different things. wow. Source: http://www.monobrick.dk/forums/topic/webserver/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.