ESP32-S3でUSB Logitechレーシングホイールの入力を読み取る
原題: Read a USB Logitech Racing Wheel on an ESP32‑S3
日本語訳
# ESP32-S3でUSB Logitechレーシングホイールを読み取る
ESP32-S3のようなMCUは、USBホスト機能を含む非常に高性能なコンピュータシステムとなっており、LogitechのレーシングホイールのようなUSB周辺機器を接続できるのは当然の流れと言えます。もちろん、これらは単純なHID USBデバイスではないため、目的のデータ更新を開始させるには多少の設定が必要です。このプロセスを容易にすることが、[Joel Kometz]氏によるESP32-S3向けプロジェクト「LogiWheelHost」の目的です。
このシングルヘッダーライブラリは、EspUsbHostプロジェクトをベースにしており、G29、G923、G920、G27、G25、DFGT、Driving Force Proホイールをサポートしています。READMEに記載されている通り、これらのレーシングホイールは電源を入れた直後にすべての操作データのストリーミングを開始するわけではなく、ニュートラル状態や結合された軸データのみが送信される制限モードで起動します。
これを変更するには、いわゆる「ネイティブモード」への切り替えを行う必要があります。このモードに切り替えることで、より詳細な情報に加え、独立したペダル、すべてのボタン、ギアシフトといった拡張機能の更新データが利用可能になります。これはUSBデバイスにHID出力レポートを送信することで行われ、それ自体は比較的容易です。
この詳細な処理に加え、本ライブラリはAPIも提供しているため、自身のコード内でコントローラーの状態を取得して利用することは非常に簡単です。おそらくこのライブラリは、USBホストモードをサポートする他のESP32 MCUでも動作するか、あるいは移植が可能でしょう。そのため、古いLogitechのレーシングホイールを活用したいと考えている人々にとって、これは朗報となるかもしれません。
原文(英語)を表示
Now that MCUs like the ESP32-S3 are quite capable computer systems including USB host functionality, it only makes sense that you can connect USB peripherals like Logitech racing wheels to them. Of course, these aren’t basic HID USB devices, so they require a bit of setup to make them start spitting out the data updates which we’re interested in. Making this process easy is the goal of the LogiWheelHost project for ESP32-S3 by [Joel Kometz].
This single-header library supports the G29, G923, G920, G27, G25, DFGT, Driving Force Pro wheels, building on top of the EspUsbHost project. As explained in the README, these racing wheels do not start streaming all updates to their controls once powered on, but boot into a restricted mode in which only neutral or combined-axis data is sent.
To change this you need to trigger the so-called native mode switch in which far more detailed information as well as updates on extended features like separate pedals, all buttons and the gear shifter become available. This is done by sending a HID output report to the USB device, which is easy enough.
In addition to handling this detail the library also provides an API using which obtaining and using these controller states in your own code should be quite easy. Presumably the library will work on or can be ported to other ESP32 MCUs that support host USB mode, so this might be good news for anyone who is looking to do more with that old Logitech racing wheel.