You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.
peekb wrote 2013-11-24 at 23:46
Hello, great job with this new EV3 API. I just made a small start project using the API but I have a small question. I used:
_brick = new Brick(new NetworkCommunication("192.168.178.19")); to make a wifi connection. It works but is there a way to get the used IP adres automaticly?
I looked at the sample but I can not understand how it works...... (not enough C# skills yet!)
greeting from Holland André
nuwans wrote 2013-12-01 at 13:27
Hello, this API has not implemented a way to get the ip address automatically yet. But I found a way to do that using some documentation found in monobrick web site. Basically, EV3 broadcast an identification UDP message on port 3015. This happens every
few seconds after it connects to the router. It has the string called "EV3" in it. So listen to this message on this port using UDP and then if the message contains the string "EV3" get the ip address from the receiving message. This is
what I do now until that functionality is integrated to the API. I guess there is a similar functionality to discover the Bluetooth port instead we having to provide it to the application.
Hi, Im currently using this API as part of a project to control an Ev3 Robot with a Myo Armband. Iv tried to use this workaround in my UWP App, but unfortunately UdpClient is not supported.
It suggests using DatagramSocket's instead. So just in case anyone runs into the same problem as me. Here is the Code i used in the UWP App to get the IP address Automatically.
privateasyncvoidFindHostIP(){//Open up a socketDatagramSocketlistener=newDatagramSocket();//Add MessageReceived Eventlistener.MessageReceived+=MessageReceived;//Important for async accessCoreApplication.Properties.Add("listener",listener);// Start listen operation.try{listener.Control.InboundBufferSizeInBytes=67;awaitlistener.BindServiceNameAsync("3015");}catch(Exception){//Oops Something Went Wrong}}//Message is Received Every 10 seconds , Code Must be added to handle RepeatsasyncvoidMessageReceived(DatagramSocketsocket,DatagramSocketMessageReceivedEventArgseventArguments){try{IOutputStreamoutputStream=awaitsocket.GetOutputStreamAsync(eventArguments.RemoteAddress,eventArguments.RemotePort);_Ev3IpAddress=eventArguments.RemoteAddress;//Pass the RemoteAddress to the BrickInit() methodBrickInit(eventArguments.RemoteAddress);}catch(Exception){//Oops Something Went Wrong}}privatevoidBrickInit(HostNameRemoteAddress){_brick=newBrick(newNetworkCommunication(RemoteAddress.CanonicalName));_brick.BrickChanged+=_brick_BrickChanged;//....Add other events here etc}}
Thanks For the API @BrianPeek , Having lots of fun using this.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This issue was imported from CodePlex
peekb wrote 2013-11-24 at 23:46
Hello, great job with this new EV3 API. I just made a small start project using the API but I have a small question. I used:
_brick = new Brick(new NetworkCommunication("192.168.178.19")); to make a wifi connection. It works but is there a way to get the used IP adres automaticly?
I looked at the sample but I can not understand how it works...... (not enough C# skills yet!)
greeting from Holland André
nuwans wrote 2013-12-01 at 13:27
Hello, this API has not implemented a way to get the ip address automatically yet. But I found a way to do that using some documentation found in monobrick web site. Basically, EV3 broadcast an identification UDP message on port 3015. This happens every
few seconds after it connects to the router. It has the string called "EV3" in it. So listen to this message on this port using UDP and then if the message contains the string "EV3" get the ip address from the receiving message. This is
what I do now until that functionality is integrated to the API. I guess there is a similar functionality to discover the Bluetooth port instead we having to provide it to the application.
The code I have is pretty simple
private const int listenPort = 3015;
The text was updated successfully, but these errors were encountered: