-->
Page 1 of 2

Fast reliable communication between ESP8266 and Android App

PostPosted: Wed Apr 29, 2020 11:36 am
by lindnerlars
So, now I am also hooked up on the new IOT Home Automation wave and want build some applications for my family (dimming light, water heater temperature control). The controlling part is not the problem, I think I can say, I have good experience in Arduino development, like also in C, C# and so on. I have no experience in Android app development and I am also new to the ESP8266.

I want to create a fast and reliable communication between a self-build Android app and my ESP8266, to send variable values, Boolean and more. I was reading some posts and tutorials and came to the conclusion, that using WebSockets would be the best approach for this. Now, can I ask you, to give me some material / information please, how to start. I only found the MIT App inventor (https://appinventor.mit.edu/) and this nice tutorials:

https://tttapa.github.io/ESP8266/Chap01 ... P8266.html
https://leanpub.com/kolban-ESP32

I want to learn correctly, how this communications is working and how to implement WebSockets correctly in the Arduino ESP8266 and as Android App.


Thanks everybody for your time and effort and with best greetings from the hot Mexico.
Un saludo a todos hispanohablante :)
Lars

Re: Fast reliable communication between ESP8266 and Android

PostPosted: Fri Jun 05, 2020 3:19 am
by survivingwithandroid
Hi,

i was wondering why you need to use Websocket. I've made something like it using an Android App implementing a simple API server on Arduino, but you can use the same code with ESP8266.

https://www.survivingwithandroid.com/ar ... t-api-iot/ or https://www.survivingwithandroid.com/co ... eb-server/

Here you can find the source code too
Let me know if it helps you

Re: Fast reliable communication between ESP8266 and Android

PostPosted: Wed Jun 10, 2020 3:40 pm
by lindnerlars
Hi "survivingwithandroid", thank you for your answer and maybe you are right.

As far as I understood, WebSockets can be used to implement a web communication, which sends and receive data in real time. For me this means, that if I want to implement a fast communication, I should probably use WebSockets. Of course, if you don't have a real-time requirement, then you don't need it at all.

Also, I would like to send and receive data, without sending html-strings or similar. I rather prefer, to write my data to a certain address or something like that, than sending strings over the wifi / web. But I don't know, if this would be possible using WebSockets.


Thanks again for your shared links and best regards
Lars

Re: Fast reliable communication between ESP8266 and Android

PostPosted: Thu Jun 11, 2020 4:45 pm
by Luc Volders
Well if you do not mind using ESPBasic and Mit's App inventor you could use UDP messages. They are fast and low-bandwidth.

I only did it in Basic.

https://lucstechblog.blogspot.com/2019/ ... o-esp.html

Luc