V2N connect to a car over internet

Hi there
I have searched this forum and not found an answer. I have a car with obd2 connection and a special reader device. Usually I connect the device directly to the obd2 port.
Now I would like to use 2 arduino uno r4s. One connected via an L9637 to a db9/obd2 cable to the car and the other arduino with the same setup to my device. The 2 arduinos connect to eachother via husarnet Peer2peer and transparent pass through devices.
In effect the 2 arduinos are a virtual obd2 cable and I can connect to any car in the world.
Any pointers as to how I can set this up would be welcome.

In your description, where does the special reader device fit in?

How about using a OBD2 bluetooth adapter and your smartphone?

If not appropriate OBD2 is just a CAN-BUS signal. Using two microcontrollers to send the data wireless is way too much effort. Using a rather excotic Arduino R4 is a bad choice.

I would use two serial transparent transmitters that are able to transmit the baudrate of the OBD2-interface.

Do you mean at any place in the world?
This would require a WLAN connection on both sides with high bandwidth.

Thanks for the quick reply.
Ok. I will try and explain again.
The car diagnostic device I use to connect to my car in my garage uses k-line and L-line and ground only at 10400 baud rate. For diagnostics no CAN Bus connection is required.
I wish to offer customers the option to connect to this special diagnostic from their home wherever it is in the world. I send them by post a obd2 to db9 cable, an arduino r4 with L9637 tx/rx to K-line converter to db9 socket an a power supply cable to lighter 12V.
The arduino r4 is setup fot wiki peer2peer husarnet.
My arduino r4 is connected to the diagnostic device in my office at home with same setup as the customer. The husarnet whitelist is setup that the customer's arduino only 'sees' my arduino.
I switch on my diagnostic device and send k-line packets of data via the obd2 cable to my arduino. My arduino converts the data to tx and through wifi peer2peer connection to the customer's arduino. The rx signal is recoded to k-line and sent to the car. The car responds and sends data back to my diagnostic tool as described above. (bidirectional data).
I will record all data on the diagnostic tool via vga/hdmi gamer recorder and send it to him via file sharing.
Any help required what I need to look out for when programming arduinos.

why does it have to be an arduino R4?
An Arduino R4 is a rather clumsy conglomerat of a not very popular microcontroller combined with an ESP32 chip.

Using 2 microcontrollers causes three tasks:

task 1: program on the microcontroller 1
task 2: program on the microcontroller 2
task 3: program communiaction between µC 1 and µC 2

Look out for a widely used microcontroller with good library-support.
As you want WiFi use a ESP32 stand alone

A single ESP32 will do the complete job stand alone and can be programmed just the same as any other arduino.

Thanks stefan for the reply. Will look at esp32. It has tx/rx software and hardwareserial I assume then?

Appreciate the links but still looking for the following setup
car <--L9637 -- UART -- ESP32 -(husarnet)- ESP32 -- UART -- L9637 --> diagnostic tool.

This is in effect a virtual cable from car to diagnostic tool. Bilateral communication required.
Any pointers to a similar project please.

You have chosen words that sound really demanding. Even if you used the word "please"
There are some rather rare cases where a AI can give quick answers

I asked deepseek this

Hi deepseek
I have a car with obd2 connection and a special reader device. Usually I connect the device directly to the obd2 port.
Now I would like to use 2 ESP32. One connected via an L9637 to a db9/obd2 cable to the car and the other arduino with the same setup to my device. The 2 ESP32 connect to eachother via husarnet Peer2peer and transparent pass through devices.
In effect the 2 ESP32 are a virtual obd2 cable and I can connect to any car in the world.
deepseek can you output links to similar projects?

and got this answer

1. Husarnet + ESP32 P2P Communication

  • Husarnet ESP32 Example:
    Husarnet provides an ESP32-compatible library for peer-to-peer communication. This example shows how to create a VPN tunnel between ESP32 devices:
    Husarnet ESP32 Example
  • Transparent Serial Passthrough:
    Combine Husarnet with a UART-to-TCP bridge to relay OBD2 data. Example code for ESP32:
    ESP32 UART-to-TCP Bridge

2. OBD2/CAN Bus with ESP32

  • ESP32 CAN Bus Library:
    Use the ACAN_ESP32 library to handle CAN bus communication (OBD2 often uses CAN):
    ACAN_ESP32 Library
  • L9637 Integration:
    The L9637 is an automotive transceiver. Pair it with the ESP32’s CAN controller:
    ESP32 CAN Bus Guide

3. Similar Projects

  • Remote OBD2 over IP:
    A project using ESP32 to send OBD2 data over Wi-Fi (adaptable for Husarnet):
    GitHub: ESP32-OBD2-Over-WiFi
  • CAN Bus to TCP Bridge:
    Example of bridging CAN bus data to TCP/IP (useful for Husarnet integration):
    ESP32-CAN-TCP-Bridge

4. Hardware Setup

  • L9637 + DB9/OBD2 Wiring:
    Use schematics from automotive CAN bus projects. Example:
    STM32 + L9637 Circuit (see application notes).
  • ESP32 Dev Boards:
    Use ESP32 boards with built-in CAN (e.g., ESP32-S2/S3) or add a CAN transceiver (e.g., SN65HVD230).

5. Troubleshooting

  • OBD2 Protocol Decoding:
    Use tools like python-OBD or SavvyCAN to test communication:
    python-OBD Library
  • Husarnet Latency:
    Ensure low-latency routing by testing Husarnet’s P2P setup:
    Husarnet Documentation

Key Steps:

  1. Hardware Setup:
  • Connect L9637 to ESP32’s CAN pins (TX/RX) and OBD2 port.
  • Repeat for the second ESP32 connected to the diagnostic tool.
  1. Software:
  • Use Husarnet to create a virtual network between ESP32s.
  • Forward CAN/UART data over Husarnet sockets.
  1. Testing:
  • Start with local Wi-Fi, then move to Husarnet’s P2P.

I think you are able to copy & paste the question into deepseek yourself to obtain the links

Hi Stefan
hopefully others won't find my words too demanding, but will try to post more sensitively for you next time.
regards
Evan