The MicroBlocks extension is now featured on the App Inventor Foundation website.
So please give the extension a try, and see how much easier it is to work with BLE and micro controllers using MicroBlocks.
The MicroBlocks extension is now featured on the App Inventor Foundation website.
So please give the extension a try, and see how much easier it is to work with BLE and micro controllers using MicroBlocks.
(added to FAQ)
Great article! I made an app based on this that controls two sliders with one MicroBlocks device. Here is the article. For your reference.
Thank you for using the extension. I posted your article on the MicroBlocks Discord server.
Very Useful and Great extension!
Thanks a lot, but it has some remarkable issues:
First, it does not work well with "Android companion" newer than version:2.68, it won't connect or throws a Java exception.
Second, everything looks good in the first connection, but if I disconnect and reconnect again, no messages will be sent. If I disconnect and reconnect again, the message may be sent correctly!
I would appreciate it if you could fix them.
If your issue is when running companion try the bugfix companion:
Select "NotNow" if asked.
Hi @Alex_Nolan,
Great that you tried the MicroBlocks extension. I hope the new Companion that Tim showed you will solve the problem. I really don't think it is related to the extension. I use the extension almost on a daily basis and it always works for me. It makes working with BLE and App Inventor so much easier.
With which microcontroller are you using the extension? Maybe you can share your project with us.
Hi @TIMAI2,
Thank you very much. Version 2.73t6 has fixed the exception, and I hope it will be published on the Google Play Store soon.
Hi @Peter
Thanks for your response. Yes, the new companion fixes the exception thrown when running the app on my phone and improves the connectivity issue. But the non-working connections still exist.
The installed app using the APK file does not send or receive any messages at all, while it's connected!
Here is my project
MicroBlocks.aia (439.8 KB)
By the way, I am testing it using Doit ESP32 devkit V1.
Great, what is EASY IOT?
That is my project logo, I am trying to teach my students about IoT and Robotics, of course in an easy manner
Do you know the MicroBlocks website and the learn website and wiki MicroBlocks LEARN and Home | MicroBlocks Wiki
I would love to see what you are doing in your lessons especially since you are using MicroBlocks. How did you discover MicroBlocks? Was it this topic?
It is not working when you install? Are you able to connect using BLE?
Can you also show the MicroBlocks code?
Do you have a link?
Well, I am a fan of MicroBlocks for many reasons, first of all, it supports ESP32 very well, second it runs very smoothly and has great features. I know the website and wiki. actually, one of my colleagues introduced MicroBlocks to me about a year ago.
When I install the APK, BLE connects very well but no data communication happens at all. after a lot of connect and disconnects, there would be one time that everything works fine.
Maybe it's an issue in MicroBlocks firmware, I am Using V250.
Another interesting issue is that the BLE keeps disconnecting just after connecting, as long as the USB cable is connected to the ESP32 and MicroBlocks IDE is running.
Hi @Alex_Nolan,
That's strange. I use BLE with Pico, CoCube, microbit v2, calliope mini 3, ESP32, ESP32 S3, etc, etc and it always works. I can not see what is inside the costum blocks you made. Could you share the ubp file.
What phone and android version are you using?
Could you join the MicroBlocks Discord MicroBlocks, the MicroBlocks developers could help also with your question.
Hi @Peter
Sorry for my late response, Hopefully, the AI2companion version 2.74 has been published and I updated my phones. I tested the app on two phones, a Xiaomi that runs Android 13 and a Samsung that runs Android 8.
I also wrote a simple code to test your library.
The APK works on both phones. However, it experiences some glitches in sending and receiving data after consecutive disconnecting and connecting. As I mentioned before, it connects normally but no bytes are sending or receiving at all. I think it's acceptable for an application built with App Inventor. (maybe there is an issue with the BLE extension)
But using AI2 companion, there is no data communication in Android 13, while it's ok on Android 8. So I think there is something wrong with the AI2 companion!
How does that look like in practice? Is that with just one disconnect and connect?
The only thing that ever happened to me, but now I have to dig really deep into my memory, is that there was a device, don't know what it was anymore, that wouldn't want to play nice with my Samsung tablet. It just wouldn't connect, while it worked on my Pixel phone.
There is nearly no issue with connecting and disconnecting. The "BLE Connected" block correctly reports "true" while it is connected. However, I suspect there might be a problem related to registering with the services. My testing procedure is as follows:
Additionally, I implemented code in MicroBlocks to send messages every second when BLE is connected. I discovered that the problem occurs on both ends. During my tests, when the phone is unable to send any messages to the ESP32, the ESP32 also cannot send messages to the phone, even though BLE appears to be connected.