Tagged: BLE
- This topic has 6 replies, 3 voices, and was last updated 2 years, 4 months ago by
Renzo Mischianti.
-
AuthorPosts
-
-
5 January 2023 at 04:04 #23783
I’m having a lot of issues getting BLE to connect to anything using a WeMos Lolin32. Sometimes it will connect great and reconnect automatically when the ESP is reset. Other times it takes many multiple tries to get the initial connection established then it will not reconnect and I have to connect as a new device which usually takes multiple tries.
I’m using a lot of different sample code packages and they all act the same. Same code on other ESP devices works flawlessly so I’m pretty sure it is something to do with the Lolin..
I prefer to use the Lolin32 because of the features but struggling.
Any help would be appreciated. -
5 January 2023 at 15:52 #23787
Hi TLes,
It’s possible that you don’t give so much power to the microcontroller to do the operations, try to add an external power supply.
Bye Renzo -
5 January 2023 at 22:43 #23793
Thanks for the info but it appears that this is an issue with Android 12.
I went back to my old Android 6 tablet and it works as is should. -
6 January 2023 at 15:28 #23801
Ahh perfect! This is important information.
Probably the version of Bluetooth changed and also changed the management.
Bye Renzo -
7 January 2023 at 22:13 #23826
I have been able to test on andriod versions 6, 9 and 13 succesfully. 10, 11 1nd 12 all seem to be a problem.
I am seeing mentions of having to grant permissions in my code?? Not sure if the example code I am trying to use does everything needed. Can someone show me code that code that does work?? -
9 January 2023 at 15:45 #23851
Hi,
for the upper version of Android you must specify in the file AndroidManifest.xml these grant<manifest> <!-- Request legacy Bluetooth permissions on older devices. --> <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /> <!-- Needed only if your app looks for Bluetooth devices. If your app doesn't use Bluetooth scan results to derive physical location information, you can strongly assert that your app doesn't derive physical location. --> <uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> <!-- Needed only if your app makes the device discoverable to Bluetooth devices. --> <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> <!-- Needed only if your app communicates with already-paired Bluetooth devices. --> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <!-- Needed only if your app uses Bluetooth scan results to derive physical location. --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ... </manifest>
But if It’s works with version 13 It’s very strange.
Bye Renzo
-
-
AuthorPosts
- You must be logged in to reply to this topic.