Ble extension no longer works

This is my first post.
I am developing an esp32 ble control app and the ble connection was working on ai companion 2 until a few days ago, but after making the ble connection with the built .apk, the app stopped responding.
Subsequently, ai companion 2 freezes on touch of list view.
So I reinstalled mit's ai2 companion app, reverted to the old project of the ble control app for esp32 that was working, and changed the version of the ble extension(BluetoothLE extension 20240322-beta bugfix - ewpatton, 20230728 released), but the problem persisted.
Since then, version 2.72 of the ai companion 2 no longer transfers the app (by reading the qr code) to the android device.

However, projects without the ble extension can be successfully transferred to android devices.

So I tried creating a new project and importing only the ble extension (as an empty block), but I still cannot transfer the app to the android device.

In this case, if I delete the ble extension or switch to a project without the ble extension, the transfer to the android device is successful.
Is this a problem only for me?

2 Likes

I have never had that problem before

1 Like

Thank you for your reply.

Does this mean that it's okay to read a QR code from an app that has a blank block code after simply creating a new project and importing the BLE extension function?

As a side note,
I'm using an Android device called a Xiaomi Pad 6.
I thought there might be a problem with the BLE permissions on the device, so I reset WiFi and Bluetooth and tried reconnecting, but it was NG.

I've been developing ESP32 apps since March without any problems, so I wonder if the SDK version has changed?

1 Like

Additional note:
KIO4_Bluetooth.aix (build date: 2021-03-02) doesn't work either.

1 Like

Current list of BLE extension versions:

Thank you for your reply.

I thought that Bluetooth might be blocked by the Windows 10 OS security, so I tried it on another PC, but the result was the same, NG.
I also tried changing the browser, but it still didn't work.
I only have one Android device.

I think the MIT AI2 Companion app stopped working after version: 2.72 2.72u.
I would like to go back to the previous version, is it possible to download it?

The situation is detailed below.

  1. In the browser, [Projects] -> [Start new project] -> Project name: *** -> [OK]
  2. [Palette] [Extension] -> [Import extension] -> ble extension file select -> [Import]
  3. [Connect] -> [AI Companion] -> QR code display
  4. On the android device, launch the MIT AI2 Companion app [scan QR code] -> After scanning the QR code in 3 above, the screen returns to the screen at launch
  5. The browser displays a progress bar and then returns to the viewer, but the android device remains on the screen at launch and transfer is not possible
  6. In the browser, [Projects] -> [My projects] -> Select a project that has not been imported by the ble extension and load it
  7. The android device transfers and displays the project
  8. In the browser, [Projects] -> [My projects] -> Even if you select the *** project created in 1 above, the android device remains on the screen at 7 above and does not transfer
  9. [Palette] [Extension] -> ble extension -> delete
  10. If you go back to 6. above and go back to the *** project in 8., the Android device will transfer and display the *** project with an empty block code.
  11. If you try again, you will see the dialog screen "Error!
    Unable to load file: https://ai2-appinventor-mit-edu.ezproxy.canberra.edu.au/ode
    /download/file/5600230881951744/assets/external_comps
    /edu.mit.appinventor.ble/classes.jar
    [End Application]".
1 Like

I had an old Android device, the Nexus 7 (2013) with Android version 6.0.1, so I installed the MIT AI2 Companion and tried transferring an app using a QR code. It worked flawlessly.

Therefore, I suspect that the Xiaomi Pad 6 (running Xiaomi HyperOS 1.0.7.0.UMZMIXM) is blocking the loading of the BLE extension.

I’ve taken a step forward in troubleshooting.

Can you build an apk and side load it to the newer device, to factor out the Companion?

Thank you for your reply.

When I build a project that only imports the 'ble extension', after the 'Saving, Packaging...' process, I encounter the error message: "Build failed! Connection timed out (Connection timed out)"

If I try building again, an .apk file is created. When I install it on the Xiaomi Pad 6 device, which cannot load the AI Companion, only Screen1 is displayed. I believe this is acceptable.

However, if I attempt to build again, I encounter the same timeout error, and no .apk file is generated. It's an extremely unstable situation, and so far, I've only succeeded once.

In my opinion, the build process may be related to the PC's browser and the Mit App Inventor cloud, rather than the Android device itself. Could anyone else confirm this?

Regarding my previous post, I suspect that the issue with the Xiaomi Pad 6 device occurred suddenly after editing some block code a few days ago. Note that the Xiaomi Pad 6 device's Android security update is from May 1, 2024. The ESP32's BLE controller has been functioning correctly for the past six months.

Therefore, I'm investigating the [Developer options] in the device settings app.

Could you try this server to build your apk, https://code-appinventor-mit-edu.ezproxy.canberra.edu.au/

This is an older version of app inventor. I also have an app crashing after the upgrade of App Inventor. It still works when I am building it on the code server. It also uses the BLE extension.

Android version?

The code.appinventor.mit.edu server is not subject to the time slice limitations of ai2.appinventor.mit.edu

However, I am sure as to whether or not both servers might be passing build jobs to a common set of servers. Either way, the ai2 server might have left in a huff if it did not get a response in time.

No, it’s the name of an Android tablet.
The OS is Xiaomi HyperOS Version 1.0.7.0.UMZMIXM,
and the Android Version is 14UKQ1.230917.001.

Try this one:

and post a screenshot like this:

Understood. There's a possibility, isn't there.

The downloaded .apk is working fine on the Xiaomi Pad 6 device.
I will rename the .apk to .zip and try to extract and analyze it.
Thank you.

Why? I don't think this helps in any way.

I'm facing the same issue. I have developed an app for the ESP32-S3 that started having problems loading with AI Companion 2 a few days ago but now encounters crashes during device connection.

The app recently started loading successfully on AI Companion 2 after previous failures.

Crashing occurs specifically when connecting to the ESP32 device via Bluetooth Low Energy (BLE).

while troubleshooting I observed that deleting the "Register for Strings" blocks stops the app from crashing when connected to the BLE device but Incorporating it again in the code leads to crashes.

Removing the "Register for Strings" blocks prevents crashes but disables essential communication with the BLE device.

can someone please help?

Esp32_Motor_controller3.aia (1.7 MB)

Do not request any permissions at all, neither FINE_LOCATION nor BT permissions. The current version of the BLE extension requests these automatically. And enable NoLocationNeeded in the Designer.


See also here:

Also watch

for new BLE version news.