MIT App Inventor Not Sending Data to HM-10 Module

Hi,

I am trying to make a simple app with MIT app inventor where it sends a string to an arduino through a HM-10 module. I am using the official Bluetooth low energy extension in MIT app inventor.

The app is able to successfully connect to the HM-10 module (the light stops flashing, indicating it has successfully connected). The HM-10 and arduino are definitely able to receive data, as I tested using the lightblue app and successfully received a string. However, when I use the app inventor app it never receives any string. Any help or guidance would be very much appreciated!

My arduino code:

#include <SoftwareSerial.h>

SoftwareSerial BT(10, 9);

void setup() {

Serial.begin(9600);

BT.begin(9600);

Serial.println("READY - Waiting for data...");

}

void loop() {

if (BT.available()) {

char c = BT.read();

Serial.print("Received: '");

Serial.print(c);

}

}

My app inventor blocks:

Check you used last version of the ble extension ( 20240822 )

In the WriteString block don’t convert the string to a list ( just send the string ).

Hi,

I am using version 20240822. If I don’t use the make a list block it gives me this error: [NSTaggedPointerString count]: unrecognized selector sent to instance 0xb51d83a286c45fe5. Irritants: ()? Thanks for your help!

Never seen that error ( don’t know what it means ).

I’m using the following test app to connect to an esp32 ( onboard bluetooth ), it should work with hm-10 too:

  • adjust uuids as needed
  • start scanning and connect
  • pressing on/off buttons the corresponding string are sent

P.S.

sometimes my ( old ) phone does not connect and need to reboot it, generally find bluetooth classic easier than ble ( esp32 support both ), in your case you need an hc-05 or the like

BLE_controller1.aia (204.8 KB)

That's usually an iOS error message.

But iOS can't run extensions.

That includes the BLE extension.

BLE on iOS is a whole other game.

Well, your Arduino Script is for Classic BT and your App Inventor Block Code is for BLE.

Plus, there are fake HM-10 Modules on the market (manufacturer should be Jinan Huamao Technology Co., Ltd. 济南华茂科技有限公司) - so that needs checking too. Note that HM-10 only supports BLE v4.0, the first and worst version of BLE.

Concerning the Classic/BLE mismatch, they are technology related and so you can get away with very simple cross-code but I wouldn't recommend doing so. There are copious examples of good practice on this Forum, just search, but first decide if it is to be BLE or BT.

This is more a limitation of our implementation of the BLE "extension" on iOS. It always expects that the last parameter is a list of strings to send.