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.
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??
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.
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.