-
Notifications
You must be signed in to change notification settings - Fork 0
Communication ‐ Basestation & Rover
Jetson IP Address (Ethernet Port): 192.168.1.69
Jetson Username: rover
Jetson Password: mcgillrobotics
If you do not already have ssh installed, you can install it using the following commands:
sudo apt update
sudo apt install openssh-client
In order to communicate with the Jetson, we need to set our device's Ethernet IP address to have the same subnet as the Jetson's Ethernet IP address (subnet: 192.168.1.xxx)
. The reason we chose (subnet: 192.168.1.xxx)
as our subnet is because it needs to match the subnet of the Antenna's router.
Depending if you installed the Desktop or Server version of Ubuntu, you can use one of the two following options to set a static IP address:
- Go to Settings → Network
- Click the gear icon next to your Ethernet adapter
- Go to the IPv4 tab
- Set
- Method: Manual
- Address:
192.168.1.xxx
You can choose any number for xxx, 0-255, as long as it is not 1 or 10 (Antenna Router at Base Station and Rover, respectively), 69 (Jetson Ethernet Port), or 17 (Raspberry PI 5 Ethernet Port) - Netmask: 255.255.255.0
- Gateway: Leave empty
- Click Apply, turn off and on Ethernet connection, and reconnect the Ethernet cable
Use
ip a
to find your device's Ethernet interface, should be something like enXXX
for example enp3s0
or etho0
.
Then, run:
nmcli connection show
And you see something like:
NAME UUID TYPE DEVICE
Wired connection 1 7c59... ethernet eth0
Note the name of the connection
and that corresponds with your ethernet interface
that you see ("Wired Connection 1" and "etho0" in this example).
Next, replace the following CHANGE ME
's with your device information in the following lines:
- <CHANGE ME 1>: Name of Connection in double quotes
""
- <CHANGE ME 2>: Any number 0-255 except 1 or 10 (Antenna Router at Base Station and Rover, respectively), 69 (Jetson Ethernet Port), or 17 (Raspberry PI 5 Ethernet Port)
nmcli connection modify <CHANGE ME 1> \
ipv4.addresses 192.168.1.<CHANGE ME 2>/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns "8.8.8.8 1.1.1.1" \
ipv4.method manual
Finally,
nmcli connection down <CHANGE ME 1>
nmcli connection up <CHANGE ME 1>
If not done already, connect an Ethernet cable from the Jetson to your device's Ethernet port.
The Jetson has a static IP address set to 192.168.1.69
, so to check that everything is configured correctly, simply ping it.
ping 192.168.1.69
If you get responses, you’re connected!
- Accept the host key (yes)
- Enter the Jetson's password:
mcgillrobotics
- You're in!
On your device create a ssh key,
ssh-keygen -t ed25519 -C "auto-ssh"
Press Enter to accept defaults.
Next, use ssh-copy-id
(you'll enter the Jetson's password one time):
ssh-copy-id [email protected]
This adds your public key to the device's ~/.ssh/authorized_keys.
You should log in without a password now.
In ~/.ssh /
, edit or create a config file (literally just named config with no extensions). Then fill it with:
Host jetson
HostName 192.168.1.69
User rover
IdentityFile ~/.ssh/id_ed25519
Now just type: ssh jetson
ROS2 enables devices on the same LAN to see topics published on different devices on the same network and subscribed to them. We currently use this feature to communicate control commands and receive feedback from our scripts without needing to instantiate any websockets ourselves.
- The Jetson is connected the user's computer via Ethernet
- From local user:
ping 192.168.1.69
You should be able to see replies from the Jetson, if not, refer to above section on How to connect to the Jetson via ssh over Ethernet (Linux)
if your device is not properly setup.
Machine 1:
$ ros2 run demo_nodes_cpp talker
Machine 2:
$ ros2 run demo_nodes_cpp listener

- https://roboticsbackend.com/ros2-multiple-machines-including-raspberry-pi/
- https://risc.readthedocs.io/2-ros-network-wifi-ethernet.html
This note taken by Ida and Barry during our research on 05/04/2025. While we are trying to proof-of-concept that we can publish and subscribe to a ros topic through LAN. (related to rover issue: https://github.com/mcgill-robotics/rover-2025/issues/73).
Our current camera stream approach utilizes WebRTC, with the relevant code found in our react-ui
directory. WebRTC establishes a connection between a Jetson-powered rover (server) and a base station (client), allowing real-time video streaming from the rover's camera to a web-based client application.
+--------------------+ HTTP POST /offer +--------------------+
| | <---------------------------------- | |
| Client (UI) | | Server (Jetson) |
| React + WebRTC | ----------------------------------> | aiohttp + aiortc |
| | SDP Answer (JSON) | |
+--------------------+ +--------------------+
| |
| WebRTC Media Stream |
| <========================================================> |
| |
-
Server (
webrtc.py
) Runs on the Jetson device or rover. Captures live video from a camera (/dev/video{id}
) and serves it over a WebRTC connection usingaiortc
. -
Client (React app) Runs at the base station. Initiates a WebRTC connection by sending an SDP offer to the server, receives the video stream, and displays it in the browser.
-
Client sends HTTP POST to the
/offer
endpoint on the server with an SDP offer. - Server responds with an SDP answer, setting up a WebRTC connection.
- Video media stream is transmitted from the server to the client via WebRTC.
- (Optional) Data channel can be added for control signaling in the future.
- Both the rover (server) and the base station (client) must be on the same local network/subnet
192.168.1.XXX
. Refer to this guide to setup your laptop to be on the same subnet if you have not already: Communication Setup Guide - Basestation and Jetson - You must know the server's IP address to configure the client. The jetson's Ethernet IP address is
192.168.1.69
. - Chrome browser is required for setting "insecure origins treated as secure" if not using HTTPS.
-
Install Python dependencies:
pip install aiohttp aiortc
-
In the
react-ui
directory, navigate to thereact-ui/src/services/drive
directory -
Start up the WebRTC server using:
python3 webrtc.py
-
Navigate to the React app directory in our repo
react-ui
and install dependencies:npm install
-
Update the client code (basestation) to point to the server's (rover's) IP address in API requests (e.g.,
http://<ROVER_IP>:8081/offer
). At the moment, these are the places to define sever's IP address in the client code:
-
rover25_ws/src/react-ui/src/components/drive/CameraView.tsx
Line: 44 and 69 -
rover25_ws/src/react-ui/src/components/drive/ui/WebRTCPlayer.tsx
Line: 38
-
Start the client:
npm run dev
-
To open the website, we recommend downloading and using Chromium, as it has fewer problems with firewall-related issues.
-
Open Chromium and navigate to:
chrome://flags/#unsafely-treat-insecure-origin-as-secure
Add both the server address (e.g.,
http://<ROVER_IP>:8081
) and the React client address (e.g.,http://localhost:3000
) to the list. -
Navigate to the
Dashboard
and use the power button in the GUI to initiate a connection. You should now see the camera on through the UI on the camera view:)
- Cameras are expected to be available under Linux device paths like
/dev/video0
,/dev/video1
, etc. - You can double-check that the cameras are detected by running
v4l2-ctl --list-devices
on the jetson..