Setting up a VPN to connect a car
Posted: Sun May 08, 2022 10:34 pm
I'm working on an open project to remotely connect a diagnostic tool to a car, through OpenVPN.
The car is designed to accept Ethernet connections through an OBD to Ethernet adapter.
The connection is supposed to be established according to the APIPA protocol (169.254.x.x)
So I made an OpenVPN setup in bridge mode within 169.254.x.x address range, with the Ethernet interface bridged with the OpenVPN tap.
The laptop attached to the car runs an OpenVPN server, with the Ethernet interface attached to the car and a wifi connection to go on internet.
The other end is run over a laptop with the OpenVPN client and the diagnostic tool
When both ends are connected, after about 15-30 seconds, the remote end receives the DoIP broadcast messages sent by the vehicle and the diagnostic session can start.
So far, so good.
Unfortunately, there is an issue when trying to put the car in programming mode.
To receive the programming codes, the cars needs to reboot, closing the connection channel.
When coming back in programming mode, it needs to establish the communication with the diagnostic tool within a timeout (about 20 s), otherwise it reboots again and comes back to normal mode.
And here is my issue: the OpenVPN setup doesn't always allow to promptly broadcast the Ethernet packets to the other end of the tunnel so that the diagnostic tool can manage the programming phase, and the car reboots back in normal mode.
Here is the OpenVPN setup I'm talking about
https://www.swedespeed.com/threads/remote-vida.654016/
I would be grateful to anybody that could help me to speedup the car reconnection phase
The car is designed to accept Ethernet connections through an OBD to Ethernet adapter.
The connection is supposed to be established according to the APIPA protocol (169.254.x.x)
So I made an OpenVPN setup in bridge mode within 169.254.x.x address range, with the Ethernet interface bridged with the OpenVPN tap.
The laptop attached to the car runs an OpenVPN server, with the Ethernet interface attached to the car and a wifi connection to go on internet.
The other end is run over a laptop with the OpenVPN client and the diagnostic tool
When both ends are connected, after about 15-30 seconds, the remote end receives the DoIP broadcast messages sent by the vehicle and the diagnostic session can start.
So far, so good.
Unfortunately, there is an issue when trying to put the car in programming mode.
To receive the programming codes, the cars needs to reboot, closing the connection channel.
When coming back in programming mode, it needs to establish the communication with the diagnostic tool within a timeout (about 20 s), otherwise it reboots again and comes back to normal mode.
And here is my issue: the OpenVPN setup doesn't always allow to promptly broadcast the Ethernet packets to the other end of the tunnel so that the diagnostic tool can manage the programming phase, and the car reboots back in normal mode.
Here is the OpenVPN setup I'm talking about
https://www.swedespeed.com/threads/remote-vida.654016/
I would be grateful to anybody that could help me to speedup the car reconnection phase