Lab: BLE Connectivity
Course 1 · Module 7 Type: Hands-on lab (status → advertising → host link; optional scan) Suggested time: ~2–2.5 hours on hardware
Read first: Lesson · Cheatsheet · ← Table of Contents · ← M06 · M08 →
Note: the snippets in this lab use the API of the TESAIoT Bitstream firmware, which is not yet open source. See detail and equivalent examples in the public SDK in the note at the top of the lesson BLE for Edge Products
The
ble-flethost is not yet published — the TESAIoT_Hackathon README (commitf5f09a6) states thatpython-app/,ble-react/andble-flet/belong to the maintainers and are not in the public repo. Use the backup path the lesson already suggests: a general GATT explorer such as nRF Connect, LightBlue, or AIROC™ Bluetooth® Connect
Useful references during the lab
Section titled “Useful references during the lab”| Document | Use when |
|---|---|
| Hackathon ble-flet | A desktop central + stream |
| Infineon Find Me CE | A mobile-app workflow (vendor) |
| M06 lab | Comparing against the cloud path |
| M04 lab | Task + delay |
Lab Goals
Section titled “Lab Goals”- Read the BLE peripheral status from the CM55
- Control ADV start/stop/restart and confirm the host sees the name
TESAIoT-*(or whatever name you set) - Connect at least one host (
ble-flet, or a GATT explorer) - (Optional) run a brief scan and record the result from an IPC event
Prerequisites
Section titled “Prerequisites”- A board + HEX/firmware with the BLE profile turned on
- A PC or phone with Bluetooth on
- (Recommended) clone TESAIoT_Hackathon and have
ble-fletready - Close any other Central that might steal the link (nRF Connect still open, etc.)
Part A — Peripheral status
Section titled “Part A — Peripheral status”- Flash the example firmware (or your own build with BLE)
- From a task on the CM55, call:
ipc_ble_periph_status_t st;bool ok = cm55_ble_periph_status_get_sync(&st, 5000U);- Record the values:
profile_ble_active,stack_ready,connection_id,last_error
Pass when: the sync succeeds, and stack_ready (or the build’s equivalent) shows the stack is ready
Part B — Advertising + host discover
Section titled “Part B — Advertising + host discover”- Start ADV:
uint8_t result = 0xFF;(void)cm55_ble_periph_adv_ctrl_sync(1U, &result, 5000U);-
On the host:
- Main path: run
ble-flet→ let it hunt forTESAIoT-* - Backup path: open nRF Connect / a scanning app → find the device’s set name
- Main path: run
-
Once connected, read the status again — expect
connection_id != 0and/ortx_notify_enabled, depending on the host’s state
Pass when: the host sees and connects to the device at least once, with evidence (a screenshot)
Part C — Link behaviour (short soak)
Section titled “Part C — Link behaviour (short soak)”- Stream or read a value briefly on the host (~30–60 seconds)
- Press disconnect on the host, then start/restart ADV if needed
- Successfully reconnect
Pass when: you can reconnect without reflashing (except for the ADV-timeout case the Hackathon documentation notes — then reboot per the guide)
Part D — Optional scan observer
Section titled “Part D — Optional scan observer”- Register
cm55_ble_ipc_set_event_handler - Call
cm55_ble_request_scan_all()(orscan_name) briefly - Record at least 1 advertisement entry (addr / rssi / name) from the log
Pass when (optional): there is a readable scan-result log
Deliverables checklist
Section titled “Deliverables checklist”- A status table before/after connecting
- A screenshot of the host seeing
TESAIoT-*(or whatever name you set) - A short note: how does BLE differ from MQTT in your project?
- (If you did Part D) a sample scan log
Troubleshooting
Section titled “Troubleshooting”| Symptom | Approach |
|---|---|
| Status times out | Check the HEX has BLE on · wait longer after boot · check the IPC |
| No scan results | Start ADV · get closer · close other Centrals · reboot the board |
| Connects then drops immediately | Don’t open two Central apps at the same time |
ble-flet finds nothing after 60s |
An ADV timeout — reboot, or a HEX with auto-restart fixed (see the Hackathon README) |
| Confused with the Wi‑Fi lab | M07 needs no broker; the focus is the BLE radio |
Lesson · Cheatsheet · Table of Contents · M08 →
Cite this lesson
If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.
"Lab: BLE Connectivity" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0
Thai attribution: "แล็บ: การเชื่อมต่อ BLE" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0
Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/firmware-sdk-edge-ai/m07-ble/l02-lab/
This lesson adapts the source below; keep its credit too.
https://github.com/drsanti/TESAIoT-Courses/blob/287c21814ba8c75f693136616dcd270349a15966/C1/M07/lab.md · Original content by Asst. Prof. Dr. Santi Nuratch (ผศ.ดร.สันติ นุราช), KMUTT. Course 1 (C1/) of drsanti/TESAIoT-Courses. TESA funded the work and holds the rights; published here under CC BY-NC 4.0. The upstream repository carries no licence file. Text kept faithful; structure, front matter, quizzes and notes added by TESA Open Knowledge.
TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0
Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA