Sending data to ESP8266 Wi-Fi chip from Android device

我是研究僧i 提交于 2019-12-03 22:58:11

For your Controller you dont need any Libary. You just can use the serial AT Commands: http://www.electrodragon.com/w/ESP8266

After setting up your ESP like this:

In your App you should deal with TCP-Sockets: https://de.wikibooks.org/wiki/Googles_Android/_TCP-Sockets

Try something like this in an async task:

socket = new Socket();
socket.connect(new InetSocketAddress(ip, port), Connect_Timeout);

DataOutputStream DataOut = new DataOutputStream(socket.getOutputStream());
DataOut.writeBytes(message);
DataOut.flush();

socket.close();

So your ESP is the Server and the App the Client. This should work without problems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!