How hoverclub/obd-torqueapp-sensor-interface-usb-wifi-bluetooth works
This ESP32 firmware adapts configured vehicle or device sensors to Torque Pro through the Torque Arduino Protocol. Torque commands arrive over USB serial, Wi-Fi, or Bluetooth; firmware dispatches requests and returns protocol responses to the originating interface. Sensor acquisition supports analog, digital, and pulse inputs, with filtering, thermistor conversion, expressions, range/inactivity diagnostics, and Torque-compatible reporting. The source excerpts show communication setup and sampling details, but omit parts of command handling and sensor processing; those relationships are included only where documented or directly evidenced.
Main entry points: main.cpp Sensor sampling · TorqComm.cpp Serial Wi-Fi Bluetooth · evalexp.cpp Expression evaluation · MedianFilterLib2.h Median filtering
Components 17
Connections and protocol
- Firmware setup and loop
src/main.cpp - Serial Wi-Fi Bluetooth
src/TorqComm.cpp
Sensor acquisition
- Sensor definitions
src/main.cpp - Sensor sampling
src/main.cpp - Pulse capture
src/main.cpp
Signal processing
- Median filtering
src/MedianFilterLib2.h - Thermistor conversion
src/main.cpp - Expression evaluation
src/evalexp.cpp - Expression stacks
src/Stack.h - Fault diagnostics
src/main.cpp
Torque responses
- Command dispatch
src/main.cpp - PID definitions
src/main.cpp - Sensor values
src/main.cpp - Torque configuration
src/main.h - Sensor outputs
src/main.cpp
Other components
- Torque Pro
- Vehicle sensors
Connections 18
- Torque Pro → Serial Wi-Fi Bluetooth: sends commands
README.md - Firmware setup and loop → Serial Wi-Fi Bluetooth: initializes
src/main.cpp - Serial Wi-Fi Bluetooth → Command dispatch: provides input
README.md - Command dispatch → Serial Wi-Fi Bluetooth: routes responses
README.md - Vehicle sensors → Sensor sampling: provides readings
README.md - Sensor definitions → Sensor sampling: configures reads
README.md - Sensor sampling → Pulse capture: measures pulses
src/main.cpp - Sensor sampling → Median filtering: filters samples
src/main.cpp - Sensor sampling → Thermistor conversion: converts readings
src/main.cpp - Sensor sampling → Expression evaluation: applies expressions
README.md - Expression evaluation → Expression stacks: uses stacks
src/evalexp.cpp - Sensor sampling → Fault diagnostics: checks readings
src/main.cpp - Command dispatch → PID definitions: serves definitions
README.md - Command dispatch → Sensor values: serves readings
README.md - Command dispatch → Torque configuration: serves configuration
README.md - Command dispatch → Sensor outputs: sets outputs
src/main.cpp - Sensor sampling → Sensor values: updates values
src/main.cpp - Fault diagnostics → Sensor values: adds fault data
src/main.cpp