Setting Up a VPN for UAS Projects Using ZeroTier
Last updated
Last updated
When working on Unmanned Aerial Systems (UAS) projects, connectivity is often one of the most critical aspects, especially when you have multiple devices like Raspberry Pis, laptops, and ground control stations that need to communicate seamlessly. One reliable solution for this is setting up a VPN (Virtual Private Network) using ZeroTier, a user-friendly and flexible VPN solution that allows you to create secure, encrypted networks for your UAS components, regardless of where they are located.
In this post, we’ll guide you through the process of setting up ZeroTier to connect your UAS devices like Raspberry Pis, laptops, and ground control stations over a virtual private network, enabling secure, real-time communication.
If you are interested in routing MAVLink packets across these connected devices, be sure to also check out our previous blog post on Forwarding MAVLink Packets Using MAVLink Router.
ZeroTier is a versatile VPN solution, ideal for UAS projects for several reasons:
Easy Setup: ZeroTier offers a simple installation and setup process with minimal configuration.
Cross-Platform: It supports various platforms, including Raspberry Pi (Linux), Windows, macOS, and mobile devices.
Remote Access: Devices can connect to the same virtual network from anywhere in the world, as long as they have internet access.
Encrypted and Secure: ZeroTier provides end-to-end encryption, ensuring that your telemetry and control data remain secure.
By connecting all your devices via ZeroTier, you can create a private and secure environment for sending telemetry data, issuing commands to your drone, and integrating your autopilot system.
The first step is to create a ZeroTier account and set up a network:
Sign Up for ZeroTier: Visit the website and create an account (it’s free to start).
Create a New Network:
Once you’re logged in, navigate to the "Networks" section and click Create a Network.
This will generate a unique Network ID for your virtual network.
Configure the Network:
In the network configuration page, set your network to Private so that only devices you authorize can join.
You can also enable IPv4 auto-assign to ensure that all devices are automatically assigned an IP address within your virtual network.
Once your network is set up, the next step is to install ZeroTier on all your UAS devices (e.g., Raspberry Pis, laptops, and ground stations) that need to be connected to the VPN.
Installing ZeroTier on Raspberry Pi (Linux)
Update Your Raspberry Pi: Before installing, ensure that your Raspberry Pi is up to date:
Install ZeroTier:
Run the following commands to install ZeroTier:
Join the ZeroTier Network:
After installation, join your ZeroTier network by running:
Replace <your_network_id>
with the unique Network ID created in the previous step.
Authorize the Device: Go back to your ZeroTier web dashboard, where you’ll see the Raspberry Pi’s ID listed under "Members." Check the box to authorize it, allowing the device to fully join the network.
Installing ZeroTier on Laptops (Windows/macOS/Linux)
Linux: For Linux-based laptops (like Ubuntu), you can follow the same steps as for Raspberry Pi, using the terminal commands to install ZeroTier.
Once all your devices have joined the ZeroTier network and have been authorized, they should be able to communicate with each other using their ZeroTier-assigned IP addresses. Here’s how to check if the network is functioning correctly:
Check the Device IP Addresses:
On each device, run the following command to view the ZeroTier-assigned IP:
You’ll see the assigned IP under the Assigned Addresses section.
Ping Between Devices:
Try pinging one device from another using the ZeroTier IP. For example, if your Raspberry Pi was assigned the address 192.168.192.100
:
If the devices are correctly connected, you should see successful ping responses, indicating that the VPN is functioning and the devices can communicate.
With ZeroTier set up, all your UAS devices, such as your Raspberry Pi (acting as a companion computer), ground control station (GCS), and other laptops, are now on the same virtual network. This provides a secure and consistent environment for communicating telemetry data and controlling your drone.
Using ZeroTier with MAVLink Router
Now that your devices are connected via ZeroTier, you can start forwarding MAVLink packets across them. For example, if your Raspberry Pi is connected to your drone’s flight controller, you can use MAVLink Router to forward telemetry data to your laptop over ZeroTier.
On the Raspberry Pi, run MAVLink Router to forward data from a serial port (e.g., /dev/ttyUSB0
) to your laptop’s ZeroTier IP:
Replace <laptop_zerotier_ip>
with the ZeroTier IP of your laptop or ground control station.
For more detailed instructions on how to set up MAVLink Router for UAS projects, check out our previous post on Forwarding MAVLink Packets Using MAVLink Router.
Global Connectivity: With ZeroTier, your devices can be spread across different physical locations, yet still communicate as if they’re on the same local network.
Secure Communication: ZeroTier uses end-to-end encryption, ensuring that all MAVLink data, telemetry, and control commands are secure from interception.
Seamless Integration: ZeroTier is compatible with a variety of devices, making it easy to integrate your Raspberry Pis, laptops, and other systems into a unified network.
Scalability: Whether you have just a few devices or many, ZeroTier scales easily, making it ideal for complex UAS setups.
Setting up a VPN for your UAS project using ZeroTier is a great way to ensure secure, reliable, and flexible communication between your devices. Whether you’re working with drones in the field or conducting simulations, ZeroTier can simplify network management and enable seamless collaboration between ground control stations, onboard computers, and other devices.
By integrating this setup with tools like MAVLink Router, you can efficiently route telemetry data and commands across your UAS infrastructure. Make sure to refer to our previous guide on MAVLink Router for more insights into routing MAVLink packets within your ZeroTier network.
Happy flying, and enjoy your secure UAS communications setup!
References:
Windows/macOS: For Windows or macOS systems, simply download the ZeroTier installer from the , install it, and use the GUI to join the network by entering your Network ID.
ZeroTier allows for more advanced network setups, such as assigning static IPs, managing subnets, and creating more complex routing rules. If your UAS project requires additional networking functionality, you can explore ZeroTier’s advanced configuration options on their .