Connecting Seeed studio xiao esp32c3 with MIT App Inventor via Bluetooth

For diagnostic purposes, add multi-line Labels to show a log of the incoming serviceUuid and characteristicUuid.

It's hard to debug a comparison without seeing what's on both sides

set LblCharacteristicUuid.Text to JOIN(characteristicUuid, '\n', LblCharacteristicUuid.Text)

Hi @Patryk and @ABG, here is my aia
MLEX_vital_reader_3.aia (255.8 KB)

Hi @ABG, I understand. Do you want me to make another label?

Only if the latest @Patryk_F bug fix did not work for you.

The project you shared is also not working? Are there any errors or just no response? Here I added labels to see the raw data if any.
MLEX_vital_reader_3.aia (256.0 KB)

Hi @Patryk, There's just no response
There are no errors.

I have another idea for you to add a little delay in the ESP32 code after sending the temperature.

I also found this topic where the author registers receivers with delay.

Hi @Patryk,
I'll try that out, thanks.

Hi @Patryk, @ABG
I inserted the code that said it worked in that conversation, but the outputs still haven't changed. :frowning: Should I attempt to create two different screens and connect the bluetooth separately?

Hi all, I think I came across the error.
For some reason, the temperature reading works perfectly fine when I just run the code to set the text label to that, but the heart rate reading doesn't work and comes up with this issue:

Even though both the service and characteristic uuids are ones I copied over from the code, this error occurs, and I was wondering if there's something wrong with the code...

Show the current blocks with which this error occurred.

In order to verify the correctness of the ESP code, you should ask the experts in the arduino or esp32 forums. Maybe the problem is in the ESP.

Look for a BLE terminal app that can be used to show BLE traffic independent of AI2, to see transmissions.

@Patryk_F @ABG Hi all, I think someone helped get the code to work for both sensors, I will send over the code as soon as I get it. Thanks for all the help. In the meantime, I have been trying to send text notifications from the phone with this code, but the app keeps on glitching (as described). Is there any way to include a component that controls the sending of the text message to be a one-time thing? Additionally, is it possible to send a text message automatically without pressing on anything? I know that there is an alternative version 2.65u of the mit app companion that apparently bypasses Google app’s limitations but I can’t seem to find it. Thanks again.

It's not Companion's fault that it blocks text messages without user interaction. It's just android updates. In my opinion, a better solution would be to use the SIM800 module connected to ESP32, instead of sending text messages from the app.

But then again, doesn't this block work for you?
component_method (3)

The repeating message blasting can be controlled by adding two global variables

  • Clock.Systemtime of last blast
  • Blast counter

Add extra logic at the place you would send a blast to see if enough time has passed since last blast and if the counter is under the limit.

I would do it like this:

blocks - 2023-07-26T141055.798
blocks - 2023-07-26T141058.269

Perhaps the same thing with only one variable would work well.

@Patryk_F , thanks so much this is so helpful. Unfortunately, I do not think the phone gives me permission to send message direct, something about the google play policies?

I will try out both of your codes asap. Much thanks.

In your project you are using a SendMessage block. Use SendMessageDirect. You also need to give the app permission to send SMS.

unlisted on user request @louyang
see also https://community.appinventor.mit.edu/t/a-post-in-connecting-seeed-studio-xiao-esp32c3-with-mit-app-inventor-via-bluetooth-requires-staff-attention/98464