I have been working on an app for a school project and I need to connect my app to an Arduino board via Bluetooth. However, the BLE scan function returns “undefined” as an output no matter what I do. I am using Thunkable Live on an Android phone. I have also allowed all permissions and switched on Bluetooth on my phone, but it is still not working. My code is below.
try adding a list viewer and settimg text items of list viewer rather than a single label. looks like you are trying to set text of a label to a list of mac addresses and I’m not sure you can do it that way.
Hi! So I tried using a list viewer instead of a label and now there is not output at all not even the “undefined”. Also, just in case something else is interfering with it, the code for my entire page is below.
I actually got this code from another thunkable community post which I can’t find right now but if you need to see it I can try and dig it up. The device name part is blank right now because I’m only testing out the scanning function. Thanks!
I’ll let you do your own research on this but In simple terms, mac address is a unique number that is used to identify the ble device. scanning for names may show blank lines if a device is advertising without a name but it will always have a mac address and hence you can see if a device is being scanned or not even if no name exists. Get things working with macs (ID) before you worry about names.
the ble scanner apps will allow you to scan, connect, read and write to a device independant to Thunkable so you can rule out code errors or bugs before debugging.
i turn on gps
The message stays put on the screen for 3~4 clicks of the scan button and then changes to
BleError: Cannot start scanning operation
After this i have tried the basics
(reinstalling the app, turning bluetooth off and on again, clearing paired devices, downloading it as an app and then trying the steps)
The only suspicion I have is that the live demo app does not ask for bluetooth permissions (if there are any). I have looked into it but they do not contain bluetooth permissions.
Please do give a lead on how to solve the same problem, or if there is a workaround for the same
I have written my apk with MIT Inventor using “AddressesAndNames” scan and it works within 2 seconds delivering pairs of MAC & Name. Just works, as it should to.
Thunkable was my first choice, but when I cannot scan names (MACs are scanned, names empty) - complete BLE function in Thunkable is useless for me.
If you have any workabout to give Thunkable same functionality, as MIT App Inventor - plz help me.