Skip to content

feat(companion): add CLI commands for Wi-Fi and BLE MAC addresses - #13

Merged
Elektr0Vodka merged 1 commit into
mainfrom
Feat/device-mac-cli
Oct 16, 2026
Merged

Elektr0Vodka merged 1 commit into
mainfrom
Feat/device-mac-cli

Conversation

@Elektr0Vodka

Copy link
Copy Markdown
Owner

What changed

New commands that show the device's Wi-Fi and BLE MAC addresses:

  • Meshcomod chat and the on-device terminal: mac
    wifi mac: AA:BB:CC:DD:EE:FF
    ble mac: AA:BB:CC:DD:EE:01
    
  • Companion CLI (app command console, USB serial, remote CLI): get mac, get wifi.mac, get ble.mac
    > wifi=AA:BB:CC:DD:EE:FF ble=AA:BB:CC:DD:EE:01
    

mac is also listed in help, in the touch terminal's command picker, and in the terminal's keyword list, so it still runs while a chat is open. The README command table lists it too.

Why

Users need the MACs for things like DHCP reservations and router MAC filtering. Until now the only ways to get them were a serial boot log or a network scan.

How it works

The addresses come from eFuse via esp_read_mac (ESP_MAC_WIFI_STA, ESP_MAC_BT), so they are correct even when Wi-Fi or BLE is turned off. If the chip has no such interface (ESP32-S2 has no Bluetooth), or the build is not ESP32, the command answers n/a. NimBLE uses the public BT address by default, so the BLE MAC shown should match what phones see.

Testing

  • pio run -e heltec_v4_companion_radio_usb_tcp builds.
  • pio run -e heltec_v4_tft_companion_radio_usb_tcp_touch builds.
  • I have not run the commands on hardware yet.

Firmware / build impact

Companion firmware only, and the flash cost is small. Repeater and room server CLIs (CommonCLI) are not changed.

Users had no way to read the device MACs without a serial log or a
network scan, which they need for DHCP reservations and MAC filtering.

Meshcomod chat and the on-device terminal get `mac`. The companion CLI
(app console, USB serial) gets `get mac`, `get wifi.mac` and
`get ble.mac`. The addresses come from eFuse via esp_read_mac, so they
work while either radio is off. Chips without the interface, and
non-ESP32 builds, answer n/a.
@Elektr0Vodka
Elektr0Vodka merged commit fa60a9c into main Oct 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant