0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

久しぶりに、ESP32-C3 SuperMini で BLEマウスジグラーをビルドしてハマった点を まとめておきます。備忘録。
つい 半年前は 問題なかったと思ったが、記憶が曖昧

  1. Arduino環境にて、BLE Mouse を使用しますが、このライブラリは最終更新が5年前です。最新(v3.3.6)のESP32ボードマネジャーではコンパイルできません(フラグが立つ)。

    ❌ v3.3.6に対応するためにBleMouse.cppBleMouse.hのソースを変更してビルドしても、実行時にパニックが発生し動作しない
    (ESP32-C3 固有の問題かも?)

    ⭕️ v2.0.17 へダウングレードする必要がある。

    • ボード選択にESP32-C3 SuperMiniが無いため、ESP32C3 Dev Moduleを選択する
    • オンボードLEDを使う場合は、#define LED_BUILTIN (8)とする
       
  2. PC側のBluetooth操作でペアリング後、ペアリングを解除すると、再度ペアリングできない。
    → 原因は、ESP32 BLEデバイスが Advertisingしないため。
    BleConnectionStatus.cppBleConnectionStatus::onDisconnectの最終行に 次の1文を追加して、切断後直ちにAdvertisingするように変更。下記スクショ参照

    pServer->getAdvertising()->start();
    

    ble-reconnect.png



ESP32ボードマネジャーをダウングレードすると、他のESP32プロジェクトに影響が出るため、v2.0.17専用環境を作成した。


以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?