# K-Diagnostics Remote VCI Bridge BUILD341 — Ubuntu server + Windows x86 client

## Fixed SDconnect network targets

- **IPLAN:** `172.29.127.122`
- **IPWIFI:** `192.168.2.199`
- Priority: LAN first, Wi-Fi fallback.

The Windows VCI client remains a native **32-bit x86** application. It installs and runs on both 32-bit Windows and 64-bit Windows through WOW64. It scans only the 32-bit J2534 04.04 and 05.00 registry views and excludes the K-Diagnostics remote proxy DLL from the physical-VCI list.

When the selected registry provider is recognized as SDconnect/Caesar/Xentry/Mercedes/Actia, the client does the following before loading its J2534 DLL:

1. Probes `172.29.127.122` and `192.168.2.199`.
2. Selects LAN when reachable; otherwise Wi-Fi; otherwise retains LAN as the configured first target.
3. Exports `IPLAN`, `IPWIFI`, `SDCONNECT_IPLAN`, `SDCONNECT_IPWIFI`, and preferred-target process variables.
4. Saves the targets under `HKCU\Software\K-Diagnostics\SDconnect`.
5. Writes `%ProgramData%\K-Diagnostics\SDconnect\KDX_SDconnect_Network.ini`.
6. Finds writable `PDUAPI_I+ME_ACTIA_XS.ini` files near the selected provider and common Mercedes-Benz installation paths, then writes:

```ini
[SETTING]
TargetIP1=172.29.127.122,SDconnect
TargetIP2=192.168.2.199,SDconnect
```

A missing ICMP reply is logged as a warning but does not block the remote bridge, because some SDconnect/firewall configurations suppress ping while the provider can still connect.

## Install order

### Ubuntu server

```bash
sudo ./ubuntu/install_server.sh
sudo kdx-vci-user create-user USERNAME STATION_ID
```

Add the supplied Nginx snippet to the existing HTTPS virtual host and reload Nginx.

### Ubuntu SDx/Wine side

```bash
./ubuntu/install_wine_proxy.sh
```

This installs/registers the 32-bit `KDXRemoteJ2534.dll` in the selected 32-bit Wine prefix.

### Workshop Windows PC

Run as administrator:

```bat
windows\INSTALL_WINDOWS_CLIENT_X86.bat
```

Then open **K-Diagnostics Remote VCI Client**, enter the HTTPS login, choose the installed 32-bit SDconnect J2534 provider found by **Scan Registry**, and connect.

## Network requirement

The workshop PC must have a usable route to at least one SDconnect address. For direct LAN, its Ethernet adapter must be configured on the compatible `172.29.127.x` subnet. For Wi-Fi, it must be joined to the network that reaches `192.168.2.199`.
