Skip to content

Repository files navigation

🔥 Firefly

Firefly is the Android companion app for your custom AI-assistant PCB — think "your own Alexa" that you talk to over Bluetooth Low Energy (BLE).

This app scans for your Firefly board, connects over BLE, and gives you a simple chat-style interface: type a command, send it to the board, and see whatever it sends back in the live log.

Status

This project was scaffolded before the PCB itself arrived, so it ships with sensible defaults you'll need to confirm/adjust once you can test against the real hardware:

  • Transport: BLE (Bluetooth Low Energy)
  • GATT profile: Nordic UART Service (NUS) — the most common "send text / receive text" profile used by ESP32, nRF52, and similar boards.
    • Service UUID: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
    • Write (phone → board) characteristic: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
    • Notify (board → phone) characteristic: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
  • Device name filter: the app looks for a device advertising as Firefly

If your firmware uses different UUIDs or a different device name, update app/src/main/java/com/healspace/firefly/BleConstants.kt — that's the only file you should need to touch to match your actual board.

Getting started

  1. Clone this repo.
  2. Open it in Android Studio (Hedgehog or newer recommended).
  3. Let Gradle sync (it uses Gradle 8.7 / AGP 8.5).
  4. Plug in an Android phone (min SDK 26 / Android 8.0+) with USB debugging on, or use an emulator with Bluetooth support (real hardware BLE testing needs a physical phone).
  5. Run the app. Tap Scan for Firefly, grant Bluetooth permissions, and tap your board once it shows up in the list.
  6. Type a command in the text box and hit Send — replies from the board show up in the log above.

Project structure

app/src/main/java/com/healspace/firefly/
  MainActivity.kt     - UI, permission handling, wiring
  BleManager.kt        - BLE scan/connect/read/write logic
  BleConstants.kt      - UUIDs + device name — EDIT THIS for your firmware
  DeviceAdapter.kt      - RecyclerView list of discovered devices

Firmware side (for reference)

Your PCB firmware needs to:

  1. Advertise as a BLE peripheral named Firefly (or update the filter above).
  2. Expose the Nordic UART Service with the UUIDs above (most BLE SDKs/libraries have this built in, e.g. ESP32 BLE Arduino's BLEUART helper, or Adafruit's Bluefruit libraries).
  3. Send notifications on the TX characteristic whenever it wants to "speak" back to the phone.

Roadmap ideas

  • Voice input (speech-to-text) feeding straight into sendCommand()
  • Text-to-speech for responses instead of just a text log
  • Auto-reconnect if the board goes out of range and comes back
  • WiFi fallback transport if BLE range isn't enough

Built with 🔥 for healspace's Firefly PCB project.

About

Firefly - Android companion app for a custom AI PCB assistant (BLE)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages