RpiRobot is a Raspberry Pi-based robot project that features direct low-latency video streaming from the Raspberry Pi to a web browser over WebSocket. The project has been successfully tested with up to 7 connected clients.
- Raspberry Pi 1 Model A+
- Raspberry Pi Camera Module
- Raspberry Pi OS (Bullseye) with legacy Raspivid camera stack enabled
- uWebSockets library
-
Install Raspberry Pi OS (Bullseye) on your Raspberry Pi and enable the legacy Raspivid camera stack.
-
Install the uWebSockets library by following the instructions in the uWebSockets documentation.
-
Compile the
video_stream_server.cpp
file located in theexamples
folder of the uWebSockets installation using the following command:sudo g++ -march=native -pthread -O3 -std=c++20 -Isrc -IuSockets/src -flto examples/video_stream_server.cpp uSockets/*.o -lz -o video_stream_server
-
Copy the compiled
video_stream_server
executable, as well as thecamera_settings.txt
file, to the/usr/local/bin/
directory on your Raspberry Pi. -
Compile the
motor_control.c
file and copy the resulting executable to the/usr/local/bin/
directory as well. -
Place the
index.html
file in a web-accessible directory on your Raspberry Pi.
- Run the
motor_control
to allow controlling the robot's movement - Run the
video_stream_server
executable to start the video streaming server. - Open the
index.html
file in a web browser to view the live video stream from the Raspberry Pi camera.
- This project is based on the older Raspberry Pi 1 Model A+ hardware, which may have limitations in terms of processing power and video quality compared to newer Raspberry Pi models.
- The video streaming is limited to a maximum of 7 connected clients, as tested.