Add Raspicam / CSI cam instead of stock camera

There's an option to use Turtle Control Software with Raspicam connected instead of stock USB camera.

1. Connection

To do that you'll need to disconnect the stock USB camera, disconnect Turtle Electronics from Raspberry Pi and connect Raspicam to Raspberry Pi camera connector (please mind the tape connector orientation and the right port to connect).

Put the Electronics back on Raspberry Pi as you route the tape the way you like.

2. Software changes

2.1 Enable CSI camera port

Power on the electronics / Rover and access it via console.

page[FAQ] Software 101

Now you need to enable the camera CSI port by properly configuring Raspberry Pi config file. Access it by typing:

sudo raspi-config

Go to '5 Interfacing Options'

Check 'P1 Camera - Enable/Disable...'

Click '<Yes>', then '<Ok>' and click ESC.

Reboot the system either by powering off and on or by:

sudo reboot

Login to the system again. The camera will now be enabled every time you reboot the electronics / Rover.

2.2 Run uv4l streaming server

As the server files are already installed in TurtleOS you don't need to do that.

Simply run the commands listed below. First, kill any running uv4l server.

sudo pkill uv4l

Then start a new streaming using raspicam driver

sudo uv4l -nopreview --auto-video_nr --driver raspicam --encoding mjpeg --width 640 --height 480 --framerate 20 --server-option '--port=8090' --server-option '--max-queued-connections=30' --server-option '--max-streams=25' --server-option '--max-threads=29'

You don't need to retype whole command in the console. When using Putty:

ctrl+C the command from here

Move to the terminal and click right mouse button - hooray!

2.3 Enter the Rover interface

Now simply get back to the Rover interface in your browser

10.0.0.1

You need to do run the uv4l streaming server (point 2.2) every time you restart the system / Rover. We're still working on it.

You can play with the streaming settings modifying the 'sudo uv4l ...' command (the long one). Check the settings here: https://www.linux-projects.org/documentation/uv4l-raspicam/

The tutorial is based on: https://www.instructables.com/id/Raspberry-Pi-Video-Streaming/

Last updated