First, if you haven’t already, activate the camera in raspi-config. Login via SSH type “sudo raspi-config” select “Interfacing Options” and enable the camera.
Configuring the camera
Now edit “sudo nano /boot/octopi.txt” uncomment the camera=”auto” line and change it to camera=”raspi”. Uncomment camera_raspi_options=”-fps 10″. These settings configure the camera to provide and image in the format 640×480@10fps. If you would like to change that check the available options at: https://github.com/foosel/OctoPrint/wiki/MJPG-Streamer-configuration
Enabling the camera in the octoprint browser interface
In the browser click on the little wrench in the top bar to open the settings dialog. Select “Webcam & Timelapse”. Set the “Stream URL” parameter to “http://octopi.local:8080/?action=stream”. Obviously change the hostname if you have configured it to something different.
Finally restart octoprint for the changes to take effect.