Add diag console probe (OBD-II mode 01/09 on 0x7DF); wiki: diagnostic polling, two sources

Firmware:
- CANDriver::transmit(): the single sanctioned transmit path (single-shot,
  echoed as CANTX lines, TX_FAILED alert counted); CAN-task warnings now take
  the serial lock
- DiagProbe module: `diag pids` supported-PID bitmap scan, `diag pid <hex>`,
  `diag vin`, `diag ecu`, `diag status`; ISO-TP reassembly with flow control;
  one request in flight, refused for 3 s after any foreign tester frame
- Console dispatch chained via Tunables::setExtraCommandHandler()
- CLAUDE.md and docs/UART_PROTOCOL.md updated

Wiki:
- New page obd-diagnostic-polling (broadcast vs polled, 0x6F1->0x612 addressing,
  Route A generic OBD PID table, Route B, test-day procedure, firmware probe)
- New sources: google-ai-dde7m57-pids (clipping, unverified, 0x612 direction
  contradicted), dwr-335d-torque-pids (thread + raw/BMW 335d.csv decoded)
- Clippings/ folder added to the schema (Obsidian Web Clipper, treated as raw/)
- bmw-m57n-engine, can-bus-integration, open-questions, index, log updated
This commit is contained in:
2026-09-21 19:51:49 +02:00
parent f60bdac268
commit 974082cb3e
21 changed files with 1357 additions and 24 deletions
+8 -3
View File
@@ -79,6 +79,7 @@ src/
tunables.cpp # Gauge calibration + alert thresholds (NVS, 'cfg' serial console)
espnow_link.cpp # ESP-NOW broadcast leg of the link
tuning_screen.cpp # Hand-coded LVGL Gauge Tuning screen (swipe right from Driveline)
diag_probe.cpp # On-demand OBD-II requests ('diag' console) - the ONLY CAN transmitter
settings_manager.cpp # NVS persistent storage
ui_state_manager.cpp # UI synchronization logic
display_init.cpp # Display initialization; boots into DrivelineScreen
@@ -118,7 +119,7 @@ include/
**include/drivers/can_driver.h/cpp**
- CAN Bus driver using ESP32 TWAI (Two-Wire Automotive Interface)
- Hardware: GPIO 15 (TX), GPIO 16 (RX) - 500 Kbps baud rate
- Mode: TWAI_MODE_NORMAL (ACKs frames; LISTEN_ONLY caused transmitter retry-flooding). Firmware never sends data frames
- Mode: TWAI_MODE_NORMAL (ACKs frames; LISTEN_ONLY caused transmitter retry-flooding). The only transmit path is `CANDriver::transmit()`, used solely by `DiagProbe` for typed `diag` console requests (single-shot, echoed as `CANTX,` lines)
- Parses BMW-specific CAN messages and updates shared automotive data structure
- Task runs on Core 0 with FreeRTOS queue for start/stop commands
@@ -214,7 +215,7 @@ Settings persist across power cycles via ESP32 NVS (Non-Volatile Storage):
- Statistics tracking: Messages received, parsed, errors
**Safety Features**:
- NORMAL mode: the controller ACKs received frames; the firmware has no transmit path for data frames
- NORMAL mode: the controller ACKs received frames; nothing is transmitted unless a human types a `diag` command (see Diagnostic probe below)
- Error detection: Bus errors, queue overflow, passive errors
**See Also**: `wiki/pages/can-id-candidates.md` for the verified CAN ID map and evidence, `wiki/pages/can-bus-integration.md` for integration notes
@@ -223,6 +224,10 @@ Settings persist across power cycles via ESP32 NVS (Non-Volatile Storage):
`src/modules/tunables.cpp` owns `link_config_t`: tach pulses/rev + trim + clamps, coolant PWM frequency + duty law + min temp, per-output enables, a bench override (force rpm / duty), and the alert thresholds. Stored as an NVS blob (namespace `tunables`). Edited over the USB serial console: `cfg show`, `cfg set <name> <value>`, `cfg override rpm <n> | duty <n> | both <rpm> <duty> | off`, `cfg reset`. Every change bumps `cfg_version`, which makes the UART task push a CONFIG frame. Overrides are pushed but never saved. The **Gauge Tuning screen** (`src/modules/tuning_screen.cpp`, hand-coded like the driveline screen so SquareLine exports cannot clobber it; Home → swipe right → Driveline → swipe right → Tuning) edits the same values with −/+ buttons, enable switches, and an override panel with RPM and duty sliders. Overrides are never written to NVS (`save()` strips them).
### Diagnostic probe (`diag` console)
`src/modules/diag_probe.cpp` is the only code allowed to call `CANDriver::transmit()`. It sends single OBD-II requests on `0x7DF` and reassembles ISO-TP replies from `0x7E8..0x7EF`: `diag pids` (supported-PID bitmap scan), `diag pid <hex>`, `diag vin`, `diag ecu`, `diag status`. One request in flight, single-shot frames, refused for 3 s after any foreign tester frame (`0x7DF`, `0x7E0-7`, `0x6F1`), services 01/09 only. Transmitted frames are echoed as `CANTX,` lines in the same format as `CANRAW,`. Console lines that `cfg` does not recognise are passed to it via `Tunables::setExtraCommandHandler()`. Background and test procedure: `wiki/pages/obd-diagnostic-polling.md`.
### ESP-NOW link
`src/modules/espnow_link.cpp` broadcasts every frame on Wi-Fi channel `ESPNOW_CHANNEL` (1). The radio stays in STA mode permanently — `WiFiManager`'s "off" only stops scanning/association (it no longer calls `WiFi.mode(WIFI_OFF)`). If Wi-Fi joins an AP the channel follows the AP; B hops to find it.
@@ -401,5 +406,5 @@ xTaskCreatePinnedToCore(
- **SquareLine Studio Export**: ALWAYS export UI files to `ui/` directory, NEVER to `src/` (prevents overwriting main.cpp)
- **Event Handler Registration**: Event handlers for SquareLine UI elements are registered in `ui_Settings_Screen.c` auto-generated code. When adding new toggles, add event callback registration via `lv_obj_add_event_cb()` and declare handler in `ui_events.h`
- **CAN Bus Integration**: BMW CAN IDs are defined in `automotive_data.h` (all 11-bit standard frames, verified live on the swap bus). The CAN driver runs in `TWAI_MODE_NORMAL` (it ACKs frames; not LISTEN_ONLY). Evidence and confidence labels live in `wiki/pages/can-id-candidates.md`
- **CAN Bus Integration**: BMW CAN IDs are defined in `automotive_data.h` (all 11-bit standard frames, verified live on the swap bus). The CAN driver runs in `TWAI_MODE_NORMAL` (it ACKs frames; not LISTEN_ONLY). Evidence and confidence labels live in `wiki/pages/can-id-candidates.md`. Never add a second caller of `CANDriver::transmit()` without a design discussion — transmitting on the vehicle bus is a safety decision
- **Security**: Password field (`uic_Wifi_Passkey_TB`) is cleared after connection attempt for security (line 1015, 1029)
+3 -1
View File
@@ -114,7 +114,9 @@ cfg reset
`set` values are saved to NVS and pushed to B immediately. `override` is pushed but not saved on either side.
The same tunables are editable on A's touchscreen: Home → swipe right → Driveline → swipe right → **Gauge Tuning** (−/+ per field, enable switches, override sliders).
The same tunables are editable on A's touchscreen: Driveline → swipe right → **Gauge Tuning** (−/+ per field, enable switches, override sliders); the Driveline button returns.
The same console also carries the OBD-II diagnostic probe (`diag pids | pid <hex> | vin | ecu | status | help`), which is unrelated to the link: it transmits on the vehicle CAN bus. See `wiki/pages/obd-diagnostic-polling.md`.
---
+16 -3
View File
@@ -6,9 +6,10 @@
*
* Hardware: GPIO 15 (TX), GPIO 16 (RX)
* Mode: TWAI_MODE_NORMAL — the board ACKs the bus (LISTEN_ONLY can't ACK, which
* makes transmitters flood it with retries). We never call twai_transmit(),
* so behaviour is read-only in practice, but note this is a policy, not a
* hardware guarantee: nothing but discipline prevents a write.
* makes transmitters flood it with retries). The driver is read-only in
* normal operation; the single sanctioned transmit path is transmit(),
* used ONLY by DiagProbe for on-demand OBD-II requests (see
* src/modules/diag_probe.h). Nothing else may call it.
* Baud: 500 Kbps
*/
@@ -58,6 +59,8 @@ typedef struct {
uint32_t messages_parsed;
uint32_t parse_errors;
uint32_t last_receive_time;
uint32_t messages_transmitted; // frames handed to the TWAI TX queue (DiagProbe only)
uint32_t tx_failures; // queue refusals + TWAI_ALERT_TX_FAILED (no ACK / bus error)
} can_stats_t;
// ============================================================================
@@ -141,6 +144,16 @@ namespace CANDriver {
*/
bool isActive();
/**
* Transmit ONE standard (11-bit) frame, single-shot (no automatic
* retransmission if nobody ACKs). The only write path onto the vehicle
* bus; reserved for DiagProbe's on-demand diagnostic requests. Echoes the
* frame on the console as a "CANTX," line (same shape as CANRAW) so
* captures hold both halves of an exchange.
* @return true if the frame was queued (delivery is reported via stats)
*/
bool transmit(uint32_t id, const uint8_t* data, uint8_t len);
/**
* Enable/disable raw frame logging (candump-style capture of EVERY frame).
* When enabled, each received frame is printed to Serial as a compact,
+47 -4
View File
@@ -10,6 +10,7 @@
#include "modules/settings_manager.h"
#include "modules/serial_lock.h"
#include "modules/tunables.h"
#include "modules/diag_probe.h"
#include "esp_log.h"
// Import shared data from UARTManager namespace
@@ -339,9 +340,10 @@ static bool parseCANMessage(const twai_message_t& message) {
*
* @param message Received TWAI message
*/
static void emitRawFrame(const twai_message_t& message) {
static void emitFrameLine(const char* prefix, const twai_message_t& message) {
char buf[72];
int n = snprintf(buf, sizeof(buf), "CANRAW,%lu,%03lX,%u,%u,",
int n = snprintf(buf, sizeof(buf), "%s,%lu,%03lX,%u,%u,",
prefix,
(unsigned long)millis(),
(unsigned long)message.identifier,
(unsigned)(message.extd ? 1 : 0),
@@ -370,9 +372,12 @@ static void handleRxMessage(twai_message_t& message) {
// Raw capture FIRST, before parse — logs every frame including unknown IDs
if (g_raw_logging) {
emitRawFrame(message);
emitFrameLine("CANRAW", message);
}
// Diagnostic replies (0x7E8..) and foreign-tester detection
DiagProbe::onFrame(message);
// Auto-restart UART if it was stopped due to CAN timeout
if (g_uart_auto_stopped) {
ESP_LOGI("CANDrv", "✓ CAN messages resumed, auto-restarting UART");
@@ -453,7 +458,8 @@ static bool initTWAI() {
uint32_t alerts_to_enable = TWAI_ALERT_RX_DATA |
TWAI_ALERT_ERR_PASS |
TWAI_ALERT_BUS_ERROR |
TWAI_ALERT_RX_QUEUE_FULL;
TWAI_ALERT_RX_QUEUE_FULL |
TWAI_ALERT_TX_FAILED;
if (twai_reconfigure_alerts(alerts_to_enable, NULL) != ESP_OK) {
ESP_LOGE("CANDrv", "Failed to reconfigure alerts");
@@ -537,14 +543,27 @@ static void canTask(void* parameter) {
// Handle error alerts
if (alerts_triggered & TWAI_ALERT_ERR_PASS) {
SerialLock::lock();
ESP_LOGW("CANTask", "TWAI controller has become error passive");
SerialLock::unlock();
}
if (alerts_triggered & TWAI_ALERT_BUS_ERROR) {
twai_status_info_t status;
twai_get_status_info(&status);
SerialLock::lock();
ESP_LOGW("CANTask", "Bus error detected (count: %d)", status.bus_error_count);
SerialLock::unlock();
g_can_stats.parse_errors++;
}
if (alerts_triggered & TWAI_ALERT_TX_FAILED) {
// Single-shot frame got no ACK or hit a bus error: nobody is
// listening on that ID, or the bus is unhappy. Not retried.
g_can_stats.tx_failures++;
SerialLock::lock();
ESP_LOGW("CANTask", "TX failed (no ACK / bus error) - %lu so far",
(unsigned long)g_can_stats.tx_failures);
SerialLock::unlock();
}
if (alerts_triggered & TWAI_ALERT_RX_QUEUE_FULL) {
twai_status_info_t status;
twai_get_status_info(&status);
@@ -661,6 +680,30 @@ bool isActive() {
return g_can_active;
}
bool transmit(uint32_t id, const uint8_t* data, uint8_t len) {
if (!g_can_active || data == NULL || len > 8 || id > 0x7FF) {
g_can_stats.tx_failures++;
return false;
}
twai_message_t m;
memset(&m, 0, sizeof(m));
m.identifier = id;
m.extd = 0;
m.ss = 1; // single shot: never retransmit on error
m.data_length_code = len;
memcpy(m.data, data, len);
esp_err_t r = twai_transmit(&m, pdMS_TO_TICKS(20));
if (r != ESP_OK) {
g_can_stats.tx_failures++;
ESP_LOGW("CANDrv", "twai_transmit(0x%03lX) failed: %s", (unsigned long)id, esp_err_to_name(r));
return false;
}
g_can_stats.messages_transmitted++;
emitFrameLine("CANTX", m);
return true;
}
void setRawLogging(bool enabled) {
g_raw_logging = enabled;
ESP_LOGI("CANDrv", "Raw frame logging %s", enabled ? "ENABLED" : "disabled");
+5 -1
View File
@@ -12,6 +12,7 @@
#include "modules/serial_lock.h" // Global serial write mutex
#include "modules/tunables.h" // Gauge calibration + alert thresholds (NVS, serial console)
#include "modules/espnow_link.h" // ESP-NOW transmit leg of the link to Controller B
#include "modules/diag_probe.h" // On-demand OBD-II requests (`diag` console) - the only CAN transmitter
// ============================================================================
// MINIMAL LVGL + UI SETTINGS + WIFI + UART
@@ -142,6 +143,8 @@ void setup()
// Tunables (gauge calibration, alert thresholds) - before CAN/UART start
Tunables::init();
DiagProbe::init();
Tunables::setExtraCommandHandler(DiagProbe::handleCommand);
// Load saved switch states from NVS
ESP_LOGI("MAIN", "Loading saved switch states from NVS...");
@@ -207,8 +210,9 @@ void loop()
// (Settings screen gets destroyed/recreated when swiping)
UIStateManager::applySavedStatesToUI();
// Serial console for the gauge tunables (cfg ...)
// Serial console: gauge tunables (cfg ...) and the diagnostic probe (diag ...)
Tunables::pollSerial();
DiagProbe::tick();
DrivelineScreen::tick();
TuningScreen::tick();
+556
View File
@@ -0,0 +1,556 @@
/*
* Diagnostic Probe Module Implementation
*
* See diag_probe.h. Threading: onFrame() runs in the CAN task, everything else
* in loop(); g_mutex guards the shared state. Transmission goes through
* CANDriver::transmit() and nowhere else.
*/
#include "diag_probe.h"
#include "serial_lock.h"
#include "drivers/can_driver.h"
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <string.h>
namespace DiagProbe {
// ============================================================================
// CONSTANTS
// ============================================================================
static const uint32_t OBD_FUNCTIONAL_ID = 0x7DF; // "any emissions ECU"
static const uint32_t OBD_RESP_FIRST = 0x7E8; // responders 0x7E8..0x7EF
static const uint32_t OBD_RESP_LAST = 0x7EF; // physical request = response - 8
static const uint32_t OBD_REQ_FIRST = 0x7E0;
static const uint32_t OBD_REQ_LAST = 0x7E7;
static const uint32_t BMW_TESTER_ID = 0x6F1; // BMW KWP/UDS tester (Launch, INPA)
static const uint32_t REPLY_TIMEOUT_MS = 500; // P2 is 50 ms; be generous
static const uint32_t LINGER_MS = 150; // after the first reply, wait for other ECUs
static const uint32_t PENDING_EXTRA_MS = 2000; // NRC 0x78 "response pending"
static const uint32_t TESTER_GUARD_MS = 3000; // refuse to send this soon after a foreign tester
static const uint8_t PAD_BYTE = 0x00;
static const size_t MAX_PAYLOAD = 64;
static const int MAX_RESPONDERS = 4;
static const int SCAN_BLOCKS = 8; // 0x00, 0x20, ... 0xE0
// ============================================================================
// STATE
// ============================================================================
enum state_t { ST_IDLE, ST_WAITING };
struct responder_t {
uint32_t id;
uint32_t bitmap[SCAN_BLOCKS];
bool have[SCAN_BLOCKS];
};
static SemaphoreHandle_t g_mutex = NULL;
static state_t g_state = ST_IDLE;
static uint8_t g_req_mode = 0, g_req_pid = 0;
static uint32_t g_deadline_ms = 0;
static uint8_t g_replies_this_req = 0;
// ISO-TP reassembly (one multi-frame reply at a time; other ECUs' single frames
// still get through while it is in progress)
static uint32_t g_rx_id = 0;
static uint8_t g_rx_buf[MAX_PAYLOAD];
static size_t g_rx_len = 0, g_rx_expected = 0;
static uint8_t g_rx_seq = 0;
static bool g_rx_active = false;
// supported-PID scan
static bool g_scan_active = false;
static int g_scan_block = 0;
static responder_t g_resp[MAX_RESPONDERS];
static int g_resp_count = 0;
// foreign tester guard + counters
static uint32_t g_last_tester_ms = 0;
static uint32_t g_last_tester_id = 0;
static uint32_t g_requests = 0, g_replies = 0, g_timeouts = 0, g_negatives = 0;
static uint32_t g_tx_fail_at_send = 0; // CANDriver tx_failures when the request went out
static bool g_last_req_unacked = false;
// ============================================================================
// HELPERS
// ============================================================================
static void lock() { if (g_mutex) xSemaphoreTake(g_mutex, portMAX_DELAY); }
static void unlock() { if (g_mutex) xSemaphoreGive(g_mutex); }
static void print(const char* fmt, ...) {
char buf[220];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
SerialLock::lock();
Serial.println(buf);
SerialLock::unlock();
}
static void hexdump(char* out, size_t out_sz, const uint8_t* p, size_t n) {
size_t w = 0;
for (size_t i = 0; i < n && w + 3 < out_sz; i++) {
w += snprintf(out + w, out_sz - w, "%02X ", p[i]);
}
if (w > 0) out[w - 1] = 0; else out[0] = 0;
}
/** Names for the mode-01 PIDs worth recognising in a scan summary. */
static const char* pidName(uint8_t pid) {
switch (pid) {
case 0x01: return "monitor status";
case 0x04: return "engine load";
case 0x05: return "coolant temp";
case 0x0B: return "MAP (1 byte, caps 255 kPa)";
case 0x0C: return "rpm";
case 0x0D: return "vehicle speed";
case 0x0F: return "intake air temp";
case 0x10: return "MAF";
case 0x11: return "throttle";
case 0x1F: return "run time";
case 0x21: return "distance with MIL";
case 0x23: return "fuel rail pressure";
case 0x2C: return "EGR commanded";
case 0x33: return "barometric";
case 0x42: return "module voltage";
case 0x46: return "ambient air temp";
case 0x4C: return "throttle commanded";
case 0x5C: return "oil temp";
case 0x5E: return "fuel rate";
case 0x62: return "actual torque %";
case 0x63: return "reference torque";
case 0x70: return "boost pressure control";
case 0x73: return "exhaust pressure";
case 0x78: return "EGT bank 1";
case 0x7A: return "DPF differential pressure";
case 0x83: return "NOx sensor";
default: return NULL;
}
}
/** Human decode of a mode-01 reply payload p = [pid, A, B, ...], n bytes. */
static void decodePid(uint8_t pid, const uint8_t* d, size_t n) {
// d points at A; n = number of data bytes after the PID echo
#define NEED(k) if (n < (k)) return
#define U16(i) ((uint16_t)((d[i] << 8) | d[(i) + 1]))
switch (pid) {
case 0x05: NEED(1); print("[diag] coolant = %d C", (int)d[0] - 40); break;
case 0x0B: NEED(1); print("[diag] MAP = %u kPa abs%s", d[0], d[0] == 255 ? " (clipped)" : ""); break;
case 0x0C: NEED(2); print("[diag] rpm = %u", U16(0) / 4); break;
case 0x0D: NEED(1); print("[diag] speed = %u km/h", d[0]); break;
case 0x0F: NEED(1); print("[diag] intake air = %d C", (int)d[0] - 40); break;
case 0x10: NEED(2); print("[diag] MAF = %u.%02u g/s", U16(0) / 100, U16(0) % 100); break;
case 0x11: NEED(1); print("[diag] throttle = %u %%", (unsigned)d[0] * 100 / 255); break;
case 0x23: NEED(2); print("[diag] rail pressure = %lu kPa", (unsigned long)U16(0) * 10); break;
case 0x33: NEED(1); print("[diag] baro = %u kPa", d[0]); break;
case 0x42: NEED(2); print("[diag] module voltage = %u.%03u V", U16(0) / 1000, U16(0) % 1000); break;
case 0x46: NEED(1); print("[diag] ambient = %d C", (int)d[0] - 40); break;
case 0x5C: NEED(1); print("[diag] oil temp = %d C", (int)d[0] - 40); break;
case 0x5E: NEED(2); print("[diag] fuel rate = %u.%02u L/h", U16(0) / 20, (U16(0) % 20) * 5); break;
case 0x62: NEED(1); print("[diag] actual torque = %d %%", (int)d[0] - 125); break;
case 0x63: NEED(2); print("[diag] reference torque = %u Nm", U16(0)); break;
case 0x70: NEED(5);
// A = support bits; B,C commanded; D,E actual; x0.03125 kPa
print("[diag] boost commanded = %lu hPa abs, actual = %lu hPa abs (J1979 PID 70)",
(unsigned long)U16(1) * 3125 / 10000, (unsigned long)U16(3) * 3125 / 10000);
break;
case 0x73: NEED(3); print("[diag] exhaust pressure bank1 = %lu hPa", (unsigned long)U16(1) / 10); break;
case 0x78: NEED(3); {
for (size_t s = 0; s < 4 && (size_t)(2 + 2 * s) < n; s++) {
uint16_t raw = U16(1 + 2 * s);
print("[diag] EGT sensor %u = %d.%u C", (unsigned)s + 1, (int)raw / 10 - 40, raw % 10);
}
break;
}
case 0x7A: NEED(3); print("[diag] DPF dP = %lu Pa", (unsigned long)U16(1) * 10); break;
default: break;
}
#undef NEED
#undef U16
}
static responder_t* findResponder(uint32_t id, bool create) {
for (int i = 0; i < g_resp_count; i++) {
if (g_resp[i].id == id) return &g_resp[i];
}
if (!create || g_resp_count >= MAX_RESPONDERS) return NULL;
responder_t* r = &g_resp[g_resp_count++];
memset(r, 0, sizeof(*r));
r->id = id;
return r;
}
// ----------------------------------------------------------------------------
// Transmit
// ----------------------------------------------------------------------------
/** Build and send one single-frame request. Caller holds no lock. */
static bool sendRequest(uint8_t mode, uint8_t pid) {
if (!CANDriver::isActive()) {
print("[diag] refused: CAN is not running");
return false;
}
uint32_t now = millis();
lock();
bool busy = (g_state != ST_IDLE);
uint32_t since_tester = now - g_last_tester_ms;
bool tester = (g_last_tester_ms != 0) && (since_tester < TESTER_GUARD_MS);
uint32_t tester_id = g_last_tester_id;
unlock();
if (busy) {
print("[diag] refused: a request is already in flight");
return false;
}
if (tester) {
print("[diag] refused: another tester is polling (0x%03lX seen %lu ms ago) - unplug the scan tool",
(unsigned long)tester_id, (unsigned long)since_tester);
return false;
}
uint8_t f[8];
memset(f, PAD_BYTE, sizeof(f));
f[0] = 0x02; // ISO-TP single frame, 2 bytes
f[1] = mode;
f[2] = pid;
lock();
g_state = ST_WAITING;
g_req_mode = mode;
g_req_pid = pid;
g_deadline_ms = now + REPLY_TIMEOUT_MS;
g_replies_this_req = 0;
g_rx_active = false;
g_requests++;
g_tx_fail_at_send = CANDriver::getStats().tx_failures;
unlock();
if (!CANDriver::transmit(OBD_FUNCTIONAL_ID, f, sizeof(f))) {
lock();
g_state = ST_IDLE;
unlock();
print("[diag] transmit failed (TWAI queue)");
return false;
}
print("[diag] -> 0x7DF %02X %02X", mode, pid);
return true;
}
/** Flow control for a multi-frame reply: "send everything, no gaps". */
static void sendFlowControl(uint32_t responder_id) {
uint8_t f[8];
memset(f, PAD_BYTE, sizeof(f));
f[0] = 0x30; // FC, ContinueToSend
f[1] = 0x00; // block size: all
f[2] = 0x00; // STmin: 0 ms
CANDriver::transmit(responder_id - 8, f, sizeof(f));
}
// ----------------------------------------------------------------------------
// Reply handling (CAN task context)
// ----------------------------------------------------------------------------
static void finishScanBlockIfPrimary(uint32_t id, const uint8_t* p, size_t n);
/** A complete ISO-TP payload from `id`. Caller holds g_mutex. */
static void handleReply(uint32_t id, const uint8_t* p, size_t n) {
char hex[3 * 24 + 1];
hexdump(hex, sizeof(hex), p, n > 24 ? 24 : n);
g_replies++;
if (n >= 3 && p[0] == 0x7F) {
// negative response: 7F <mode> <NRC>
if (p[2] == 0x78) {
print("[diag] <- 0x%03lX %s (response pending, waiting)", (unsigned long)id, hex);
g_deadline_ms = millis() + PENDING_EXTRA_MS;
return;
}
g_negatives++;
const char* why = (p[2] == 0x11) ? "service not supported"
: (p[2] == 0x12) ? "sub-function / PID not supported"
: (p[2] == 0x31) ? "request out of range"
: (p[2] == 0x22) ? "conditions not correct"
: "negative response";
print("[diag] <- 0x%03lX %s (%s, NRC 0x%02X)", (unsigned long)id, hex, why, p[2]);
g_replies_this_req++;
if (g_deadline_ms > millis() + LINGER_MS) g_deadline_ms = millis() + LINGER_MS;
return;
}
g_replies_this_req++;
if (g_deadline_ms > millis() + LINGER_MS) g_deadline_ms = millis() + LINGER_MS;
print("[diag] <- 0x%03lX %s%s", (unsigned long)id, hex, n > 24 ? " ..." : "");
if (n < 2 || p[0] != (uint8_t)(g_req_mode + 0x40) || p[1] != g_req_pid) {
print("[diag] (unexpected payload for request %02X %02X)", g_req_mode, g_req_pid);
return;
}
if (g_req_mode == 0x01 && (g_req_pid & 0x1F) == 0 && n >= 6) {
// supported-PID bitmap: 41 <block> A B C D
uint32_t bits = ((uint32_t)p[2] << 24) | ((uint32_t)p[3] << 16) | ((uint32_t)p[4] << 8) | p[5];
responder_t* r = findResponder(id, true);
int blk = g_req_pid / 0x20;
if (r && blk < SCAN_BLOCKS) {
r->bitmap[blk] = bits;
r->have[blk] = true;
}
char list[3 * 32 + 1];
size_t w = 0;
for (int b = 31; b >= 0; b--) {
if (bits & (1UL << b)) {
w += snprintf(list + w, sizeof(list) - w, "%02X ", g_req_pid + (32 - b));
}
}
if (w) list[w - 1] = 0; else strcpy(list, "(none)");
print("[diag] PIDs %02X-%02X supported: %s", g_req_pid + 1, g_req_pid + 0x20, list);
return;
}
if (g_req_mode == 0x01) {
decodePid(g_req_pid, p + 2, n - 2);
} else if (g_req_mode == 0x09 && n >= 3) {
// 49 <pid> <count> <ascii...>
char s[MAX_PAYLOAD + 1];
size_t k = 0;
for (size_t i = 3; i < n && k < MAX_PAYLOAD; i++) {
s[k++] = (p[i] >= 0x20 && p[i] < 0x7F) ? (char)p[i] : '.';
}
s[k] = 0;
print("[diag] %s: \"%s\"", g_req_pid == 0x02 ? "VIN" : g_req_pid == 0x0A ? "ECU name" : "text", s);
}
}
void onFrame(const twai_message_t& m) {
if (m.extd) return;
uint32_t id = m.identifier;
// Foreign tester activity: our own frames are not looped back in NORMAL mode,
// so anything on these IDs is somebody else's request.
if (id == OBD_FUNCTIONAL_ID || (id >= OBD_REQ_FIRST && id <= OBD_REQ_LAST) || id == BMW_TESTER_ID) {
lock();
g_last_tester_ms = millis();
g_last_tester_id = id;
unlock();
return;
}
if (id < OBD_RESP_FIRST || id > OBD_RESP_LAST) return;
if (m.data_length_code == 0) return;
lock();
if (g_state != ST_WAITING) { unlock(); return; }
uint8_t pci = m.data[0] >> 4;
const uint8_t* d = m.data;
uint8_t dlc = m.data_length_code;
if (pci == 0x0) {
// single frame
size_t len = d[0] & 0x0F;
if (len > 0 && len + 1 <= dlc) handleReply(id, d + 1, len);
} else if (pci == 0x1) {
// first frame: 1L LL data[6]
if (!g_rx_active && dlc >= 2) {
g_rx_expected = ((size_t)(d[0] & 0x0F) << 8) | d[1];
if (g_rx_expected > MAX_PAYLOAD) g_rx_expected = MAX_PAYLOAD;
g_rx_len = 0;
for (uint8_t i = 2; i < dlc && g_rx_len < g_rx_expected; i++) g_rx_buf[g_rx_len++] = d[i];
g_rx_id = id;
g_rx_seq = 1;
g_rx_active = true;
g_deadline_ms = millis() + REPLY_TIMEOUT_MS;
unlock();
sendFlowControl(id); // outside the lock: transmit() may block briefly
return;
}
} else if (pci == 0x2) {
// consecutive frame: 2N data[7]
if (g_rx_active && id == g_rx_id && (d[0] & 0x0F) == (g_rx_seq & 0x0F)) {
for (uint8_t i = 1; i < dlc && g_rx_len < g_rx_expected; i++) g_rx_buf[g_rx_len++] = d[i];
g_rx_seq++;
g_deadline_ms = millis() + REPLY_TIMEOUT_MS;
if (g_rx_len >= g_rx_expected) {
g_rx_active = false;
handleReply(id, g_rx_buf, g_rx_len);
}
}
}
unlock();
}
// ----------------------------------------------------------------------------
// Sequencing (loop context)
// ----------------------------------------------------------------------------
static void printScanSummary() {
if (g_resp_count == 0) {
if (g_last_req_unacked) {
print("[diag] scan result: the request was NOT ACKED - no other node saw it.");
print("[diag] Bench with no bus, wiring, or a bus fault. Says nothing about the ECU yet.");
} else {
print("[diag] scan result: frame ACKED but NO REPLY on 0x7E8-0x7EF. This ECU does not");
print("[diag] answer generic OBD-II on this bus (EOBD on K-line, or not at all) - Route B only.");
}
return;
}
for (int i = 0; i < g_resp_count; i++) {
responder_t* r = &g_resp[i];
int total = 0;
for (int b = 0; b < SCAN_BLOCKS; b++) {
if (!r->have[b]) continue;
for (int bit = 31; bit >= 0; bit--) if (r->bitmap[b] & (1UL << bit)) total++;
}
print("[diag] responder 0x%03lX (%s): %d mode-01 PIDs", (unsigned long)r->id,
r->id == 0x7E8 ? "engine ECU" : r->id == 0x7E9 ? "usually transmission" : "other", total);
for (int b = 0; b < SCAN_BLOCKS; b++) {
if (!r->have[b]) continue;
for (int bit = 31; bit >= 0; bit--) {
if (!(r->bitmap[b] & (1UL << bit))) continue;
uint8_t pid = (uint8_t)(b * 0x20 + (32 - bit));
const char* name = pidName(pid);
if (name) print("[diag] %02X %s", pid, name);
}
}
}
print("[diag] next: `diag pid 0C` (rpm) to prove a data read, `diag vin` for the donor");
}
void tick() {
if (g_state == ST_IDLE) return;
uint32_t now = millis();
lock();
if ((int32_t)(now - g_deadline_ms) < 0) { unlock(); return; }
// request over
bool got_reply = g_replies_this_req > 0;
bool scan = g_scan_active;
int block = g_scan_block;
g_state = ST_IDLE;
g_rx_active = false;
if (!got_reply) g_timeouts++;
// Did the TWAI controller report that nobody ACKed our single-shot frame?
g_last_req_unacked = (CANDriver::getStats().tx_failures != g_tx_fail_at_send);
bool unacked = g_last_req_unacked;
bool send_next = false;
if (scan) {
// continue while the primary responder advertised the next block
responder_t* primary = (g_resp_count > 0) ? &g_resp[0] : NULL;
bool next_supported = primary && block < SCAN_BLOCKS && primary->have[block] &&
(primary->bitmap[block] & 1UL);
if (got_reply && next_supported && block + 1 < SCAN_BLOCKS) {
g_scan_block = block + 1;
send_next = true;
} else {
g_scan_active = false;
}
}
unlock();
if (!got_reply) {
print("[diag] no reply within %lu ms (request %02X %02X)%s", (unsigned long)REPLY_TIMEOUT_MS,
g_req_mode, g_req_pid, unacked ? " - frame was not ACKed by any node" : " - frame was ACKed, ECU stayed silent");
}
if (scan) {
if (send_next) {
sendRequest(0x01, (uint8_t)(g_scan_block * 0x20));
} else {
printScanSummary();
}
}
}
// ----------------------------------------------------------------------------
// Console
// ----------------------------------------------------------------------------
static void help() {
print("diag pids scan mode-01 supported-PID bitmaps (the Route A probe)");
print("diag pid <hex> one mode-01 request, e.g. `diag pid 0C` (rpm), `diag pid 70` (boost)");
print("diag vin mode 09 PID 02 - VIN");
print("diag ecu mode 09 PID 0A - ECU name");
print("diag status counters, responders, tester guard");
print("Sends on 0x7DF only, one request at a time; refused while a scan tool is polling.");
}
static void status() {
lock();
uint32_t req = g_requests, rep = g_replies, to = g_timeouts, neg = g_negatives;
uint32_t tms = g_last_tester_ms, tid = g_last_tester_id;
state_t st = g_state;
int nresp = g_resp_count;
unlock();
can_stats_t cs = CANDriver::getStats();
print("[diag] state=%s requests=%lu replies=%lu timeouts=%lu negative=%lu | CAN tx=%lu tx_failed=%lu",
st == ST_IDLE ? "idle" : "waiting", (unsigned long)req, (unsigned long)rep,
(unsigned long)to, (unsigned long)neg,
(unsigned long)cs.messages_transmitted, (unsigned long)cs.tx_failures);
if (tms) {
print("[diag] foreign tester 0x%03lX last seen %lu ms ago", (unsigned long)tid, (unsigned long)(millis() - tms));
} else {
print("[diag] no foreign tester seen since boot");
}
for (int i = 0; i < nresp; i++) {
print("[diag] responder %d: 0x%03lX", i, (unsigned long)g_resp[i].id);
}
}
bool handleCommand(const char* line) {
char buf[64];
strncpy(buf, line, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = 0;
char* argv[4] = {0};
int argc = 0;
for (char* tok = strtok(buf, " \t"); tok && argc < 4; tok = strtok(NULL, " \t")) {
argv[argc++] = tok;
}
if (argc == 0 || strcmp(argv[0], "diag") != 0) return false;
if (argc == 1 || !strcmp(argv[1], "help")) { help(); return true; }
if (!strcmp(argv[1], "status")) { status(); return true; }
if (!strcmp(argv[1], "pids")) {
lock();
bool busy = (g_state != ST_IDLE);
if (!busy) {
g_scan_active = true;
g_scan_block = 0;
g_resp_count = 0;
memset(g_resp, 0, sizeof(g_resp));
}
unlock();
if (busy) { print("[diag] refused: a request is already in flight"); return true; }
print("[diag] scanning supported PIDs (mode 01, blocks 00/20/40/...)");
if (!sendRequest(0x01, 0x00)) {
lock(); g_scan_active = false; unlock();
}
return true;
}
if (!strcmp(argv[1], "pid") && argc == 3) {
long v = strtol(argv[2], NULL, 16);
if (v < 0 || v > 0xFF) { print("[diag] pid must be 00..FF (hex)"); return true; }
sendRequest(0x01, (uint8_t)v);
return true;
}
if (!strcmp(argv[1], "vin")) { sendRequest(0x09, 0x02); return true; }
if (!strcmp(argv[1], "ecu")) { sendRequest(0x09, 0x0A); return true; }
help();
return true;
}
void init() {
if (!g_mutex) g_mutex = xSemaphoreCreateMutex();
}
} // namespace DiagProbe
+53
View File
@@ -0,0 +1,53 @@
/*
* Diagnostic Probe Module
*
* The ONLY place this firmware transmits on the PT-CAN. Sends single OBD-II
* (SAE J1979 / ISO 15031-5) requests on the functional address 0x7DF and
* reassembles the ISO 15765-2 replies from 0x7E8..0x7EF, to find out whether
* the DDE answers generic OBD on this bus and which PIDs it offers — the first
* step of wiki/pages/obd-diagnostic-polling.md ("Route A").
*
* Strictly on demand: nothing is sent unless a `diag ...` console command asks
* for it, one request is in flight at a time, frames go out single-shot (no
* retransmit storms if nobody ACKs), and requests are refused while another
* tester (a scan tool on 0x7DF / 0x7E0..7 / 0x6F1) has been seen recently.
*
* Console (USB serial, same line reader as `cfg`):
* diag pids scan the mode-01 supported-PID bitmaps (00, 20, 40, ...)
* diag pid <hex> one mode-01 request, e.g. `diag pid 0C` (rpm)
* diag vin mode 09 PID 02 — VIN (identifies the donor)
* diag ecu mode 09 PID 0A — ECU name string
* diag status counters, responders seen, tester-guard timer
* diag help
*
* Every frame we send is echoed on the console as
* CANTX,<ts_ms>,<id_hex>,0,<dlc>,<data_hex>
* — the same shape as CANRAW — so a capture holds both halves of every exchange.
*/
#pragma once
#include <Arduino.h>
#include "driver/twai.h"
namespace DiagProbe {
/** Create the state mutex. Call once in setup(), before the CAN task starts. */
void init();
/**
* Execute one console line beginning with "diag".
* @return true if the line was a diag command (even if it was rejected)
*/
bool handleCommand(const char* line);
/** Timeouts and scan sequencing. Call from loop(). */
void tick();
/**
* Feed every received CAN frame here (called from the CAN task). Cheap for
* IDs outside the diagnostic range.
*/
void onFrame(const twai_message_t& m);
} // namespace DiagProbe
+8 -2
View File
@@ -22,6 +22,7 @@ static SemaphoreHandle_t g_mutex = NULL;
static char g_line[96];
static size_t g_line_len = 0;
static bool (*g_extra_handler)(const char*) = NULL;
// ============================================================================
// PRIVATE HELPERS
@@ -88,6 +89,7 @@ static void help() {
print(" tach_en temp_en coolant_hot gearbox_hot batt_low(x100)");
print("cfg override off | rpm <n> | duty <n> | both <rpm> <duty>");
print("cfg reset back to defaults");
print("diag help OBD-II diagnostic probe (transmits on the bus)");
}
static bool setField(const char* name, long v) {
@@ -241,14 +243,18 @@ bool handleCommand(const char* line) {
return true;
}
void setExtraCommandHandler(bool (*handler)(const char* line)) {
g_extra_handler = handler;
}
void pollSerial() {
while (Serial.available()) {
char c = (char)Serial.read();
if (c == '\r' || c == '\n') {
if (g_line_len > 0) {
g_line[g_line_len] = 0;
if (!handleCommand(g_line)) {
print("[console] unknown command '%s' (try 'cfg help')", g_line);
if (!handleCommand(g_line) && !(g_extra_handler && g_extra_handler(g_line))) {
print("[console] unknown command '%s' (try 'cfg help' or 'diag help')", g_line);
}
g_line_len = 0;
}
+7 -1
View File
@@ -54,8 +54,14 @@ bool handleCommand(const char* line);
/**
* Non-blocking: read pending bytes from Serial, dispatch complete lines to
* handleCommand(). Call from loop().
* handleCommand(), then to the extra handler (if registered). Call from loop().
*/
void pollSerial();
/**
* Register a second console command handler (e.g. DiagProbe::handleCommand)
* that gets lines `cfg` does not recognise. Returns true if it consumed the line.
*/
void setExtraCommandHandler(bool (*handler)(const char* line));
} // namespace Tunables
+1
View File
@@ -22,6 +22,7 @@ wiki/
index.md # catalog of all pages, by category — update on EVERY change
log.md # append-only chronological record of ingests/queries/lints
raw/ # immutable source documents (web clips, PDFs, CAN logs) — NEVER edit
Clippings/ # Obsidian Web Clipper drop folder — same rules as raw/ (immutable, one source page each)
sources/ # one summary page per raw source
pages/ # entity & concept pages (the heart of the wiki)
```
@@ -0,0 +1,177 @@
---
title: "Extended BMW 335d PIDs for Torque"
source: "https://6post.com/forums/showthread.php?p=17790638"
author:
published:
created: 2026-09-21
description: "Extended BMW 335d PIDs for Torque"
tags:
- "clippings"
---
Login
[Register](https://6post.com/forums/register.php?s=e8e35f7bf36a1f6a242c192e52bad687)
Try out the [new beta site for E90Post](https://www.e90post.com/beta). You can read more about what's happening [here](https://www.e90post.com/forums/showthread.php?t=2228481)
| ![](https://6post.com/forums/multisite-style/e90post/grey-left-small2.gif) | [![TNT Racewerks](https://www.e90post.com/forums/images/banners/tnt468x60.jpg "TNT Racewerks")](http://tntracewerks.com/) | | |
| --- | --- | --- | --- |
| | | | [BMW Garage](https://6post.com/forums/bpgarage.php) | [BMW Meets](https://6post.com/forums/calendar.php?s=e8e35f7bf36a1f6a242c192e52bad687) | [Register](https://6post.com/forums/register.php?s=e8e35f7bf36a1f6a242c192e52bad687) | [Today's Posts](https://6post.com/forums/search.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=getdaily) | |
| --- | --- | --- | --- | --- | --- | --- | --- |
| | [BMW 3-Series (E90 E92) Forum](https://6post.com/forums/index.php?s=e8e35f7bf36a1f6a242c192e52bad687&) > [E90 / E92 / E93 3-series Powertrain and Drivetrain Discussions](https://6post.com/forums/forumdisplay.php?s=e8e35f7bf36a1f6a242c192e52bad687&f=378) > [N57 / M57 Turbo Diesel Discussions - 335d](https://6post.com/forums/forumdisplay.php?s=e8e35f7bf36a1f6a242c192e52bad687&f=377) \> **Extended BMW 335d PIDs for Torque** | |
| --- | --- | --- |
| Page 1 of 11 | **1** | [2](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=2 "Show results 23 to 44 of 238") | [3](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=3 "Show results 45 to 66 of 238") | [4](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=4 "Show results 67 to 88 of 238") | [5](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=5 "Show results 89 to 110 of 238") | [\>](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=2 "Next Page - Results 23 to 44 of 238") | [Last **»**](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=11 "Last Page - Results 221 to 238 of 238") | |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| | [Thread Tools](https://6post.com/forums/showthread.php?p=17790638&nojs=1#goto_threadtools) |
| --- | --- |
| 04-22-2015, 05:32 PM | \# [**1**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17789959&postcount=1) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | **Extended BMW 335d PIDs for Torque** --- If laziness is the mother of invention, her sister is frustration. I was getting tired of the Torque App's inconsistence units and scaling for several parameters I like to log. So, I decided to 'roll' my own. Here is a list of items I added to an extended PID csv file: AFR now reads correctly for a diesel, instead of gas. Small adjustment, but what the heck, let's get it right. Boost was the worst offender. Torque's version was just plain wrong. Now you can have a reading that matches an analog gauge! Same with exhaust manifold pressure, and in psi. Air Mass wasn't even in mass units. Now you can log lbs/min and see where the LP compressor maxes out on a compressor map. And see how it is very much temperature dependent. Speaking of which, ambient air, intake air and charge air cooler temperatures are all there in Fahrenheit degrees. Fuel Flow in lbs/hr so you can estimate crank HP from BSFC (~0.4lbs/HP/hr) Unless, you are adding fuel by fuel rail pressure manipulation or methanol injection. Then all bets are off. All 3 exhaust temperature probes can be monitored in Fahrenheit. The full configuration is in the attached "BMW 335d.csv" Just copy the file into the.torque/extendedpids folder (remember to remove the 'txt' suffix from the file name). Then select settings in the main menu of Torque. From there scroll down to "Manage extra PIDs/Sensors" and select. From the menu icon in the upper right hand corner select "Add predefined set", then you will see BMW 335d. Select that and the csv file parameters will be loaded for you to select from, just as you would any other parameter in Torque. Note, I formatted the parameter names so that they appear at the top of list and are easy to find. I have also included a PDF of the SAE J1979 document that gives details of OBD II PIDs. Enjoy. --- *Last edited by DWR; 11-20-2017 at 08:32 PM..* |
| | Appreciate 9 [Got-Torque](https://6post.com/forums/member.php?u=339375) 10.50 [UT335d](https://6post.com/forums/member.php?u=317694) 2.00 [daenosx](https://6post.com/forums/member.php?u=290986) 8.50 [Chief Orman](https://6post.com/forums/member.php?u=205984) 735.00 [canam\_banana](https://6post.com/forums/member.php?u=387400) 0.00 [zild](https://6post.com/forums/member.php?u=453355) 0.00 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17789959 "Reply with Quote") |
| 04-22-2015, 07:45 PM | \# [**2**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17790638&postcount=2) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | In case any one has a problem downloading the file, here's the txt in the csv: Name,ShortName,ModeAndPID,Equation,Min Value,Max Value,Units,Header 0-0 BMW 335d Ambient Air Temperature,AAT,146,((A-40)\*1.8)+32,0,50,°F,Auto 0-0 BMW 335d Intake Air Temperature,IAT,10F,((A-40)\*1.8)+32,0,100,°F,Auto 0-0 BMW 335d Charged Air Cooler Temperature,CACT,177,((B-40)\*1.8)+32,0,100,°F,Auto 0-0 BMW 335d AFR,AFR,124,((A\*256)+B)\*0.00044225,0,30,AFR,Auto 0-0 BMW 335d Air Mass,Air Mass,110,((((A\*256)+B)/100)\*0.132276),0,50,lb/min,Auto 0-0 BMW 335d Manifold Pressure,Boost,170,((((((D\*256)+E)\*0.296)-1000)/1000)\*14.5),0,35,psi,Auto 0-0 BMW 335d Exhaust Manifold Pressure,Exh Press,173,(((((B\*256)+C)/10)-1000)/1000)\*14.5,0,45,psi,Auto 0-0 BMW 335d Fuel Flow,Fuel Flow,015E,((A\*256)+B)\*5.64,0,125,lb/hr,Auto 0-0 BMW 335d Exhaust Temperature Post DOC,EGT Pre DPF,178,(((((B\*256)+C)/10)-40)\*1.8)+32,0,1400,°F,Auto 0-0 BMW 335d Exhaust Temperature Pre DOC,EGT Pre DOC,178,(((((D\*256)+E)/10)-40)\*1.8)+32,0,1400,°F,Auto 0-0 BMW 335d Exhaust Temperature Pre SCR,EGT Pre SCR,178,(((((F\*256)+G)/10)-40)\*1.8)+32,0,1400,°F,Auto |
| | Appreciate 3 [UT335d](https://6post.com/forums/member.php?u=317694) 2.00 [Chief Orman](https://6post.com/forums/member.php?u=205984) 735.00 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17790638 "Reply with Quote") |
| 04-22-2015, 08:21 PM | \# [**3**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17790800&postcount=3) |
| --- | --- |
| [Gearhead51](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=262258) Private First Class 27 Rep 126 Posts Drives: 335D Montego Premium Msport Join Date: Jan 2015 Location: north Atlanta, GA iTrader: (**[1](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=262258)**) | You, sir, are my hero. I'll try to plug this in this weekend. I did an extended scan on a road trip. Every screen orientation change or fuel stop caused it to start over. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17790800 "Reply with Quote") |
| 04-22-2015, 09:39 PM | \# [**4**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17791225&postcount=4) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Outstanding. Thank you DWR! \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17791225 "Reply with Quote") |
| 04-23-2015, 06:24 AM | \# [**5**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792469&postcount=5) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Love it. They work exceptionally well, DWR. One thing I did notice is the Boost #'s are tightly aligned with my analog gauge through most of the range, but the analog gauge reads a few psi higher at the top end than this pid is recording. But, the MAP sensor is at a different place in the intake track than my analog gauge is sensing, so that's likely part of it Attached a little screen shot from shortly after a 3rd gear pull this morning on the drive into work... \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792469 "Reply with Quote") |
| 04-23-2015, 06:36 AM | \# [**6**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792498&postcount=6) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | Quote: Originally Posted by **TDIwyse** One thing I did notice is the Boost #'s are tightly aligned with my analog gauge through most of the range, but the analog gauge reads a few psi higher at the top end than this pid is recording. But, the MAP sensor is at a different place in the intake track than my analog gauge is sensing, so that's likely part of it . Yes, my analog port is at the front of the intake manifold and the MAP is at the back. So, I had the same result and reasoned the same thing. I should also note that I found 2 correction factors for that PID. I used the one that gave a slightly higher result. As you know, there is +- tolerance to the sensors on our engines, so adjusting scaling factors to calibrate the output is reasonable. Looks like it was cold there this morning... or is that the methanol? --- *Last edited by DWR; 04-23-2015 at 06:53 AM..* |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792498 "Reply with Quote") |
| 04-23-2015, 06:51 AM | \# [**7**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792533&postcount=7) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Quote: Originally Posted by **DWR** Looks like it was cold there this morning... or is that the methanol? A little of both:-) I should call you Santa Claus. This is exactly what I've been wanting for Christmas. \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792533 "Reply with Quote") |
| 04-23-2015, 07:09 AM | \# [**8**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792596&postcount=8) |
| --- | --- |
| [Gearhead51](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=262258) Private First Class 27 Rep 126 Posts Drives: 335D Montego Premium Msport Join Date: Jan 2015 Location: north Atlanta, GA iTrader: (**[1](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=262258)**) | I'm just looking for a place to "OE" mount my android device. I've been considering a raspberry pi type device with a remote screen or something, but I haven't figured out how to make that happen. Maybe I should get a 3D printer... and the knowledge to use it. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792596 "Reply with Quote") |
| 04-23-2015, 08:10 AM | \# [**9**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792818&postcount=9) |
| --- | --- |
| [iaknown](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=203183) Banned 445 Rep 1,036 Posts Drives: 335D Join Date: May 2013 Location: NJ iTrader: (**[1](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=203183)**) | Awesome work DWR!! Now I just have to locate my Torque folder.... |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792818 "Reply with Quote") |
| 04-23-2015, 08:33 AM | \# [**10**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17792925&postcount=10) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Quote: Originally Posted by **iaknown** Awesome work DWR!! Now I just have to locate my Torque folder.... Ha. I wasted ~30 minutes last night fussing around with my Mac and the Android Assistant thingy to no avail. Then my File Manager on my Android couldn't find it either... until I realized I needed to change its options so it would show "Hidden Folders". Torque puts itself in a place with a "." preceding itself... \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17792925 "Reply with Quote") |
| 04-23-2015, 09:07 AM | \# [**11**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17793122&postcount=11) |
| --- | --- |
| [iaknown](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=203183) Banned 445 Rep 1,036 Posts Drives: 335D Join Date: May 2013 Location: NJ iTrader: (**[1](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=203183)**) | Yup, just stumbled on that as well (after wasting plenty of time myself). Thanks. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17793122 "Reply with Quote") |
| 04-23-2015, 10:37 AM | \# [**12**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17793644&postcount=12) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | Quote: Originally Posted by **TDIwyse** I should call you Santa Claus. This is exactly what I've been wanting for Christmas. Hohoho! You've been a very good boy, helping me out at my 'workshop'. Don't be surprised to find more presents under the tree... |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17793644 "Reply with Quote") |
| 04-23-2015, 11:02 AM | \# [**13**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17793766&postcount=13) |
| --- | --- |
| [Puerto Rican 335d](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=124107) Brigadier General 270 Rep 3,488 Posts Drives: Montego Blue 335d Join Date: Jun 2011 Location: Puerto Rico(Dominican Republic 03/2017) iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=124107)**) | I had a feeling TORQUE had some issues glad you noticed amigo DWR and came to light on it Gracias!! \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ RENNtech Flash(Lenny Wu)/WAGNER IC Enkei Rajin 18"/Execuhitch Hitch/Koni FSD Soft Ride Bike Rack/Brava Synthetic Motor Oil(Made in Puerto Rico)/Meth(in the works)/CBU done w Andrew EGR Race Pipe (whoa! what an animal it is now) |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17793766 "Reply with Quote") |
| 04-23-2015, 01:13 PM | \# [**14**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17794561&postcount=14) |
| --- | --- |
| [Mark M](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=53163) Major 254 Rep 1,294 Posts Drives: E30M3 E83X3 E90335D Join Date: Aug 2007 Location: Lancaster, PA iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=53163)**) | Excellent work DWR! I've loaded these PIDs in my Engine Link app for my iphone. I'll test them on the drive home from the office this evening. Thanks! \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ [![](http://badges.fuelly.com/images/smallsig-us/211912.png)](http://www.fuelly.com/driver/BMWmark/335d) |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17794561 "Reply with Quote") |
| 04-23-2015, 08:10 PM | \# [**15**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17796999&postcount=15) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Really liking these pids... Had a kids track meet this afternoon and took some time to get some steady state intake track temps: Ambient Air Temp (AAT), MAF temp (IAT), and post intercooler Charge Pipe temp (CAC). This is without red scoops... \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17796999 "Reply with Quote") |
| 04-23-2015, 10:53 PM | \# [**16**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17797637&postcount=16) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | Quote: Originally Posted by **TDIwyse** Really liking these pids... Had a kids track meet this afternoon and took some time to get some steady state intake track temps: Ambient Air Temp (AAT), MAF temp (IAT), and post intercooler Charge Pipe temp (CAC). This is without red scoops... Glad you are enjoying them. As much logging as I have done with Testo, watching the gauges on the Nexus 7 has brought some interesting observations. For instance, I never really noticed how much heat the stock airbox can add to the ambient air. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17797637 "Reply with Quote") |
| 04-24-2015, 06:56 AM | \# [**17**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17798665&postcount=17) |
| --- | --- |
| [Mark M](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=53163) Major 254 Rep 1,294 Posts Drives: E30M3 E83X3 E90335D Join Date: Aug 2007 Location: Lancaster, PA iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=53163)**) | DWR, are there other interesting PIDs that you might have up your sleeve to share? Such as SCR spray rate or is there a way to read Diesel fuel quality (not sure that is a data feature in our cars like it is in a gasser)? Or number of DPF regens / miles since last regen? Really love peeking under the hood so to speak and seeing the data behind what the car is doing. Thanks! \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ [![](http://badges.fuelly.com/images/smallsig-us/211912.png)](http://www.fuelly.com/driver/BMWmark/335d) |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17798665 "Reply with Quote") |
| 04-24-2015, 06:59 AM | \# [**18**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17798678&postcount=18) |
| --- | --- |
| [TDIwyse](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659) Colonel 638 Rep 2,408 Posts Drives: 2011 335d Join Date: Aug 2012 Location: MidWest iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=170659)**) | Quote: Originally Posted by **DWR** ... For instance, I never really noticed how much heat the stock airbox can add to the ambient air. I should note that those temps are not with the OEM intake system... It's with a modified intake with aem dryflow cone filter and homemade cold air shield and VRSF intercooler. \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 2011 335d 11.68 @ 125.71 mph 1/4 mile NHRA certified track Ram Cummins with lots-o-mods |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17798678 "Reply with Quote") |
| 04-24-2015, 10:24 AM | \# [**19**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17799646&postcount=19) |
| --- | --- |
| [WreckerX5d](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=103271) Warrant Officer 392 Rep 1,340 Posts Drives: Deezul Join Date: Oct 2010 Location: Long Island, NY iTrader: (**[4](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=103271)**) | Thanks for the list. Does the Torque app show the actual PID code? I would like to load up some PIDs into my ScanGauge2 so it's more of a permanent monitor device instead of pulling out my phone every single time. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17799646 "Reply with Quote") |
| 04-24-2015, 10:34 AM | \# [**20**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17799706&postcount=20) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | Quote: Originally Posted by **TDIwyse** I should note that those temps are not with the OEM intake system... It's with a modified intake with aem dryflow cone filter and homemade cold air shield and VRSF intercooler. Yes, I was aware of that. I think that why it is good to share data, so that you can see cause and affect/what works and what doesn't. |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17799706 "Reply with Quote") |
| 04-24-2015, 10:52 AM | \# [**21**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=17799832&postcount=21) |
| --- | --- |
| [DWR](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022) Banned 816 Rep 1,630 Posts Drives: 2009 335d Join Date: Oct 2014 Location: Maine iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=256022)**) | Quote: Originally Posted by **Mark M** DWR, are there other interesting PIDs that you might have up your sleeve to share? Such as SCR spray rate or is there a way to read Diesel fuel quality (not sure that is a data feature in our cars like it is in a gasser)? Or number of DPF regens / miles since last regen? Really love peeking under the hood so to speak and seeing the data behind what the car is doing. Thanks! These are generic OBDII PIDS. They are commonly listed on the internet [http://en.wikipedia.org/wiki/OBD-II\_PIDs](http://en.wikipedia.org/wiki/OBD-II_PIDs). But there is a trick. Many PIDs have more than one parameter and the data is in multiple bytes. In the csv, you will see Mode&PID. The mode is always 1. The next 2 charaters are the PID, but then in the formulas you will note A,B,C,D etc. Those are the bytes. For those who are looking for non standard PIDs I am going to suggest you work with TestO. I published the list of know parameters with translation from German in a previous post. [http://www.e90post.com/forums/showpo...&postcount=175](http://www.e90post.com/forums/showpost.php?p=17431269&postcount=175) |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=17799832 "Reply with Quote") |
| 06-02-2015, 01:57 PM | \# [**22**](https://6post.com/forums/showpost.php?s=e8e35f7bf36a1f6a242c192e52bad687&p=18016959&postcount=22) |
| --- | --- |
| [Vortechys](https://6post.com/forums/member.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=267340) Private 10 Rep 56 Posts Drives: 2011 335d m sport, 2010 X5M Join Date: Feb 2015 Location: S.E. Michigan iTrader: (**[0](https://6post.com/forums/itrader.php?s=e8e35f7bf36a1f6a242c192e52bad687&u=267340)**) | Would someone please do a step by step guide on how to install these in the torque app? I'm not having any success. I'm using Astro file manager, but I'm not getting anywhere. Thanks |
| | Appreciate 0 [Quote](https://6post.com/forums/newreply.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=newreply&p=18016959 "Reply with Quote") |
| Page 1 of 11 | **1** | [2](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=2 "Show results 23 to 44 of 238") | [3](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=3 "Show results 45 to 66 of 238") | [4](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=4 "Show results 67 to 88 of 238") | [5](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=5 "Show results 89 to 110 of 238") | [\>](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=2 "Next Page - Results 23 to 44 of 238") | [Last **»**](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&page=11 "Last Page - Results 221 to 238 of 238") | |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
Bookmarks
- [twitter](http://twitter.com/home?status=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429)
- [Facebook](http://www.facebook.com/share.php?u=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429)
- [Digg](http://digg.com/submit?phrase=2&url=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429&title=Extended+BMW+335d+PIDs+for+Torque)
- [Google](http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429&title=Extended+BMW+335d+PIDs+for+Torque)
- [StumbleUpon](http://www.stumbleupon.com/submit?url=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429&title=Extended+BMW+335d+PIDs+for+Torque)
- [del.icio.us](http://del.icio.us/post?url=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429&title=Extended+BMW+335d+PIDs+for+Torque)
- [My Yahoo!](http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Extended+BMW+335d+PIDs+for+Torque&u=https%3A%2F%2Fwww.e90post.com%2Fforums%2Fshowthread.php%3Ft%3D1118429)
**«** [Previous Thread](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&goto=nextoldest) | [Next Thread](https://6post.com/forums/showthread.php?s=e8e35f7bf36a1f6a242c192e52bad687&t=1118429&goto=nextnewest) **»**
You **may not** post new threads
You **may not** post replies
You **may not** post attachments
You **may not** edit your posts
---
[BB code](https://6post.com/forums/misc.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=bbcode) is **On**
[Smilies](https://6post.com/forums/misc.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=showsmilies) are **On**
[\[IMG\]](https://6post.com/forums/misc.php?s=e8e35f7bf36a1f6a242c192e52bad687&do=bbcode#imgcode) code is **On**
HTML code is **Off**
---
All times are GMT -5. The time now is 12:25 PM.
File diff suppressed because one or more lines are too long
+3
View File
@@ -18,6 +18,7 @@ Catalog of every page in the wiki. Read this first when answering questions. Kee
- [[can-bus-integration]] — the core challenge; current firmware ID map flagged as placeholder, verification plan
- [[driveline-speed-signals]] — **engine / turbine / output-shaft speeds**: turbine speed as physical proof of gear engagement, and the output-shaft field that is our **only road-speed source** (no DSC on this bus) — the feedback variable for a future cruise-control PoC, with the safety envelope that would require
- [[dual-controller-architecture]] — Controller A → UART1 + ESP-NOW, protocol v2 → Controller B (1.3" display + Patrol gauge outputs); A owns alerts and the gauge tunables (`cfg` console)
- [[obd-diagnostic-polling]] — **why boost / MAF / rail / injection / DTCs never appear on the sniffer** and how a tester gets them: Route A generic OBD-II mode 01 on `0x7DF` (PID table, `01 00` bitmap as the first test — **implemented as the `diag pids` console probe**), Route B BMW addressing (tester `0x6F1` → DDE replies on `0x612`), DDE6 vs DDE7.3 variants, the capture-with-Launch procedure, and why polling is a transmit-on-the-bus design decision
## Synthesis
@@ -34,3 +35,5 @@ Catalog of every page in the wiki. Read this first when answering questions. Kee
- [[can-capture-2026-07-17-drive]] — **first capture with the vehicle moving** (2026-07-17): verifies `0x0BA` gears 2nd–6th directly (making it a complete gear source), catches the lockup clutch live, and produces the ×0.125 output-shaft scaling evidence; raw at `raw/log_20260717_145930.txt`
- [[e65-reverse-engineering-repo]] — **E65 per-ID DBC-style docs (ingested 2026-07-17)** — the highest-value source yet: settled the gearbox-temp offset (raw−40) and battery layout (12-bit ×0.015), proved the engine was running in our capture, and revealed turbine speed, output shaft, pedal position and cruise state
- [[esp32-s3-touch-lcd-5-intro-photo]] — Waveshare annotated board photo (moved into `raw/` 2026-09-21): terminal-block signal order (VIN/GND/VOUT · SDA/SCL · CAN · RS485 A/B · DO0/DO1 · DI), shared CAN/RS485 120 Ω switch, IO0/IO3/IO4/IO46 strapping pads
- [[google-ai-dde7m57-pids]] — Google AI Mode clipping on "dde7m57 pids" (ingested 2026-09-21, raw in `Clippings/`): uncited; its `0x612`-as-request claim is **contradicted**, its D1xx identifiers are `(unverified)`; kept for the Ediabas value names and the user's own observation that `0x612` appears with the Launch connected
- [[dwr-335d-torque-pids]] — **DWR's "Extended BMW 335d PIDs for Torque"** (thread page 1 + `raw/BMW 335d.csv`, ingested 2026-09-21): a gauge-checked set of **generic J1979 mode-01 PIDs** from an M57 diesel (2009 335d, DDE7.3) — boost via PID 70, exhaust pressure, EGTs, MAF, fuel rate; nothing BMW-proprietary. Basis for the "try generic OBD first" route; the diesel-specific PIDs are probably absent on our EDC16
+12
View File
@@ -61,3 +61,15 @@ New hand-coded screen `src/modules/tuning_screen.cpp` (swipe right from Drivelin
## [2026-09-21] update | SquareLine Home screen removed; Driveline is the boot screen
User decision: the Home screen (three arc meters + battery) is not needed. Deleted `include/ui/screens/ui_Home_Screen.c/h`, its four image assets and `src/modules/meters_manager.*`; `ui_init()` now loads an empty placeholder and `display_init.cpp` shows the hand-coded Driveline screen; the generated Settings screen's right-swipe calls a new C entry point `app_show_driveline()`; Driveline swipes left to Settings and right to Gauge Tuning; Tuning swipes left back. Firmware flash shrank ~100 KB. If SquareLine re-exports a Home screen it must be deleted from the SquareLine project, not wired back in. Built and flashed.
## [2026-09-21] ingest | Google AI clipping "dde7m57 pids" — diagnostic-polling page created, 0x612 direction corrected
User clipped a Google AI Mode conversation into `Clippings/` (Obsidian Web Clipper default folder; schema updated to treat it like `raw/`) → [[google-ai-dde7m57-pids]]. Uncited generative summary, filed `(unverified)` throughout. Two things of value: the Ediabas result names for boost/rail/MAF/injection, and the user's own observation embedded in it — **`0x612` appears on the tapped bus while the Launch is connected**, proving diagnostic traffic reaches our tap. The clipping calls `0x612` the *tester request* and `0x6F2` the reply; that contradicts dieslg8 (real M57 code) and the BMW `0x6F1` → `0x600+address` convention — flagged, and the wiki keeps **tester `0x6F1` → DDE `0x612`** until our own capture shows the pair. Its `22 D1 xx` identifiers are uncited and must not be implemented from. Created the long-dangling [[obd-diagnostic-polling]] page (broadcast vs polled, addressing table, DDE6 vs DDE7.3 variant table, capture-with-Launch procedure, firmware implications: polling = transmitting on PT-CAN, a design decision). Side finding: the search term "dde7 m57" describes DDE7.3/EDC17CP09 on the later M57N2 (E90/E70); our E60/E61 donor with a 6HP26X should carry a DDE6/EDC16 — the Launch's ECU-identification page closes [[open-questions]] #2 in one screen. Updated [[bmw-m57n-engine]] (E60/E61, 6HP26X, stale firmware-placeholder warning removed), [[open-questions]] #2/#7 + wishlist, index.
## [2026-09-21] ingest | DWR's 335d Torque PID set — generic OBD-II route documented
User dropped `raw/BMW 335d.csv` and clipped page 1 of the e90post/6post thread "Extended BMW 335d PIDs for Torque" (DWR, 2009 335d = M57N2 on DDE7.3/EDC17CP09) → [[dwr-335d-torque-pids]]. **Every entry is a generic SAE J1979 mode-01 PID** (DWR says so in post 21; header `Auto` = `0x7DF`); nothing BMW-proprietary, nothing broadcast. Two revisions compared: the CSV in `raw/` is the corrected 2017 one (boost ×0.3125 = the J1979 0.03125 kPa/bit; fuel rate ×0.0938 lb/hr; post-#2's ×0.296 and ×5.64 were wrong); residual typos noted (`000031` for 0.0000305, one `+33`). Decoded his table back to SI with the J1979 byte positions. Consequence for us: the generic route is the **cheapest polling experiment** — one `01 00` supported-PID query on `0x7DF` tells whether our DDE answers EOBD on the PT-CAN and which PIDs it has — but the diesel-specific PIDs he relies on for boost (`70`), exhaust pressure (`73`), EGT (`78`), DPF (`7A`), NOx (`83`) are 2007+ J1979 additions an EDC16 almost certainly lacks `(unverified)`, and PID `0B` clips at 255 kPa. [[obd-diagnostic-polling]] restructured into Route A (generic, PID table, first test) and Route B (BMW `0x6F1`/`0x612`). Wishlist: DWR's Testo parameter list (post 175 of the Testo thread). Updated [[open-questions]] #7 + wishlist, index.
## [2026-09-21] update | `diag` console probe: Controller A can now send OBD-II requests
User decision: build the Route A probe. New module `src/modules/diag_probe.cpp` and a single sanctioned transmit function `CANDriver::transmit()` (single-shot frames, `CANTX,` console echo mirroring `CANRAW,`). Console: `diag pids` (mode-01 supported-PID bitmap scan, blocks 00/20/40…, per-responder summary with PID names), `diag pid <hex>` (one request, decoded for the Route A table incl. PID 70 boost and 78 EGT), `diag vin`, `diag ecu` (mode 09), `diag status`. ISO-TP single/first/consecutive frames reassembled with a `30 00 00` flow control to the responder's physical ID. Guards: one request in flight, refused for 3 s after any foreign tester frame (`0x7DF`/`0x7E0–7`/`0x6F1`), services 01 and 09 only. Console dispatch chained through `Tunables::setExtraCommandHandler()`. Built (1.49 MB) and flashed to COM11; bench check with no bus attached: `diag pids` sent `02 01 00` on `0x7DF`, the TWAI controller reported the single-shot frame un-ACKed, and the probe reported "not ACKed - no other node saw it" rather than blaming the ECU (the summary distinguishes un-ACKed from ACKed-but-silent). CAN-task warnings now take the serial lock so they no longer splice into `CANTX` lines. The wiki's "firmware never transmits" statements are now qualified on [[can-bus-integration]] and [[obd-diagnostic-polling]] (test-day procedure and the three possible outcomes written there). Root `CLAUDE.md` and `docs/UART_PROTOCOL.md` console section updated. Procedure rewritten as numbered steps with all four outcomes (un-ACKed / ACKed-silent / one responder / two responders) and the log-capture command.
+5 -5
View File
@@ -1,7 +1,7 @@
---
type: entity
tags: [engine, bmw, can-bus]
updated: 2026-07-15
updated: 2026-09-21
---
# BMW M57N Engine
@@ -10,8 +10,8 @@ The engine at the heart of the project: the display reads its CAN bus and shows
## This specific engine (verified — user, 2026-07-15)
- Donor chassis: **E60/E65 (2003+)** — so a DDE5/DDE6-generation ECU, exact variant TBD.
- Transmission: **BMW automatic with its EGS ECU wired into the CAN bus** — gearbox temp and gear position have a real data source. Likely a ZF 6HP-family box with GS19-era EGS `(unverified)`.
- Donor chassis: **E60/E61 (2003+)** — narrowed from E60/E65 by the 6HP26X gearbox (xDrive output; the 7-series never had M57N + xDrive) — so a DDE6-generation ECU (Bosch EDC16C31/C35) is the expectation `(unverified)`; the DDE7.3 / EDC17CP09 that Google searches for "dde7 m57" describe is the later M57N2 in the E90/E70. Exact variant still TBD — the Launch's ECU-identification page names it (`D60M57D0`/`D62M57B0` vs `D73N57C0`). → [[obd-diagnostic-polling]]
- Transmission: **ZF 6HP26X** (user-confirmed 2026-07-17) with its EGS ECU wired into the CAN bus — gearbox temp and gear position have a real data source ([[gear-box-can-revealings]]).
## Overview (unverified)
@@ -27,11 +27,11 @@ Per the project goals: coolant temperature, oil temperature, gearbox oil tempera
- Exact DDE version and donor model year — narrows the CAN matrix further. → [[open-questions]]
- Whether the swap harness alters what's broadcast vs. a stock E60.
- Values the DDE keeps to itself (boost, MAF, rail pressure, injection quantity, DTCs) are only reachable by polling → [[obd-diagnostic-polling]].
## CAN IDs
> [!warning]
> The candidate IDs originally seeded here (`0x316`, `0x329`, `0x545`) are from **E46/E39-generation** documentation and probably do NOT apply — the donor is E60/E65, a newer bus generation with a different matrix. E60-specific research is tracked in [[can-bus-integration]]. The firmware's current IDs (`0x4F`, `0x55`, `0x201`, `0x1001`, `0x101F` `(repo)`) remain placeholder-quality either way.
The verified E60 map (coolant, gearbox temp, gear, rpm, torque, battery, turbine and output-shaft speed) lives in [[can-id-candidates]]; the firmware decodes exactly that map `(repo, 2026-09-21)`. The E46/E39-era IDs once seeded here (`0x316`, `0x329`, `0x545`) and the firmware's original placeholders (`0x4F`, `0x55`, `0x201`, `0x1001`, `0x101F`) were all confirmed absent from the live bus.
## Related
+4
View File
@@ -43,6 +43,10 @@ The core technical challenge of the project: reading real data from the [[bmw-m5
Coolant/oil temp come from the DDE, but **gearbox temp and gear position come from the EGS module** — they only exist on the bus if the swap retained the automatic transmission and its ECU. `(unverified)` → [[open-questions]]
## Transmit path `(repo, 2026-09-21)`
The firmware is no longer strictly read-only: `CANDriver::transmit()` exists, used only by the on-demand `diag` console probe (single-shot OBD-II requests on `0x7DF`, refused while a scan tool is polling). Nothing is sent without a typed command. Details and the test-day procedure → [[obd-diagnostic-polling]].
## Related
[[bmw-m57n-engine]] · [[esp32-s3-touch-lcd-5b]] · [[open-questions]]
+114
View File
@@ -0,0 +1,114 @@
---
type: concept
tags: [can-bus, dde, egs, diagnostics, kwp2000, uds, obd, design-decision]
updated: 2026-09-21
---
# OBD / Diagnostic Polling
Why some values never appear on the sniffer, how a scan tool gets them, and what it would take for Controller A to do the same. Several pages have linked here since July ([[can-id-candidates]], [[open-questions]] #7); the page was created on the [[google-ai-dde7m57-pids]] ingest, 2026-09-21.
## Broadcast vs polled
- The DDE and EGS **broadcast** only what other modules need to run the car: rpm, coolant, gear, gearbox temp, torque, pedal, battery… — the verified list is in [[can-id-candidates]].
- **Not broadcast** (verified by absence on our own bus): manifold boost (`AIP_ENG` on `0x1D0` is barometric), MAF, rail pressure, injection quantity, fault codes. The Launch scanner shows them because it **polls** the ECU and displays the answers.
- Consequence: a listen-only display can never show these. Getting them means transmitting requests on the PT-CAN.
## How a tester talks to the DDE on this bus
E60-generation BMWs use one shared diagnostic ID pair with an ECU address in the first payload byte (BMW's extended-addressing variant of ISO 15765):
| Direction | CAN ID | First payload byte | Then | Evidence |
|---|---|---|---|---|
| Tester → any ECU | **`0x6F1`** | target address (**DDE = `0x12`**, EGS = `0x18` `(unverified)`) | `len`, service, data | (source: dieslg8 via [[can-id-candidates]]) |
| ECU → tester | **`0x600 + address`** → DDE **`0x612`**, EGS `0x618` | `0xF1` | `len`, service + `0x40`, data | same |
- **What the user saw (2026-09-21):** `0x612` appears on the tapped bus only while the Launch is connected. That is the DDE *answering* — consistent with the table. The requests should be present in the same capture as `0x6F1`; the user's recollection of "`0x6F2`" is almost certainly `0x6F1`.
> [!warning]
> The [[google-ai-dde7m57-pids]] clipping states the opposite (`0x612` = request, `0x6F2` = response). Two sources (dieslg8's working code on a real M57, and the `0x6xx` = ECU-address convention) against one uncited AI summary: **we go with tester `0x6F1` → DDE `0x612`** until our own capture shows the pair. Nothing is verified until then.
- **Generic EOBD** (`0x7DF` functional / `0x7E0` physical → reply `0x7E8`, mode `01`) is a second, standard route `(unverified)` — early E60s served EOBD over K-line, later ones over CAN. See the next section: it is the cheaper experiment and needs no BMW knowledge.
## Route A — generic OBD-II mode 01 (try this first)
The [[dwr-335d-torque-pids]] source is a worked, gauge-checked set of J1979 mode-01 PIDs from an M57 diesel (a 2009 335d, DDE7.3). They are ECU-agnostic by design, so whichever subset our DDE supports can be read with standard frames and no reverse-engineering:
| Request on `0x7DF` | Reply on `0x7E8` | Value |
|---|---|---|
| `02 01 00` | `06 41 00 A B C D` | bitmap of supported PIDs 01–20 (then `01 20`, `01 40`, `01 60` for the next blocks) |
| `02 01 05` | `03 41 05 A` | coolant A − 40 °C |
| `02 01 0B` | `03 41 0B A` | manifold absolute pressure, A kPa — **clips at 255 kPa**, below full boost |
| `02 01 0C` | `04 41 0C A B` | rpm (A·256+B)/4 |
| `02 01 0F` / `01 46` | `03 41 xx A` | intake / ambient air temp A − 40 °C |
| `02 01 10` | `04 41 10 A B` | MAF (A·256+B)/100 g/s |
| `02 01 33` | `03 41 33 A` | barometric A kPa |
| `02 01 5E` | `04 41 5E A B` | fuel rate (A·256+B)×0.05 L/h |
| `02 01 70` | `0A 41 70 A B C D E …` | boost actual (D·256+E)×0.03125 kPa — 2007+ J1979 diesel PID, **likely absent on an EDC16** `(unverified)` |
| `02 01 73` / `78` / `7A` / `83` | — | exhaust pressure / EGT / DPF ΔP / NOx — same caveat; DPF/SCR rows are meaningless on an M57N anyway |
- **First test = the `01 00` bitmap query.** One frame on `0x7DF` with the engine running (no scan tool attached) answers both open points at once: does this DDE speak EOBD on the PT-CAN at all, and which PIDs does it offer. No reply → the DDE serves EOBD on K-line (or not on this bus) and only Route B remains.
- **Implemented on Controller A (2026-09-21) `(repo)`** as the `diag` console command — see *Firmware: the `diag` probe* below. The whole test is `diag pids` typed on the USB console.
- Route A cannot give fault codes beyond generic mode `03` DTCs (P0xxx) — BMW-specific codes need Route B.
## Route B — BMW proprietary (KWP2000 / UDS on `0x6F1` → `0x612`)
This depends on the DDE variant, which is still open ([[open-questions]] #2, [[bmw-m57n-engine]]):
| DDE | ECU | Typical fitment | Ediabas group | Diagnostic layer |
|---|---|---|---|---|
| DDE6.x | Bosch EDC16C31/C35 | E60/E61 M57N 2003–07 (our likely donor) | `D60M57D0` / `D62M57B0` | KWP2000 on CAN `(unverified)` |
| DDE7.3 | Bosch EDC17CP09 | E90 335d / E70 35d (M57N2, NA market) | `D73N57C0` | KWP2000 on CAN, UDS variant exists `(unverified)` |
- The clipping's identifiers (`22 D1 0C` boost, `22 D1 1E` rail, `22 D1 14` MAF, `22 D1 06` injection) are **`(unverified)` and uncited — do not implement from them.** The Ediabas result names (`STAT_LADEDRUCK_IST_WERT`, `STAT_RAILDRUCK_IST_WERT`, `STAT_LUFTMASSE_WERT`, `STAT_EINSPRITZMENGE_AKTUELL_WERT`, `STAT_KUEHLMITTELTEMPERATUR_WERT`, `STAT_MOTORDREHZAHL_WERT`) are real and are the right search terms.
- The reliable route needs no guessing: **capture while the Launch is on its live-data page** (procedure below). The exact request bytes and the reply layout come for free, for whatever variant is in the car.
## Procedure: capture with the Launch polling
1. Start the board's raw logger (`CANRAW` stream, see [[can-bus-integration]]) with the Launch connected; open the Launch's live-data page for boost or rail pressure; blip the throttle twice.
2. Filter the log to `0x6F1` and `0x612` (also keep `0x7E0`/`0x7E8` and `0x618` if they show up).
3. Pair each `0x6F1` request with the `0x612` reply that follows. In the reply, the byte after the length is the service + `0x40` (`0x62` for a `0x22` request, `0x61` for `0x21`); the identifier is echoed next; the data bytes follow. Match the bytes that move with the throttle to the values the Launch displayed.
4. Open the Launch's ECU identification page and note the variant string — closes [[open-questions]] #2.
5. File the log in `raw/`, write a source page, promote whatever pairs were seen to `(verified)`.
## Firmware: the `diag` probe `(repo, 2026-09-21)`
Controller A now has **one** transmit path onto the PT-CAN: `CANDriver::transmit()`, called only by `src/modules/diag_probe.cpp`. It sends nothing on its own; every frame is typed by a human on the USB console.
| Command | What it sends | What it prints |
|---|---|---|
| `diag pids` | `02 01 00` on `0x7DF`, then `01 20`, `01 40`… as long as the engine ECU advertises the next block | each block's supported PIDs, then a per-responder summary with names (coolant, rpm, MAP, MAF, boost `70`, EGT `78`…) |
| `diag pid <hex>` | one mode-01 request | raw reply bytes + a decoded value for the PIDs in the Route A table |
| `diag vin` | mode 09 PID 02 | the VIN as text — identifies the donor ([[open-questions]] #2) |
| `diag ecu` | mode 09 PID 0A | the ECU name string |
| `diag status` | nothing | request/reply/timeout counters, responders seen, tester-guard timer |
Safety rules baked in: one request in flight at a time; frames are **single-shot** (no retransmit storm if nobody ACKs, the failure is just counted); **refused for 3 s after any foreign tester frame** (`0x7DF`, `0x7E0–7`, `0x6F1`), so it cannot collide with the Launch; only services `01` and `09`, never session control or writes; multi-frame replies are reassembled with a standard flow-control frame (`30 00 00`) to the responder's physical ID. Every transmitted frame is echoed as `CANTX,<ts>,<id>,0,<dlc>,<hex>` next to the `CANRAW` lines, so a saved console log holds both halves of every exchange.
### Test-day procedure (Route A probe)
1. Engine running, **Launch unplugged** (the probe refuses to send for 3 s after any tester frame, and the Launch keeps polling while attached).
2. Laptop on the 5B's USB, console at 115200 with the output saved to a file, e.g. from the repo root:
```
pio device monitor -p COM11 --quiet > diag-<date>.log
```
(or any terminal with logging on). The `CANRAW` stream keeps running; the `diag` lines and `CANTX` echoes land in the same file.
3. Type `diag pids`. Read the summary line — four possible outcomes:
- *"NOT ACKED - no other node saw it"* → wiring or bus problem, **not** an ECU answer. Check the CAN terminal block, the 120 Ω switch (off), and that `CANRAW` lines are still flowing.
- *"ACKED but NO REPLY on 0x7E8-0x7EF"* → the DDE does not answer generic OBD-II on this bus (EOBD on K-line, or not at all). Route B only.
- *Reply from `0x7E8`* listing PIDs → Route A works. Continue with step 4.
- *Replies from `0x7E8` and `0x7E9`* → the EGS also answers generic OBD; note which PIDs it claims.
4. If Route A works: `diag pid 0C` (rpm — proves a live read), `diag pid 05` (coolant — cross-check against the `0x1D0` value on the Driveline screen), `diag pid 70` (does the boost PID exist on this ECU?), `diag pid 0B` (does 1-byte MAP clip?), then `diag vin` and `diag ecu`.
5. `diag status` once at the end (counters, tester guard), then stop the monitor.
6. Copy the log into `raw/`, write a `sources/` page with the supported-PID list and the VIN, update this page (Route A verified / refuted) and [[open-questions]] #2 and #7.
## Beyond the probe `(repo)`
- A continuous poller (Route A or B) would reuse the same transmit path with a fixed request list: one request per ≥100 ms, one identifier at a time, only while no scan tool is connected, never a session-control or write service. Still a design decision: a request storm or a malformed frame can disturb the DDE/EGS, and diagnostic sessions can change what an ECU broadcasts.
- Protocol v2 dropped the `fault_codes` field in favour of the alert bitmap ([[dual-controller-architecture]]); polled values would need new DATA fields.
- The same request path would also be the only way to read DTCs (service `0x18`/`0x19`, variant-dependent) → [[open-questions]] #7.
## Related
[[can-id-candidates]] · [[can-bus-integration]] · [[bmw-m57n-engine]] · [[google-ai-dde7m57-pids]] · [[listen-and-send-pid-arduino]] · [[open-questions]]
+7 -4
View File
@@ -1,7 +1,7 @@
---
type: synthesis
tags: [meta, todo]
updated: 2026-07-17
updated: 2026-09-21
---
# Open Questions
@@ -24,7 +24,7 @@ The research frontier. Answering any of these should trigger updates across the
## Project context
2. **Exact donor model year / DDE version and EGS variant?** *Partly answered 2026-07-17.* The gearbox is a **ZF 6HP26X** (user-confirmed) — the X is the xDrive output variant, which means the donor is an **E60/E61, not an E65**: the 7-series never took M57N + xDrive. Remaining: model year and DDE version. → [[bmw-m57n-engine]]
2. **Exact donor model year / DDE version and EGS variant?** *Partly answered 2026-07-17.* The gearbox is a **ZF 6HP26X** (user-confirmed) — the X is the xDrive output variant, which means the donor is an **E60/E61, not an E65**: the 7-series never took M57N + xDrive. Remaining: model year and DDE version. **Cheap to close (2026-09-21):** the Launch scanner's ECU-identification page (or any INPA "control unit found" string) names the variant — `D60M57D0`/`D62M57B0` = DDE6 (EDC16), `D73N57C0` = DDE7.3 (EDC17). → [[bmw-m57n-engine]], [[obd-diagnostic-polling]]
3. **Standalone harness or full donor loom? Which BMW modules were retained?** Affects which modules broadcast on the swap's bus. → [[nissan-patrol-swap]]
4. **Which Patrol generation, and how is the display being mounted/powered?** → [[nissan-patrol-swap]]
@@ -32,7 +32,7 @@ The research frontier. Answering any of these should trigger updates across the
5. **Operating temperature 0–65 °C** (source: waveshare-wiki) — outside automotive norms at both ends (sub-zero winter cabins, sun-baked dashboards). Is the mounting location temperature-controlled enough? Any mitigation (mounting away from vents/sun, accepting reduced lifespan)?
6. **Transient protection on the 7–36 V input**: the board takes vehicle 12 V directly, but ISO 7637 load-dump spikes can exceed 36 V `(unverified)`. Consider an upstream TVS diode / automotive-rated buck. Also: ignition-switched vs constant power (the isolated digital input could sense ignition).
7. **Fault codes**: the UART packet reserves a field for fault codes — DDE fault codes are read via diagnostic protocols (KWP2000/UDS over K-line or CAN), not passively broadcast. Is passive reading even possible? `(unverified)` — **update 2026-07-17**: the same barrier explains why the Launch scanner shows boost/gearbox data our dump lacks (it polls; nothing broadcasts them). A capture *while the Launch is connected* would record both request and reply frames, handing us the exact bytes to replay. → [[obd-diagnostic-polling]]
7. **Fault codes**: the UART packet reserves a field for fault codes — DDE fault codes are read via diagnostic protocols (KWP2000/UDS over K-line or CAN), not passively broadcast. Is passive reading even possible? `(unverified)` — **update 2026-07-17**: the same barrier explains why the Launch scanner shows boost/gearbox data our dump lacks (it polls; nothing broadcasts them). A capture *while the Launch is connected* would record both request and reply frames, handing us the exact bytes to replay. **Update 2026-09-21**: the user has seen `0x612` appear on the tapped bus while the Launch is connected — that is the DDE *replying* (`0x600` + DDE address `0x12`); the requests go out on `0x6F1`. Diagnostic traffic therefore reaches our tap, so the capture will contain both halves. Page written with the capture procedure and the firmware implications (polling = transmitting on the bus). **Cheapest first experiment** (from [[dwr-335d-torque-pids]]): one generic `01 00` supported-PID query on `0x7DF` — tells whether this DDE answers EOBD on the PT-CAN and which mode-01 PIDs it has, with zero BMW-specific knowledge. → [[obd-diagnostic-polling]]
## Answered
@@ -61,4 +61,7 @@ The research frontier. Answering any of these should trigger updates across the
- ~~A real candump log from the engine running~~ ✅ → [[can-capture-2026-07-15]] (engine confirmed running, 2026-07-17)
- **`6HP26.pdf`** — sitting in the E65 repo's `docs/`. The ZF 6HP26 manual, very likely our exact gearbox: gear ratios would let us convert output-shaft rpm → road speed and self-check the D3/D4 scaling. → [[driveline-speed-signals]]
- **`can_message_list.txt`** (same repo) — full ID → name → sending-module map, 0x00–0xFFF. Not yet mined; useful if the project ever wants non-powertrain data
- A capture taken **while the Launch scanner is polling** — would reveal the request/response byte sequences for boost, gearbox temp and DTCs → [[obd-diagnostic-polling]]
- A capture taken **while the Launch scanner is polling** — would reveal the request/response byte sequences for boost, gearbox temp and DTCs. Step-by-step procedure now on [[obd-diagnostic-polling]]; also read the Launch's ECU-identification page during the same session (closes #2)
- ~~Web search on DDE7 M57 PIDs~~ ✅ clipped → [[google-ai-dde7m57-pids]] — uncited AI summary; identifiers `(unverified)`, addressing claim contradicted
- ~~A worked generic-PID set for an M57 diesel~~ ✅ ingested → [[dwr-335d-torque-pids]] (2009 335d, DDE7.3; J1979 mode-01 scalings gauge-checked by the author)
- DWR's **Testo parameter list** (e90post "Testo" thread, post 175, German→English names of the DDE's non-standard values) — the pointer for Route B identifiers if our own Launch capture is not enough
+19
View File
@@ -0,0 +1,19 @@
Name,ShortName,ModeAndPID,Equation,Min Value,Max Value,Units,Header
0-0 BMW 335d Ambient Air Temperature,AAT,146,((A-40)*1.8)+32,0,50,?F,Auto
0-0 BMW 335d Intake Air Temperature,IAT,10F,((A-40)*1.8)+32,0,100,?F,Auto
0-0 BMW 335d Charged Air Cooler Temperature,CACT,177,((B-40)*1.8)+32,0,100,?F,Auto
0-0 BMW 335d Lambda A/F,AFR,124,(((A*256)+B)*000031,0.5,1.5,Lambda,Auto
0-0 BMW 335d Air Mass,Air Mass ,110,((((A*256)+B)/100)*0.132276),0,45,lb/min,Auto
0-0 BMW 335d Ambient Air Pressure,Baro,133,A*14.5/100,13,15,psi,Auto
0-0 BMW 335d Intake Boost Pressure,Boost,170,(((((D*256)+E)*0.3125)-1000)/1000)*14.5,-2,35,psi,Auto
0-0 BMW 335d Exhaust Manifold Pressure,Exh Press,173,(((((B*256)+C)/10)-1000)/1000)*14.5,0,50,psi,Auto
0-0 BMW 335d DPF Pressure,DPF Press,17A,((B*256)+C)*0.00145,0,5,psi,Auto
0-0 BMW 335d Drive Pressure,Drive Press,,(VAL{0-0 BMW 335d Exhaust Manifold Pressure})-(VAL{0-0 BMW 335d DPF Pressure}),0,50,psi,Auto
0-0 BMW 335d H2O/Meth Target,H2O/Meth Target,015E,((A*256)+B)*25/60,0,2000,cc /min,Auto
0-0 BMW 335d Fuel Flow,Fuel Flow,015E,((A*256)+B)*0.0938,0,160,lb/hr,Auto
0-0 BMW 335d Exhaust Recirculation Temperature,Pre CACT,16B,((C-40)*1.8)+32,0,300,?F,Auto
0-0 BMW 335d Exhaust Temperature Pre DOC,EGT Pre DOC,178,(((((B*256)+C)/10)-40)*1.8)+32,0,1400,?F,Auto
0-0 BMW 335d Exhaust Temperature Post DOC,EGT Pre DPF,178,(((((D*256)+E)/10)-40)*1.8)+33,0,1400,?F,Auto
0-0 BMW 335d Exhaust Temperature Pre SCR,EGT Pre SCR,178,(((((F*256)+G)/10)-40)*1.8)+32,0,1400,?F,Auto
0-0 BMW 335d NOX Conc Pre SCR,NOX Pre SCR,183,(((B*256)+C)*0.032044)-100,0,1000,ppm,Auto
0-0 BMW 335d NOX Conc Post SCR,NOX Post SCR,183,(((D*256)+E)*0.032044)-100,0,1000,ppm,Auto
1 Name ShortName ModeAndPID Equation Min Value Max Value Units Header
2 0-0 BMW 335d Ambient Air Temperature AAT 146 ((A-40)*1.8)+32 0 50 ?F Auto
3 0-0 BMW 335d Intake Air Temperature IAT 10F ((A-40)*1.8)+32 0 100 ?F Auto
4 0-0 BMW 335d Charged Air Cooler Temperature CACT 177 ((B-40)*1.8)+32 0 100 ?F Auto
5 0-0 BMW 335d Lambda A/F AFR 124 (((A*256)+B)*000031 0.5 1.5 Lambda Auto
6 0-0 BMW 335d Air Mass Air Mass 110 ((((A*256)+B)/100)*0.132276) 0 45 lb/min Auto
7 0-0 BMW 335d Ambient Air Pressure Baro 133 A*14.5/100 13 15 psi Auto
8 0-0 BMW 335d Intake Boost Pressure Boost 170 (((((D*256)+E)*0.3125)-1000)/1000)*14.5 -2 35 psi Auto
9 0-0 BMW 335d Exhaust Manifold Pressure Exh Press 173 (((((B*256)+C)/10)-1000)/1000)*14.5 0 50 psi Auto
10 0-0 BMW 335d DPF Pressure DPF Press 17A ((B*256)+C)*0.00145 0 5 psi Auto
11 0-0 BMW 335d Drive Pressure Drive Press (VAL{0-0 BMW 335d Exhaust Manifold Pressure})-(VAL{0-0 BMW 335d DPF Pressure}) 0 50 psi Auto
12 0-0 BMW 335d H2O/Meth Target H2O/Meth Target 015E ((A*256)+B)*25/60 0 2000 cc /min Auto
13 0-0 BMW 335d Fuel Flow Fuel Flow 015E ((A*256)+B)*0.0938 0 160 lb/hr Auto
14 0-0 BMW 335d Exhaust Recirculation Temperature Pre CACT 16B ((C-40)*1.8)+32 0 300 ?F Auto
15 0-0 BMW 335d Exhaust Temperature Pre DOC EGT Pre DOC 178 (((((B*256)+C)/10)-40)*1.8)+32 0 1400 ?F Auto
16 0-0 BMW 335d Exhaust Temperature Post DOC EGT Pre DPF 178 (((((D*256)+E)/10)-40)*1.8)+33 0 1400 ?F Auto
17 0-0 BMW 335d Exhaust Temperature Pre SCR EGT Pre SCR 178 (((((F*256)+G)/10)-40)*1.8)+32 0 1400 ?F Auto
18 0-0 BMW 335d NOX Conc Pre SCR NOX Pre SCR 183 (((B*256)+C)*0.032044)-100 0 1000 ppm Auto
19 0-0 BMW 335d NOX Conc Post SCR NOX Post SCR 183 (((D*256)+E)*0.032044)-100 0 1000 ppm Auto
+64
View File
@@ -0,0 +1,64 @@
---
type: source
tags: [obd, j1979, pid, diesel, m57, dde7, polling, torque-app]
updated: 2026-09-21
---
# DWR — "Extended BMW 335d PIDs for Torque" (e90post/6post thread + CSV)
Raw: `raw/BMW 335d.csv` (DWR's attachment, 2017 revision) and `Clippings/Extended BMW 335d PIDs for Torque.md` (page 1 of the thread, posts 1–22, clipped 2026-09-21). Thread: <https://6post.com/forums/showthread.php?p=17790638> (e90post t=1118429, 238 posts, 2015–). Author DWR, 2009 335d (E90, **M57N2 on DDE7.3 / EDC17CP09**, US market), a serious logger (Testo user).
## Summary
A custom-PID file for the Torque Pro Android app that fixes the app's wrong scalings for a diesel and adds the parameters DWR wanted to log: boost, exhaust manifold pressure, air mass, fuel flow, three exhaust temperatures, DPF pressure, NOx, intake/charge/ambient temperatures. **All of them are generic SAE J1979 mode `01` PIDs** — DWR says so himself in post 21 ("These are generic OBDII PIDs… The mode is always 1, the next 2 characters are the PID, A,B,C,D are the bytes") and points people who want *non-standard* values to Testo instead. Header `Auto` = Torque's default functional request (`0x7DF`, reply on `0x7E8`). Nothing here is BMW-proprietary; nothing here is a passively broadcast frame.
Two versions exist and differ:
| | Post #2 (2015-04-22) | `raw/BMW 335d.csv` (post #1 attachment, edited 2017-11-20) |
|---|---|---|
| Boost scaling (PID 70 bytes D–E) | ×0.296 (empirical, "one of two correction factors") | ×**0.3125** — the J1979 value (0.03125 kPa/bit = 0.3125 hPa/bit) |
| Lambda / AFR (PID 24) | AFR ×0.00044225 | Lambda ×0.0000305 (written as `000031`, a typo for `0.0000305`) |
| Fuel flow (PID 5E) | ×5.64 lb/hr — wrong | ×**0.0938** lb/hr — correct (0.05 L/h/bit × 0.85 kg/L × 2.2046) |
| Extra rows | — | Baro (33), DPF pressure (7A), drive pressure (derived), EGR temp (6B), NOx pre/post SCR (83), H2O/meth target (derived from 5E) |
Use the CSV; the 2017 revision is the corrected one. One residual typo: EGT post-DOC has `+33` where the other rows have `+32`.
## The PID table (source: `raw/BMW 335d.csv`, decoded)
Mode `01` throughout; letters are reply data bytes after the PID echo, J1979 order. Scalings below are DWR's, converted to SI where his were imperial.
| PID | J1979 name | Bytes used | Value | Notes |
|---|---|---|---|---|
| `05` | Coolant temp | A | A − 40 °C | not in his file (Torque has it built in) — listed for completeness |
| `0B` | Intake manifold absolute pressure | A | A kPa | **1 byte, caps at 255 kPa abs** — a boosting M57N exceeds that; the reason DWR used PID 70 instead |
| `0C` | Engine rpm | A,B | (A·256+B)/4 | built in |
| `0F` | Intake air temp (at MAF) | A | A − 40 °C | in file |
| `10` | MAF | A,B | (A·256+B)/100 g/s | in file (×0.132276 → lb/min) |
| `24` | O2 sensor 1 lambda | A,B | (A·256+B)/32768 λ | in file; lambda for a diesel, not AFR |
| `33` | Barometric pressure | A | A kPa | in file |
| `46` | Ambient air temp | A | A − 40 °C | in file |
| `5E` | Engine fuel rate | A,B | (A·256+B)×0.05 L/h | in file (→ lb/hr ×0.0938) |
| `6B` | EGR temperature | C | C − 40 °C | in file ("exhaust recirculation temperature") |
| `70` | Boost pressure control | D,E | (D·256+E)×0.03125 kPa **actual** (B,C = commanded) | in file: (hPa − 1000)/1000×14.5 → psi gauge. Matches an analog gauge within a few psi (post 5/6; sensor location differs) |
| `73` | Exhaust pressure bank 1 | B,C | (B·256+C)×0.01 kPa | in file |
| `77` | Charge air cooler temp | B | B − 40 °C | in file |
| `78` | EGT bank 1 | B,C / D,E / F,G | (n)/10 − 40 °C, sensors 1–3 | in file: pre-DOC, post-DOC (pre-DPF), pre-SCR |
| `7A` | DPF differential pressure | B,C | (B·256+C)×0.01 kPa | in file |
| `83` | NOx sensor | B,C / D,E | ×0.032044 − 100 ppm | in file; scaling looks empirical `(unverified)` |
## What this means for our project
- **These PIDs are ECU-agnostic by design** — if the DDE in the Patrol answers generic OBD-II over CAN at all, the basic ones (`05`, `0B`, `0C`, `0F`, `10`, `33`, `46`) need no BMW knowledge. That makes the mode-01 route the **cheapest first experiment** for polled values, ahead of any BMW `0x6F1`/`0x612` reverse-engineering. → [[obd-diagnostic-polling]]
- **But the source car is not ours.** A 2009 US 335d (DDE7.3, EDC17, full US OBD-II, DPF/SCR) supports the whole list. Our donor is an E60/E61 M57N on a DDE6/EDC16 `(unverified)`: (a) the diesel-specific PIDs `70`/`73`/`78`/`7A`/`83` were added to J1979 in 2007+ revisions and an EDC16 almost certainly lacks them; (b) an early E60 served EOBD over **K-line**, not CAN — whether our DDE answers `0x7DF` on the PT-CAN is an open test; (c) with no DPF/SCR on the M57N several rows are meaningless anyway.
- **The one query that answers all of it**: `01 00` (then `01 20`, `01 40`, `01 60`) returns the supported-PID bitmaps. One round trip on `0x7DF` tells us whether mode 01 works on this bus and exactly which PIDs the DDE offers. Procedure added to [[obd-diagnostic-polling]].
- Boost via PID `0B` clips at 255 kPa absolute; if `70` is unsupported, real boost needs the BMW route.
- DWR's Testo-parameter list (his post 175 in the "Testo" thread, German→English) is the pointer for non-standard DDE values — not clipped yet; sourcing wishlist.
## Relevance to open questions
- **#7** (non-broadcast values): adds the generic route as a concrete, low-risk first test with expected byte layouts. Does not answer whether our DDE supports it.
- **#2** (DDE variant): indirectly — which PIDs the DDE reports supporting is itself a fingerprint of the ECU generation.
## Related
[[obd-diagnostic-polling]] · [[google-ai-dde7m57-pids]] · [[listen-and-send-pid-arduino]] · [[can-id-candidates]] · [[open-questions]]
+39
View File
@@ -0,0 +1,39 @@
---
type: source
tags: [dde, diagnostics, kwp2000, uds, obd, polling, unverified]
updated: 2026-09-21
---
# Google AI Mode conversation: "dde7m57 pids" (web clipping)
Raw: `Clippings/dde7m57 pids - Google Search.md` (Obsidian Web Clipper, 2026-09-21). A three-turn Google AI Mode conversation the user had while asking (1) what PIDs exist for a DDE7 M57, (2) why boost / MAF / rail pressure / injection quantity never show up on the sniffer although rpm and coolant do, and (3) what the `0x612` (and, the user believes, `0x6F2`) frames are that appear when the Launch scanner is plugged in.
> [!warning]
> **Everything in this clipping is `(unverified)`.** It is a generative summary with no primary citations, and its central addressing claim contradicts a source we already hold (see claim 5). It is filed because it frames the polling question well and because the user's own observation inside it (0x612 appears with the Launch connected) is real evidence.
## Summary
BMW does not broadcast internal engine parameters that no other module needs; a tester obtains them by sending diagnostic requests to the DDE and reading its replies. The clipping proposes two routes (generic OBD-II mode 01, or BMW-proprietary ReadDataByIdentifier) and a set of identifiers, and explains the `dde73m57` INPA script family.
## Key claims, with our assessment
1. **`dde73m57` = M57 on a Bosch DDE7.3 (EDC17CP09)**, the North-American E90 335d / E70 X5 35d pairing; Ediabas group `D73N57C0.prg`, versus `D60M57D0` / `D62M57B0` for the older DDE6 on European cars. `(unverified)` — plausible and consistent with general knowledge. **Note the implication for us:** our donor is an E60/E61 with a 6HP26X (see [[open-questions]] #2). A 2003–07 E60 M57N carries a DDE6-generation (EDC16) ECU, not DDE7.3; the search term the user used may not match the engine in the car. The Launch's ECU-identification page settles it.
2. **Boost, MAF, rail pressure, injection quantity are not broadcast — only polled.** Agrees with what this wiki verified by absence ([[can-id-candidates]]: `AIP_ENG` is barometric; nothing else resembles boost on the live bus).
3. **Generic OBD-II over CAN**: request on `0x7E0`, reply on `0x7E8`; mode 01 PIDs `0x0B` (MAP/boost), `0x10` (MAF), `0x22`/`0x23` (rail pressure). `(unverified)` — standard J1979, but whether *this* DDE answers EOBD on CAN rather than on K-line depends on the model year (early E60s did EOBD over K-line). Cheap to test with one request.
4. **BMW-proprietary route**: service `0x22` ReadDataByIdentifier with two-byte identifiers `D1 0C` (boost actual), `D1 1E` (rail pressure actual), `D1 14` (MAF), `D1 06` (injection quantity), matching Ediabas names `STAT_LADEDRUCK_IST_WERT`, `STAT_RAILDRUCK_IST_WERT`, `STAT_LUFTMASSE_WERT`, `STAT_EINSPRITZMENGE_AKTUELL_WERT`. `(unverified)` — **no citation at all; treat the numeric identifiers as invented until a capture shows them.** The Ediabas result names are real and useful as search terms.
5. **`0x612` is the tester request ID and `0x6F2` the DDE response ID.** ⚠ **Contradicts [[can-id-candidates]]** (dieslg8, working code on a real M57: tester sends on **`0x6F1`**, DDE replies on **`0x612`**) and the BMW E-series addressing convention (tester `0x6F1`, first byte = target ECU address, DDE = `0x12`; the ECU replies on `0x600 + address` = `0x612`, first byte `0xF1`). The user seeing `0x612` is exactly what the DDE *answering* looks like. "`0x6F2`" is most likely a misremembered `0x6F1`. Full reasoning → [[obd-diagnostic-polling]].
6. The "Requested control unit D60M57D0 / D62M57B0 not found, found D73N57C0" INPA error and the `dde73kwp.ipo` / `dde7uds.ipo` fix. Not relevant to our firmware, but it does tell us the DDE7.3 speaks **KWP2000 on CAN** (`kwp` script), with UDS as a separate variant — so "UDS service 0x22" in claim 4 may be the wrong protocol layer for a DDE6.
## What the clipping is actually good for
- The Ediabas result names for the values the user wants (boost, rail, MAF, injection) — search terms for real `.prg`-derived tables.
- Its sniffing tip is the same plan already on our wishlist: **log while the Launch shows its live-data page**, filter to the request/response pair, and the bytes fall out. Procedure now written up in [[obd-diagnostic-polling]].
## Relevance to open questions
- **#2 (DDE variant / model year)**: the Launch's ECU identification (or any INPA "control unit found" string) names the variant outright — `D60M57D0`/`D62M57B0` (DDE6) vs `D73N57C0` (DDE7.3). One screen on the scanner closes a question that has been open since July.
- **#7 (fault codes / non-broadcast values)**: the user's observation of `0x612` during a Launch session confirms diagnostic traffic reaches the tapped bus, so a capture there will contain both halves of the exchange. → [[obd-diagnostic-polling]]
## Related
[[obd-diagnostic-polling]] · [[can-id-candidates]] · [[bmw-m57n-engine]] · [[open-questions]] · [[listen-and-send-pid-arduino]]