BLE and ESP32 just a new test example (send and receive in UART Service)

Dear all,
though the great help of @juan_antonio's examples, in the past days I've been fighting against BLE and ESP32 and I've felt in multiple troubles before having it working (honestly I'm a big supporter of the older and simpler classic BT. but anyway....).
At the end I succeded to make it functioning and, since the spirit of the community is to share knowledge, I'm pleased to post my work.
You'll find annexed the .aia, the .ino and a ,pdf that shows step-by-step what I've done, the HW and SW I've used, and the explanation with plenty of images.
I hope it could be of some help.

BLE_Test.aia (248.8 KB)
BLETestAI2_uart.ino (5.9 KB)
BLE_Test.pdf (502.2 KB)

.

4 Likes

Cannot find the component: Clock_ScanForDevices

You can make your own component by dragging in an extra Clock component in the Designer and renaming it.

Look in the Sensors drawer.

i have already try but i get:
invoke: no method named `KeepScreenOn' in class java.lang.Boolean

That sounds like the kind of thing people do with extensions.

What extensions do you use, and what Companion version do you use?

Built: December 8 2024 Version: code51
Use Companion: Use Companion: 2.73a or 2.73au

and i dont use others extensions out of TaifunTools that you include in your project

and if i put another clock i get message:

Cannot find the component: Clock1

Clock_ScanForDevices is recognized only if i disable TaifunTools and interface start on phone, but i get this message:
Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e, characteristic 6e400003-b5a3-f393-e0a9-e50e24dcca9e are not published by the connected device.

And also .ino file compiled with Espressif 3.1.1 give error in this 2 lines:
std::string rxValue = pCharacteristic->getValue();
std::string myStringForUnit8((char*)&rxValue[0], 1);
error on STD command, so i need use Espressif 2.0.17 with arduino Ide

I was so happy to finally find this! I use PlatformIO and was pleased to see I only had to solve one forward reference before it compiled successfully. Then it gave a 'million' linker errors. Does anyone have a platformio.ini file for this *.INO project? I'll be busy trying to solve this but I have sooooo much time into getting a APPINVENTOR / ESP32-C3 link going that nothing will bother me now. Thanks again.

Hi @HankH,

If you want to use 2 block based languages you could try the combination App Inventor and MicroBlocks. MicroBlocks has an App Inventor extension that makes it easy to communicate with several microcontrollers including the ESP32-C3.

Thanks for this tip, any clues help solve the mystery at hand and allow future learning.

Found what I was doing wrong. I was including the Nimble library which apparently isn't needed. See Platformio.ini below:

[env:seeed_xiao_esp32c3]
platform = espressif32
board = seeed_xiao_esp32c3
framework = arduino
monitor_speed = 115200
;lib_deps = h2zero/NimBLE-Arduino@^2.3.1

And I have some success! Installing the app on older Samsung?Lenovo tablet units work, but my new Amazon Fire 11 unit will not connect even though it pairs properly. Not sure how to debug this.

Dear all, sorry having read only now this thread, but I was out for some days, without my PC.
Is there anything that I can do to help you, since I see that you're starting from my ESP32 and BLE example ?
Please let me know.
Cheers.

PS Anyway, I'm absolutely not an expert on MicroBlocks :fearful:

First - congratulations on producing a first rate deliverable! So many "instructional" posts leave out too many details. Most have the same header on all the examples!

Many years ago I became enamored with something called "SimBLE" (simple BLE) which was a repackaged Nordic CPU, an Android/IOS app and a bunch of Arduino libraries. The cool part is that it could use cell phones & tablets to host screens, buttons etc that were all painted from the user's code in the Arduino. You just ran the "SimBLE" app which found every nearby chip. You picked one and away you went! Conceptionally elegant but held down by many problems. High cost, limited distributors, no support to speak of and the chip package was susceptible to "popcorning" when reflowed. MSL 5 which is an undesirable moisture content rating. They finally pulled it after I completed my product ) - :

Now the App Creator is very similar. Don't know how it hid for 10+ years! I'd rather write Cpp but can learn the block stuff. What was really needed was something that works with the new ESP chips, and this does. The XIAO C6 is an amazing platform for $5.

If we could figure out why some tablet computers don't work that would be great.