Need sample to communicate APK with ESP32 over socket

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Need sample to communicate APK with ESP32 over socket

Postby Ritesh » Tue Dec 20, 2016 7:40 pm

Hi,

We are working on ESP32 chip from RTOS firmware and application side.

Here, we have just started to work on all side and meanwhile I have started to look ESP32-idd RTOS SDK to start development stuffs. I am thinking to create communication between APK and ESP32 would be over socket interface in which API will send some data after connecting with configured SSID and password. On the other end, ESP32 will send feedback to APK with some response or alerts soemtimg like that.

Does anyone has implemented code something like that?

Please let me know if anyone has implemented that type of code or provide me sample code for that which will be more helpful for us.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample to communicate APK with ESP32 over socket

Postby Ritesh » Fri Dec 23, 2016 6:22 pm

Hi,

Does anyone has any sample code for that?
Regards,
Ritesh Prajapati

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Need sample to communicate APK with ESP32 over socket

Postby kolban » Fri Dec 23, 2016 7:21 pm

You might need to define what "APK" might be? I don't think that is an acronym that I am familiar with in connection with common ESP32 programming.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

alqeon
Posts: 1
Joined: Fri Dec 23, 2016 1:43 pm

Re: Need sample to communicate APK with ESP32 over socket

Postby alqeon » Sat Dec 24, 2016 6:16 pm

@kolban: I think he meant Android's APK (Android Package)..

Up till now i havent seen an example. but you might get lucky if you search for esp8266 examples.

also there isn't really the need for a specific example on the apk side. because what you need is just an TCP connection or UDP package sent to a specific ip (the android's device IP).

For starters i would suggest using a simple IFTTT apk (https://www.youtube.com/watch?v=nbMfb0dIvYc&t=2s)..

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

Re: Need sample to communicate APK with ESP32 over socket

Postby martinayotte » Sat Dec 24, 2016 6:25 pm

I think he means Android Package for APK, in other words, an Android application.
This app could either use HTTPClient or plain sockets to communicate with the ESP server.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample to communicate APK with ESP32 over socket

Postby Ritesh » Sat Dec 24, 2016 6:33 pm

martinayotte wrote:I think he means Android Package for APK, in other words, an Android application.
This app could either use HTTPClient or plain sockets to communicate with the ESP server.
Yes, Socket based communication.I have developed socket based applications into ESP8266 when I was working into ESP8266..

I think that type of code will be worked into ESP32 chip as well. Still, provide me link or sample code for that..
Regards,
Ritesh Prajapati

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Need sample to communicate APK with ESP32 over socket

Postby kolban » Sat Dec 24, 2016 6:38 pm

Here is an example fragment of an ESP32 application being a socket server. One can then connect a socket client to this listener. By and large, the ESP32 seems to provide a faithful implementation of the sockets API so any books or other resources you find that talk to writing networking apps in C using sockets should work fine. For me, I have found study of the sockets API to be highly rewarding. Once one gets one's mind around sockets programming, TCP/IP networking applications fall into place. If I were to think about writing a networking application using TCP/IP, I would say a firm grasp of sockets is required to succeed.

https://github.com/nkolban/esp32-snippe ... t_server.c
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample to communicate APK with ESP32 over socket

Postby Ritesh » Sat Dec 24, 2016 6:49 pm

kolban wrote:Here is an example fragment of an ESP32 application being a socket server. One can then connect a socket client to this listener. By and large, the ESP32 seems to provide a faithful implementation of the sockets API so any books or other resources you find that talk to writing networking apps in C using sockets should work fine. For me, I have found study of the sockets API to be highly rewarding. Once one gets one's mind around sockets programming, TCP/IP networking applications fall into place. If I were to think about writing a networking application using TCP/IP, I would say a firm grasp of sockets is required to succeed.

https://github.com/nkolban/esp32-snippe ... t_server.c
Thanks for reply.

Yes. I agree socket is best way to communicate over WiFi.

I will check your example and will let you know if need any help from your side.
Regards,
Ritesh Prajapati

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: Need sample to communicate APK with ESP32 over socket

Postby rudi ;-) » Fri Jan 13, 2017 9:47 pm

Ritesh wrote:
kolban wrote:Here is an example fragment of an ESP32 application being a socket server. One can then connect a socket client to this listener. By and large, the ESP32 seems to provide a faithful implementation of the sockets API so any books or other resources you find that talk to writing networking apps in C using sockets should work fine. For me, I have found study of the sockets API to be highly rewarding. Once one gets one's mind around sockets programming, TCP/IP networking applications fall into place. If I were to think about writing a networking application using TCP/IP, I would say a firm grasp of sockets is required to succeed.

https://github.com/nkolban/esp32-snippe ... t_server.c
Thanks for reply.

Yes. I agree socket is best way to communicate over WiFi.

I will check your example and will let you know if need any help from your side.
hi
for inspiration,
here is a demo
it runs on esp32 as standalone http/tcp server,
have a download link to an APK ( done with basic4android) , that is inside the http server ( on esp flash )
and you can then comunicate with the esp32 server over http ( browser ) and tcp ( client )
and sure, if you open the link in your browswer on android device, you can download the apk from the esp32 server, install it on your device and you comunicate with esp32 over the apk by tcp client / sockets or http with the browser.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample to communicate APK with ESP32 over socket

Postby Ritesh » Sat Jan 14, 2017 10:56 am

Thanks for Reply.. Let me check and will let you know..
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Bing [Bot] and 234 guests