Skip to first unread message
Assigned to aget...@gmail.com by chrisw...@gmail.com

Tim Baudermann

unread,
Jun 15, 2018, 10:32:21 AM6/15/18
to MIT App Inventor Forum
Hey there,

I'm trying to make an app that connects to a ble device (HM-10 module) first. On my Samsung mobile (Android 7) that works fine. On an alcatel mobile (Android 6) this does not want to work, also the mobile finds the HM-10 module when I search via the bluetooth settings menu. Any idea what I do wrong?

To program I tried something similar to this sample: http://www.martyncurrey.com/arduino-hm-10-and-app-inventor-2/

Evan Patton

unread,
Jun 15, 2018, 3:10:51 PM6/15/18
to MIT App Inventor Forum
Hi Tim,

If you have security set up for the module, you may need to pair the HM-10 with the phone before it will be picked up by the Bluetooth component. You may also want to search the forum as a number of other developers have used this module successfully in the past.

Regards,
Evan

Tim Baudermann

unread,
Jun 16, 2018, 1:48:56 AM6/16/18
to MIT App Inventor Forum
Hi Evan,
thx for your help. I don't have security activated. I do exactly the same on both phones but only one of them (Samsung) shows all Bluetooth devices around. The other (Alcatel) doen't find any devices. That's realy strange.

Ghica

unread,
Jun 16, 2018, 11:03:41 AM6/16/18
to MIT App Inventor Forum
Does your Alcatel support BLE?
Cheers, Ghica

Tim Baudermann

unread,
Jun 16, 2018, 12:02:32 PM6/16/18
to MIT App Inventor Forum
Yes, it does. I can find BLE devices if I search via Bluetooth setting but not with my app...

Ghica

unread,
Jun 16, 2018, 12:22:21 PM6/16/18
to MIT App Inventor Forum
Maybe it helps to pair your device (outside the app, in the phone settings)
Cheers, Ghica.

Tim Baudermann

unread,
Jun 18, 2018, 1:44:00 AM6/18/18
to MIT App Inventor Forum
Apart from the fact that I can not pair the HM-10 module with the current settings, the two Smatphones should actually do the same, right? I don't have paired the module with my Galaxy S7. Also the software find ble devices. As far as I know. it is not neccesary to pair BLE devices.

gerrikoio

unread,
Jun 18, 2018, 4:20:34 PM6/18/18
to mitappinv...@googlegroups.com
I find it useful to test these things with a utility app like "nRF connect" or "BLE scanner". You should download one of these apps on both phones as they would be expected to work on both phones. If any of these apps do not connect with your HM-10 on the Alcatel mobile then it is likely to be a hardware problem with the Alcatel mobile. If they do connect then it is an AI2 BLE extension problem.


Tim Baudermann

unread,
Jun 18, 2018, 4:25:02 PM6/18/18
to MIT App Inventor Forum
I tried with serial bluetooth terminal. That workes fine on both phones.

Ghica

unread,
Jun 19, 2018, 2:55:32 AM6/19/18
to MIT App Inventor Forum
Try again, with one of those apps that gerrikoio suggests.
Also, post here what versions of Android both phones have.
Cheers, Ghica.

gerrikoio

unread,
Jun 19, 2018, 10:12:28 AM6/19/18
to MIT App Inventor Forum
Ok, if it worked with the serial Bluetooth terminal app then that's a start and I would not expect a different result with the other apps I mentioned.

Back to AI2 then. 

Now, I am a little confused by the events that occur when trying on your Alcatel phone.

So you load your app... then you initiate a scan for BLE devices... and this detects the BLE device/devices? (I assume you list out devices seen by the app). Please confirm this.

Then you select the device and try to initiate a connection request and this is where it fails?

If it fails here what happens exactly. Do you get any error messages?




Tim Baudermann

unread,
Jun 19, 2018, 3:17:28 PM6/19/18
to MIT App Inventor Forum
When I let the app search for BLE devices it does not find any of the BLE devices, I tried. When I search with the serial Bluetooth terminal I can find every of those BLE devices.

gerrikoio

unread,
Jun 19, 2018, 3:25:49 PM6/19/18
to MIT App Inventor Forum
Ok thanks. And as you say this same AI2 app can see the BLE devices when using the Samsung mobile. Just to sure all is fine, could you please show us the scanning blocks for your app.

Tim Baudermann

unread,
Jun 19, 2018, 3:32:20 PM6/19/18
to MIT App Inventor Forum
Yes, that's right. Those are the blocks:


Tim Baudermann

unread,
Jun 20, 2018, 5:35:53 AM6/20/18
to MIT App Inventor Forum
I found out what's wrong now: I have to activate google location. After that the app works fine.

Chris Ward

unread,
Jun 20, 2018, 5:52:02 AM6/20/18
to MIT App Inventor Forum
That's good to know Tim :)

As I recall, the Alcatels are "very Google" in that they don't interfere with Android core features as much as other manufacturers do, but your discovery could help a lot of other people on the forum so thank you for reporting back.

Abraham Getzler

unread,
Jun 20, 2018, 10:49:01 AM6/20/18
to MIT App Inventor Forum
(added to BLE nb168 section of FAQ)
per Chris Ward request

ABG

Reply all
Reply to author
Forward
0 new messages