A multi-platform OBD-II adapter emulator that mimics the vGate iCar Pro WiFi adapter. Supports both ESP-01S (WiFi only) and ESP32-S3 (WiFi + BLE + Display). Perfect for developing and testing OBD-II applications like OpenPonyLogger without needing a real vehicle.
- ELM327 v1.5 Protocol Emulation - Full AT command support
- 27 Mode 01 PIDs - Comprehensive vehicle data (RPM, speed, temps, fuel trim, MAP, timing advance, O2 sensors, battery voltage, oil temp, etc.)
- WiFi Access Point Mode - Emulates vGate iCar Pro WiFi adapter
- Real-time Web Dashboard - Monitor and control mock data via browser
- Connection Statistics Dashboard - Real-time monitoring of OBD-II app behavior (commands/min, command breakdown, client tracking)
- WebSocket Updates - Live command/response monitoring and state updates
- Adjustable PIDs - Modify car parameters on-the-fly with sliders
- Live Dashboard Updates - Sliders automatically update during driving simulation
- Persistent Configuration - EEPROM-based settings storage
- Web-Based Settings - Configure network, VIN, and defaults via browser
- Driving Simulator - 4 aggressiveness levels with realistic noise (Gentle, Normal, Sport, Drag Race)
- MIL/DTC Management - Check engine light and diagnostic trouble codes (up to 8 DTCs)
- Mode 09 Support - VIN and ECU name queries
- Optional Serial Logging - Configurable CMD/RESP logging to serial monitor
- Bluetooth Low Energy (BLE) - Peripheral mode for wireless OBD-II apps
- TFT Display - Real-time parameter visualization on 240x135 screen
- Enhanced Performance - More memory, faster processing, PSRAM support
- ESP-01S (1MB flash recommended)
- USB to Serial adapter (for programming)
- 3.3V power supply (
⚠️ NOT 5V!)
- Adafruit ESP32-S3 Reverse TFT Feather (includes 240x135 display)
- USB-C cable (for programming and power)
- Built-in battery charging and display
📦 See BOM.md for complete parts list with purchase links and assembly instructions.
MockStang supports 27 Mode 01 PIDs, providing comprehensive vehicle data simulation for testing OBD-II applications.
0x0C- Engine RPM0x04- Calculated Engine Load0x0E- Timing Advance0x1F- Run Time Since Engine Start0x11- Throttle Position0x45- Relative Throttle Position0x0D- Vehicle Speed (km/h)0x5C- Engine Oil Temperature0x51- Fuel Type
0x05- Engine Coolant Temperature0x0F- Intake Air Temperature0x46- Ambient Air Temperature0x5C- Engine Oil Temperature
0x03- Fuel System Status0x06- Short Term Fuel Trim Bank 10x07- Long Term Fuel Trim Bank 10x10- MAF Air Flow Rate (g/s)0x2F- Fuel Tank Level
0x0B- Intake Manifold Pressure (MAP)0x33- Barometric Pressure0x23- Fuel Rail Pressure
0x13- O2 Sensors Present0x14- O2 Sensor 1 (Bank 1, Sensor 1) - Voltage + Fuel Trim
0x2C- Commanded EGR
0x42- Control Module Voltage (Battery)
0x01- Monitor Status Since DTCs Cleared (includes MIL status)0x21- Distance Traveled with MIL On0x31- Distance Since Codes Cleared- Mode 03 - Read DTCs, Mode 04 - Clear DTCs, Mode 07 - Pending DTCs
0x00- PIDs Supported [01-20]0x20- PIDs Supported [21-40]0x40- PIDs Supported [41-60]
Mode 09 (Vehicle Information):
0x02- VIN (Vehicle Identification Number)0x0A- ECU Name
- Install PlatformIO
- Clone this repository:
git clone <repo-url> cd MockStang
- Install dependencies:
pio pkg install
- Build the project:
pio run -e esp01
- Upload to ESP-01S:
pio run -e esp01 --target upload
- Build the project:
pio run -e esp32s3
- Upload to ESP32-S3:
pio run -e esp32s3 --target upload
Note: PlatformIO is strongly recommended due to platform-specific build flags. If using Arduino IDE:
- Install libraries via Library Manager:
- ESPAsyncWebServer
- ESPAsyncTCP (for ESP8266)
- Copy all files from
include/to your sketch folder - Open
src/mockstang.inoin Arduino IDE - Add
-DESP01_BUILDto build flags - Select Board: Generic ESP8266 Module
- Set Flash Size: 1MB (FS:256KB OTA:~374KB)
- Click Upload
- Install libraries via Library Manager:
- ESPAsyncWebServer
- AsyncTCP (for ESP32)
- NimBLE-Arduino
- Adafruit GFX Library
- Adafruit ST7735 and ST7789 Library
- Copy all files from
include/to your sketch folder - Open
src/mockstang.inoin Arduino IDE - Add
-DESP32_BUILDto build flags - Select Board: Adafruit Feather ESP32-S3 TFT
- Click Upload
MockStang supports both compile-time and runtime configuration:
Access the Settings page via the web dashboard to configure:
- Custom SSID or use auto-generated iCAR_PRO_XXXX format
- WiFi password (optional)
- IP address, subnet, and gateway
- Vehicle VIN (for OBD-II mode 09 requests)
- Device ID (returned by AT@1 command)
- Default PID values (RPM, speed, temps, etc.)
Settings are saved to EEPROM and persist across reboots. Click the ⚙️ Settings button on the dashboard to access configuration.
Edit include/config.h to change defaults:
#define WIFI_SSID_PREFIX "iCAR_PRO_" // SSID prefix (MAC-based suffix added automatically)
#define WIFI_PASSWORD "" // WiFi password (empty = open network, default for vGate iCar Pro)
#define AP_IP_ADDRESS IPAddress(192, 168, 0, 10) // vGate iCar Pro default IP
#define ELM327_PORT 35000 // OBD-II port
#define WEB_SERVER_PORT 80 // Web dashboard portNote: Runtime configuration (via web interface) overrides compile-time defaults.
After uploading, the ESP-01S will:
- Create a WiFi Access Point named "iCAR_PRO_XXXX" (where XXXX = last 2 MAC octets)
- Use IP address 192.168.0.10
- Start ELM327 server on port 35000
- Start web server on port 80
On your phone/tablet/computer:
- Connect to WiFi network: iCAR_PRO_XXXX (check serial monitor for exact name)
- No password required (open network, default vGate iCar Pro behavior)
Open a browser and navigate to:
http://192.168.0.10
The dashboard allows you to:
- Monitor real-time OBD-II commands from your app
- Adjust car parameters (RPM, speed, temperature, etc.)
- Reset runtime counter
- View command/response log
- Access Settings page to configure MockStang
Configure your OBD-II application:
- Type: WiFi adapter
- IP Address: 192.168.0.10
- Port: 35000
- Protocol: Auto or ISO 15765-4 (CAN)
Click the ⚙️ Settings button on the dashboard to:
- Customize WiFi SSID and password
- Change IP address configuration
- Set your vehicle's VIN
- Adjust default PID values
- Factory reset to defaults
All settings are saved to EEPROM and persist across power cycles. Restart MockStang after changing network settings for them to take effect.
MockStang supports the following ELM327 AT commands:
| Command | Description |
|---|---|
ATZ |
Reset device |
ATI |
Print version ID |
AT@1 |
Display device description |
ATRV |
Read input voltage |
ATE0/1 |
Echo off/on |
ATH0/1 |
Headers off/on |
ATS0/1 |
Spaces off/on |
ATL0/1 |
Linefeeds off/on |
ATSP<n> |
Set protocol |
ATTP<n> |
Try protocol |
ATST<n> |
Set timeout |
ATDP |
Describe protocol |
ATDPN |
Describe protocol by number |
ATAT0/1/2 |
Adaptive timing |
ATD |
Set defaults |
ATWS |
Warm start |
Connect via serial at 115200 baud to see:
- Startup information
- WiFi AP details
- Client connections
- Command/response logging
- Parameter updates
Example output:
=================================
MockStang - WiFi OBD-II Emulator
=================================
Configuring Access Point: iCAR_PRO_A1B2
AP IP address: 192.168.0.10
AP Password: (none - open network)
AP MAC: DE:AD:BE:EF:A1:B2
ELM327 server listening on port 35000
Web server started on port 80
=================================
System Ready!
Connect to WiFi: iCAR_PRO_A1B2
OBD-II Port: 35000
Web Dashboard: http://192.168.0.10
=================================
- Power up MockStang
- Check serial monitor for WiFi name (e.g., "iCAR_PRO_A1B2")
- Connect phone to "iCAR_PRO_XXXX" WiFi (no password required)
- Open OpenPonyLogger
- Configure connection:
- Type: WiFi
- IP: 192.168.0.10
- Port: 35000
- Open web dashboard on laptop/tablet at http://192.168.0.10
- Start logging in OpenPonyLogger
- Adjust parameters in real-time via dashboard
Use the web dashboard sliders to simulate:
- Idle: RPM=850, Speed=0, Throttle=0%
- Cruising: RPM=2000, Speed=60, Throttle=20%
- Acceleration: Increase RPM (1000→5000), increase throttle (0→80%)
- Cold Start: Set coolant temp to 20°C, watch it rise
- Highway: RPM=2500, Speed=100, Throttle=30%
MockStang/
├── include/
│ ├── platform_config.h # Platform detection and capabilities
│ ├── config.h # Compile-time configuration and defaults
│ ├── config_manager.h # EEPROM-based runtime configuration
│ ├── elm327_protocol.h # ELM327 AT command parser
│ ├── pid_handler.h # OBD-II PID response engine (27 PIDs)
│ ├── web_server.h # HTTP & WebSocket server + connection stats
│ ├── web_interface.h # Embedded HTML/JS dashboard (main + settings)
│ ├── ble_server.h # BLE peripheral implementation (ESP32 only)
│ └── display_manager.h # TFT display manager (ESP32 only)
├── src/
│ └── mockstang.ino # Main application with conditional compilation
├── platformio.ini # Multi-platform build configuration
├── BOM.md # Bill of Materials with purchase links
├── USER_MANUAL.md # Comprehensive user guide
├── TODO.md # Feature roadmap
└── README.md # This file
| Feature | ESP-01S | ESP32-S3 Feather |
|---|---|---|
| WiFi AP | ✅ | ✅ |
| ELM327 Protocol | ✅ | ✅ |
| Web Dashboard | ✅ | ✅ |
| Bluetooth LE | ❌ | ✅ |
| TFT Display | ❌ | ✅ |
| Flash Size | 1MB | 8MB |
| RAM | ~50KB | 512KB |
| Max WiFi Clients | 2 | 4 |
| PSRAM | ❌ | ✅ |
- Compiled with
-Os(optimize for size) - PROGMEM storage for HTML/strings
- Minimal buffer sizes (256 bytes)
- Function/data section garbage collection
- Low-memory LWIP configuration
- Compiled with
-O2(optimize for performance) - Larger buffers (512 bytes) for better responsiveness
- PSRAM support for additional memory
- Enhanced WebSocket capabilities
- Check serial monitor for exact SSID (format: iCAR_PRO_XXXX)
- Network is open (no password required)
- Make sure ESP-01S is powered properly (3.3V, adequate current)
- Try rebooting the ESP-01S
- Verify you're connected to iCAR_PRO_XXXX WiFi
- Verify IP is set to 192.168.0.10 (not 192.168.4.1)
- Check port number (should be 35000)
- Try pinging 192.168.0.10
- Check serial monitor for connection attempts
- Verify WiFi connection
- Try http://192.168.0.10 (not https, not 192.168.4.1)
- Clear browser cache
- Check serial monitor for web server status
- Put ESP-01S in programming mode (GPIO0 to GND during power-up)
- Check serial adapter voltage (must be 3.3V, NOT 5V)
- Verify TX/RX connections are crossed
- Try slower upload speed (57600 baud)
See LICENSE file for details.
This project was created for developing OpenPonyLogger. Feel free to submit issues or pull requests!
- Emulates the vGate iCar Pro WiFi OBD-II adapter
- Compatible with ELM327 v1.5 protocol specification
- Built for the ESP8266 community
Happy Testing! 🏎️💨