Forum Xamarin.Android

I'm trying to connect my Arduino mega with my Xamarin android application.

I'm using an arduino mega and the esp8266 (wifi module for arduino). I want to start with something simple and just toggle an led when I press an button on my application, the ESP works with wifi and I know the IP ardess, I don't know if I have to look to connect the app with wifi or something. Is there anyone who knows how I can make an connection between my Xamarin application and my ESP8266, my ESP8266 will tell the Arduino that the button was pressed and than the arduino will toggle the LED. So is it possible to make a connection with my Xamarin androidphone application and the ESP. Or if it's not possible., is it possible to make a connection between the app and my arduino. The ESP is just to make the connection between my phone and arduino wireless.
Any help appreciated!


  • DaihungnguyenDaihungnguyen VNMember
  • BorisWongBorisWong CAMember

    The simplest method I would think is to create a simple HTTP web server on the ESP8266 device (there are libraries for Arduino, WeMos, etc.) that handles simple requests. There are some Arduino examples from the ESP8266 libraries that describe some basic HTTP web servers. Your Xamarin app will then make the web request to the target device, just like typing in the address in a browser. The ESP8266 device will parse the request and handle it accordingly.

    More convoluted may be to set up HTTP authentication (to prevent those who like to sniff networks), or use different methods to communicate through TCP/IP. HTTP is my preferred way as it naturally includes many features such as cookies, GET/POST requests, headers, and responses, as well as security and encryption.

    I'm surprised there's not a lot of information on this. I created an account just to comment, since it's the first google search result for "ESP8266 Xamarin". Hope this gets anybody stumbling across this in the right direction.

Sign In or Register to comment.