No facility in the app inventor to get the "When screen 1 permission granted" decision box into my code. Not available to be written. sorry. I realise you are being helpful but this is not in any way workable forr me.
To copy your Blocks Tom:
Right-mouse in the Blocks work area and select "Download Blocks as image":
Upload the image to this Topic:
Thank you Chris.
I followed all the instructions and eventually managed to recreate the required blocks in my App.
I renamed my listpicker ListView1 and tried the code without the original connection blocks in place. Then I tried with the original connection blocks in place. I have still the same result although the first time I load the App I get a 908 error that BLUETOOTH_CONNECT permission is denied so now I know that it does not intend to connect. This seems to be a very common problem with many possible non solutions so I don't know what I ought to do next as many people seem to try to connect but never manage to.
Here are the blocks, The original connection blocks are to the right. I have tried the code both with and without them.
Try this and post a screenhot:
That is technically a System name, certainly misleading because a ListView is a different component. It is always best to give components unique, meaningful names. Like: ListPicker_BluetoothAddresses
What is the exact model name of your ESP32?
OK, so ~I have misunderstood Taifun's instructions and don't know how to get his suggestion to work. The test .APK does not exist unfortunately. I can rename my listpicker but I have no idea what to do about the listview component.. No programming is simple but this one seems to have been badly hobbled by Google making android so difficult to work with.
Why do you need both a Picker and a View? Your code shows you are only using one of them and you should only need one to display a list of device addresses.
However, little errors/typos can prevent things from working:
The Connect Block should either be attached to a variable or an 'evaluate but ignore' Block.
Given that there are two unique permissions, they should each have a unique tag name.
Also, it is a good idea to have both the scan for devices and the connection to a device within Clock Timer Blocks - neither of these events is necessarily instant.
What is the exact model name of your ESP32? I ask because some support Classic BT while others support BLE and others support both. Your Android 13 phone will most likely be BLE (Bluetooth Low Energy) but be downwards compatible with Bluetooth Classic, but that is not always the case with microcontrollers like Arduino and ESP32.
...also check that Bluetooth and Location are switched on (phone)
Plenty there to chew on when I get back from work. I didn't think that I needed both but was trying to integrate Taifun's code with mine. The ESP32 is a generic. It works fine with a classic bluetooth terminal but not with BLE.. I have copied Taifun's code verbatim so I do not understand your point about two permissions. They look to be the same one to me? Now I understand that error and can see the two distinct permissions
Oh sorry, try this:
Thanks Anke. That downloads. I'll do something with it shortly.
Shows the MAC address of the ESP32 as true.
Tried it again and this is what I have.