Page 1 of 1

Setting up a VPN to connect a car

Posted: Sun May 08, 2022 10:34 pm
by wiseminosse
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

Re: Setting up a VPN to connect a car

Posted: Mon May 09, 2022 12:05 am
by TinCanTech
wiseminosse wrote:
Sun May 08, 2022 10:34 pm
To receive the programming codes, the cars needs to reboot, closing the connection channel.
What are the chances that Openvpn has --wait-for-car-to-reboot mode ?

Re: Setting up a VPN to connect a car

Posted: Mon May 09, 2022 5:49 am
by wiseminosse
It could be promising :-)

I'll try to better elaborate to be more clear
When the car closes the Ethernet connection, the ethernet interface goes down and, to be up again, it needs to repeat the APIPA procedure .
When directly connected to tool, the entire setup procedure takes 5-10 seconds, when bridged with the OpenVPN tap interface, it could exceed 20-30 seconds before the remote end can detect the car.
This gap is my issue

Re: Setting up a VPN to connect a car

Posted: Sat May 14, 2022 12:55 pm
by wiseminosse
This is the setup I'm using.
tap-bridge is a Windows bridge that joins eth and tap
Address is allocated on apipa range so that the car car be seen
The car is visible to the remote end after 30 seconds after being connected
My budget is within 20 seconds

What can I change to speed up the discovery on the remote end?

Server on car side

proto udp
port 56421
dev tap
dev-node tap-bridge
keepalive 10 120
server-bridge 169.254.15.1 255.255.0.0 169.254.15.2 169.254.15.10
persist-tun
persist-local-ip
persist-remote-ip
verb 4
status openvpn-status.log


Re: Setting up a VPN to connect a car

Posted: Sat May 14, 2022 2:39 pm
by TinCanTech
You have a TAP Bridge in your cAr ?!??!?

Did you read the howto, yet .... ?

Re: Setting up a VPN to connect a car

Posted: Sun May 15, 2022 2:00 pm
by wiseminosse
TinCanTech wrote:
Sat May 14, 2022 2:39 pm
You have a TAP Bridge in your cAr ?!??!?

Did you read the howto, yet .... ?
Did you read my first post, yet... ?

Re: Setting up a VPN to connect a car

Posted: Sun May 15, 2022 3:09 pm
by TinCanTech
wiseminosse wrote:
Sun May 15, 2022 2:00 pm
Did you read my first post, yet... ?
It says nothing about the official OpenVPN Howto ..

Re: Setting up a VPN to connect a car

Posted: Mon May 16, 2022 8:27 pm
by wiseminosse
TinCanTech wrote:
Sun May 15, 2022 3:09 pm
It says nothing about the official OpenVPN Howto ..
It explains why I'm using a vpn in the car...

Re: Setting up a VPN to connect a car

Posted: Mon May 16, 2022 9:57 pm
by TinCanTech
If the laptop and car are connected via ethernet, why do you need a VPN ?