Bluetooth trainer: local address not refreshed after Init (color LCD)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- embedded-iot, frontend
Research direction
The bug is in radio/src/gui/colorlcd/model/trainer_bluetooth.cpp: the local-address StaticText is created once in the window constructor, while BluetoothTrainerWindow::refresh() updates only state, r_addr and btn. Read radio/src/gui/colorlcd/radio/hw_bluetooth.cpp to see how the address is read dynamically. Done when the Local address field fills in right after Init without leaving and re-entering the screen, which needs a hardware or simulator check.
Written by the indexing model from the issue text.
Description
Summary
In the model Trainer screen (Bluetooth, master), the Local address field stays empty after pressing Init and only appears after leaving and re-entering the screen. The address itself is received and stored correctly (the Hardware -> Bluetooth screen shows it), so this is a display refresh issue.
Steps to reproduce
- Model Settings -> Trainer, Bluetooth trainer, master.
- Press Init (the BT handshake runs; discovery becomes available).
- Scan, select a device and connect.
- Observe the "Local address" field.
Actual result
The "Local address" field stays empty during the whole session. Leaving the screen and re-entering it makes the address appear.
Expected result
The local address should be shown as soon as it is known (right after the handshake).
Root cause
In radio/src/gui/colorlcd/model/trainer_bluetooth.cpp, the local-address StaticText is created once, anonymously, with the value of bluetooth.localAddr at window construction:
auto lclline = newLine(grid);
new StaticText(lclline, rect_t{}, STR_BLUETOOTH_LOCAL_ADDR);
new StaticText(lclline, rect_t{}, bluetooth.localAddr); // created once, never updated
BluetoothTrainerWindow::refresh() updates state, r_addr and btn, but never the local-address text. Since the BT handshake starts when Init is pressed (i.e. after the window is built), bluetooth.localAddr is still empty at construction, so the field remains empty until the window is recreated.
The Hardware -> Bluetooth screen shows both addresses because it reads bluetooth.localAddr dynamically (radio/src/gui/colorlcd/radio/hw_bluetooth.cpp).
Suggested fix
Keep a pointer to the local-address StaticText as a member and set its text from bluetooth.localAddr in refresh() (or whenever bluetooth.state changes), the same way r_addr is updated.
Environment
- Radio: Radiomaster TX16S MK3.
- EdgeTX: current nightly.
- Module: FrSky Bluetooth module emulator (ESP32-C3), which sends
Central:<addr>/Peripheral:<addr>during the handshake (verified in the module logs).
- Dominant language
- C
- Stars
- 2.4k
- Forks
- 614
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 68
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EdgeTX/edgetx
-
bug 🪲 triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EdgeTX/edgetx#7412 · 2 comments ·
Maintainers usually reply within 1 day
-
bug 🪲 triage
Difficulty 2/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug 🪲 triage
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
bug 🪲 triage
Difficulty 3/5 1-2 days Newbie friendliness 50/100
Maintainers usually reply within 1 day
-
RxBt Vfas conflictOpenbug 🪲 triage
Difficulty 4/5 3-5 days Newbie friendliness 45/100
EdgeTX/edgetx#7953 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
documentation severity: low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
luainkernel/lunatik#2231 ·
Maintainers usually reply within 1 day
-
aspect ratio 16:10Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Revivedx/SavageWindRecomp#402 ·
Maintainers usually reply within 1 day
-
cleanup help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ESPresense/ESPresense#2602 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/arrow-swift#209 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
libretiny-eu/libretiny#435 ·
Maintainers usually reply within 4 days