Stream live video from one Raspberry Pi (with camera) to another RPi (base station) over WiFi/TCP.
sudo apt-get update && sudo apt-get install -y python3-opencv python3-numpy python3-picamera2The base station doesn't strictly need
python3-picamera2, but it won't hurt to install it.
python3 receiver.py --port 9000This opens a listening socket and waits for the camera Pi to connect.
python3 sender.py --host <BASE_STATION_IP> --port 9000Replace <BASE_STATION_IP> with the base station's IP address. To find it, run hostname -I on the base station Pi.
Press q in the receiver's display window.
| Flag | Default | Description |
|---|---|---|
--width |
640 | Frame width (px) |
--height |
480 | Frame height (px) |
--fps |
30 | Target framerate |
Example at higher resolution:
python3 sender.py --host 192.168.1.50 --port 9000 --width 1280 --height 720 --fps 24On each Pi, run:
hostname -I- "Connection refused" — Make sure the receiver is started first.
- No display window — The receiver needs a display (monitor, VNC, or X forwarding).
- Camera not detected — Run
rpicam-helloto verify the camera works.