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 !!!
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
Taifun
(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:
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
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.