Here is the hack if anyone needs it.
The latest platform image have the RNDIS host flag set. https://gitlab.com/voxl-public/system-image-build/meta-voxl/-/blob/master/recipes-kernel/linux-quic/files/enable_RNDIS_HOST.cfg?ref_type=heads
-
First step is to get a compatible OTG cable. I got an off-brand one that works. Run dmesg -wH on your jetson carrier board. If there are the usb0/rndis0/l4tbr0 means the connection is solid.
-
In voxl, save the following script somewhere. /home/root/usb_tethering.sh is a good choice.
#!/bin/bash
# Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Bring up usb0 interface
ifconfig usb0 up
# Assign IP address to usb0
ifconfig usb0 192.168.55.2 netmask 255.255.255.0
# Add route for USB network
route add -net 192.168.55.0 netmask 255.255.255.0 dev usb0
# Set up iptables rules for NAT
iptables -A FORWARD -o wlan0 -i usb0 -s 192.168.55.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
- Make it persistent by creating a systemd service. Save it at /etc/systemd/system/tethering.service
[Unit]
Description=USB Tethering Service
After=network.target
[Service]
Type=simple
ExecStart=/home/root/usb_tethering.sh
[Install]
WantedBy=default.target
- Run the following
sudo systemctl daemon-reload
sudo systemctl enable tethering.service
-
Check with ifconfig on voxl (should have a static addr 192.168.55.2 for usb0 interface)
-
Check with ifconfig on jetson carrier board (the l4tbr0 default addr should be 192.168.55.1)
-
Try pinging each other (optional)
-
In voxl, set to station mode and connect to a access point. For jetson carrier board, check if it is possible to connect to a public web.
ping google.com
- In jetson, the dns nameserver for the l4tbr0 interface may need to change to 8.8.8.8.
Check with
systemd-resolve --status
- Alternatively, change globally by modifying the nameserver address to 8.8.8.8 at /etc/resolv.conf
Bandwidth ~ 265 Mbps which should be expected from a usb2.0 controller (max 480 Mbps) and the overhead from the interfaces.