Need help with ESP32 Servo control app

Hi @martijn,
it seems that you are facing permission issues.
To verify if the communication between your phone and the HC05 is working, please use the following app (free) from ghoogle playtore:
Serial Bluetooth Terminal

Once you are done with that and you have verified that the communication works (in terms of hardware and phone <=> Hc05 compatibility), you can go deeper in your app.
Have you perhaps used my code (both AI2 and Arduino) the I've posted at the beginning of the thread?
Have you granted the cossing of Tx and Rx wires between Nano and HC05 ?

HC05 and Arduino are fine and connected....
Sadly your code does not work

Got the BlueToothSerial.h installed :grin:

Question :
Are the tx and rx pin on nano and uno on same pins 10 , 11?
Might be there is the problem?


Not necessarily !
The pins that SoftwareSerial uses (as far as I know) shall be capable of PWM, so you can use other pins provided that they feature the PWM capability. Im my drawing, that I posted at the beginning, the pins were D2 and D3. please refer to that drawing an take care of the wiring, as well !
PS The same sw that I sent you is working for other users (just posted to them yesterday). Have you changed the IP address of the HC05 in the AI2 block ?
The code that I've sent contains my HC05 address in a text constant, you shall overwrite it with your HC05 address.
Your Arduino Nano code should look like:

Can u send me that code ?
your app and the code i downloaded again from above part dont work sadly
i changed the HC-05 adress again but no luck at all....

starting to become a bit frustrating...


OK, you can find it attached.
I've just modified it to help another user that wanted to acquire a pushbutton and send its value to the app, nevertheless, this added part isn't influencing the transmission.
BT_Monitor_Nano.ino (3.0 KB)
Hoping it can help.
PSThe Serial BT Terminal app works ?

Ok ty
The serial bt app works and connects the HC-05 with my app on my phone
no probs there

NB might it be my phone does not download the apps from MIT right ? i use the scan QR code method

I can't do nothing with your app, and i keeps hanging, i cant push buttons or do anything....

So i dont know whats going on.... pretty strange it does work with others and doesnt overhere.... frustrating....

Will try old phone this evening....

Hi @martijn_vd_brakel,
I'rewritten both AI2 and Arduino codes and checked again on my desk (I have a HC06 but is the same in terms of coding and performances).

BT_Monitor_Nano.ino (3.1 KB)

Please take care of line 25 where I've set the baudrate between HC06 and Nano: if you see garbage(on both sides, AI2 and Nano serial monitor) this means that the baudrate is incorrect. Then try 19200 or 38400.

As far as the AI2 code is concerned, I've modified it in order to allow the selection of the (paired) BT devices reachable by the phone : just tap on the grey area named BTdevices, and then tap on the wanted address when shown in a list.
Hit on the CONNECT pushbutton: the label BT connected shall become green. Otherwise a popup appears to warn the insuccess.
Once connected, by pushing any button A,B,C you should read the feedback in the cyan label.
BT_to_Arduino.aia (26.3 KB)

After the apk build, I use the download apk:
Hoping now you can get rid of this issue :muscle:

Got the PROBLEM !!!!
its my new phone ( i think android 12 problem )
Put the code on my old phone ( android 8) and it works flawlessly...
Now i need to find out what and how to get it working on android 12 but thats for later on.
I will try and get the servo app working on my old phone and see how to make it work for my project...
Thanks for your excellent help , i will keep u posted how its going on !!!


Blue tooth from the train app is also connecting to bluetooth....
now need to upload the arduino code and see if the Servo works...

:hugs: :hugs: :hugs:
Great !!!
Regarding Android 12 you can dig the forum, searching for topics about permissions.
Have a great weekend.

I think on android 12+ you need permission for Bluetooth-connect and bluetooth-scan too. At least it worked that way, i do not know if it changed or not recently.

Are you using bluetooth classic or ble?
For Bluetooth classic see below

(Canned Response ABG - Bluetooth non-BLE SCAN Permission Blocks)

The easiest solution, for immediate relief
(from @Barry_Meaker) ...

I had the same issue. The problem is your app does not have permission to see nearby devices. The solution is to give your app permission on your phone (no code changes in your app).

on your phone,

  • goto settings
  • search for your app
  • in App Info for your app select Permissions
  • change Nearby Devices from Not Allowed to Allowed
  • Done

By the way, the very first time you run the app, Android will ask if you want to grant the app this permission. If you say no, or ignore the pop-up, the permission will be set as Denied. Android will not ask again.

A more complex approach, for professional app development:

See Bluetooth liste of devices deosn't work anymore - #7 by Anke
Special note for Xiaomi devices:
I have an error with bluetooth on android 12, Xiaomi Poco X3 NFC - #20 by Patryk_F

1 Like

i am gettin there ....


1 Like

No need to delete posts, the journey is more interesting than the destination.

1 Like

Did some stupid things and deleted parts
my misstake sorry

the man who designed the track and i did it !!!!
we made the app to work with the ESP32
BRIO_Controller4colors.aia (1.9 MB)
now we are finding out how to connect more then 1 esp to the program so we can control more then one track

thanks for all your help


Then you have to change from bluetooth to wiFi. Or use both BT and WiFi. If you chose the latest on you can keep your BT connection to the master EPS and the master ESP control the slave ESP-s over WiFi (ESP softAP can handle only limited number of connections). In case of the first option you need a router. You connect every ESP and the phone to the router. Maybe there is a third otion. If you keep BT to the master ESP, they may can to communicate with each other over ESP-NOW protocoll. Althoug I do not know how it is work exactly but i know one ESP can connect to multiple one.