ESP32 to Control Phone Media Player

trappedbybicycles
Posts: 1
Joined: Sun May 06, 2018 2:38 pm

ESP32 to Control Phone Media Player

Postby trappedbybicycles » Sun May 06, 2018 3:13 pm

Hi all,

I could use some guidance as to what direction I should be googling for a project I'm working on.

I'm pretty familiar with Arduino, but a total beginner with the ESP32 and WiFI communication. I've been going through the basic tutorials on the esp32.net site and Youtube.

To explain my project: I want a remote button press to trigger the ESP to carry out actions (flashing lights, moving servos) and to send a signal to a phone running a media player app. The phone then plays an audio clip through a bluetooth speaker.
Diagram2.jpg
Diagram2.jpg (242.23 KiB) Viewed 2406 times
The question I have is: how should I approach the red transmission?

Some Constraints:
  • I'd like the red signal to be sent over WiFI instead of bluetooth.

    I'd like to avoid cloud servers like MQTT, and keep the communication local (is wlan the correct term?)
I've read about HTTP protocol. Most of the examples I've found have phones using GET commands to receive data from the ESP32 (for sensor monitoring) or have phone apps using POST commands to the ESP (to tell the chip to do something.)

I suppose my two options are:
  • Have the phone (as a client) constantly queue the ESP (as a server) with GET commands as to the status of the button press. This sounds like it will be a very inefficient use of battery life.

    Have the ESP (as a client) POST to the phone (acting as a server). This seems more efficient, because the transmission only occurs when it needs to, but I can't find any example as to how to set up a phone as a server.
Any input is appreciated, thanks for your time!

Who is online

Users browsing this forum: No registered users and 52 guests