Skip to content

[CV1] - Sometimes Omi can't sent battery percentage over BLE #4077

Closed

Description

@TuEmb
Image

Activity

  1. added theissue type on Jan 6, 2026
  2. added
    firmware
    on Jan 6, 2026
  3. added
    bug
    on Jan 22, 2026
  4. kevtae commented on Jan 22, 2026

    @kevtae
    Contributor

    what do you think about adding flow control for this bug? I'm thinking of adding a counting semaphore in transport.c where all the audio packet acquires semaphore before sending and release it once properly transmitted via callback

    I currently see that there are 10 BLE TXbuffer slot(CONFIG_BT_L2CAP_TX_BUF_COUNT), so we can reserve maybe 3-5 for audio and leave the rest for button/battery notifications.

    from my review, this shouldn't add any bottleneck - audio is produced at 4kb/s and BLE transmits at ~5ms at most so even only reserving 3 slots should be more than enough headroom

  5. beastoin commented on Jan 23, 2026

    @beastoin
    Collaborator

    @TuEmb Scoring system v1 triage update: I OCR’d the attachment and it shows repeated BLE stack errors like "bt_conn: Unable to allocate buffer within timeout", "bt_att: Unable to allocate buffer for op 0x1b", "bt_gatt: No buffer available to send notification", and "transport: Error updating battery level: -12" alongside battery ADC/voltage logs. This still looks like intermittent BLE battery reporting; I scored it as Layer Capture / P3 / Needs Info with score 12 (w=5, sev 2, trust 1, freq 3, lev 3, cost 5). Please reply if any factor seems off, and confirm if this is reproducible; if yes, share device model, firmware/app versions, steps to reproduce, how often it happens, and whether other BLE notifications fail too.


    by AI for @beastoin

  6. TuEmb commented on Jan 25, 2026

    @TuEmb
    CollaboratorAuthor

    @kevtae that's good idea. I agree with the semaphore approach. A few implementation notes:

    • Add timeout when acquiring semaphore - don't block indefinitely.
    • Recommended semaphore count: 6-7 - leaves 3-4 slots for battery, button, and other services.
    • Add a log to track dropped packets / overflow data

    Feel free to open a PR with this fix. Happy to review! 🚀

  7. kevtae commented on Jan 28, 2026

    @kevtae
    Contributor

    for the log to track the dropped packet, is the LOG_ERR standard way?

  8. TuEmb commented on Jan 29, 2026

    @TuEmb
    CollaboratorAuthor

    @kevtae yes, please enable the LOG configures in *.conf file

  9. added
    capture
    p2
    maintainer
    on Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcapturefirmwaremaintainerp2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions