Octopi.txt location on ubuntu?

So I have octoprint latest version running on my ubuntudde 20.04 running smoothly. The webcam is USB Logitec Lifecam HD-6000 and I can see the stream and all.

I am not satisfied with the resolution and wanted to increase it and I understand that it needs to be changed in /boot/octopi.txt - the thing is that in /boot there is no octopi.txt, is that normal, are we manually expected to create a file there or is there a different location for the file depending on the OS?

I created the file in there as below but it made zero difference and I am assuming it is because octoprint does not even know the file is sitting there.

Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText.

Do not use Notepad or WordPad.

MacOSX users: If you use Textedit to edit this file make sure to use

"plain text format" and "disable smart quotes" in "Textedit > Preferences"

Configure which camera to use

Available options are:

- auto: tries first usb webcam, if that's not available tries raspi cam

- usb: only tries usb webcam

- raspi: only tries raspi cam

Defaults to auto

#camera="auto"

Additional options to supply to MJPG Streamer for the USB camera

See https://github.com/foosel/OctoPrint/wiki/MJPG-Streamer-configuration

for available options

Defaults to a resolution of 640x480 px and a framerate of 10 fps

camera_usb_options="-r 1280x720 -f 30"

Additional webcam devices known to cause problems with -f

Apparently there a some devices out there that with the current

mjpg_streamer release do not support the -f parameter (for specifying

the capturing framerate) and will just refuse to output an image if it

is supplied.

The webcam daemon will detect those devices by their USB Vendor and Product

ID and remove the -f parameter from the options provided to mjpg_streamer.

By default, this is done for the following devices:

Logitech C170 (046d:082b)

GEMBIRD (1908:2310)

Genius F100 (0458:708c)

Cubeternet GL-UPC822 UVC WebCam (1e4e:0102)

Using the following option it is possible to add additional devices. If

your webcam happens to show above symptoms, try determining your cam's

vendor and product id via lsusb, activating the line below by removing # and

adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff"

additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff")

If this fixes your problem, please report it back so we can include the device

out of the box: Issues · guysoft/OctoPi · GitHub

#additional_brokenfps_usb_devices=()

Additional options to supply to MJPG Streamer for the RasPi Cam

See https://github.com/foosel/OctoPrint/wiki/MJPG-Streamer-configuration

for available options

Defaults to 10fps

Jason: Resolution is NOT changing

#camera_raspi_options="-x 1920 -y 1080 -fps 10"

Configuration of camera HTTP output

Usually you should NOT need to change this at all! Only touch if you

know what you are doing and what the parameters mean.

Below settings are used in the mjpg-streamer call like this:

-o "output_http.so -w $camera_http_webroot $camera_http_options"

Current working directory is the mjpg-streamer base directory.

#camera_http_webroot="./www-octopi"
#camera_http_options="-n"

since you manually installed OctoPrint in Ubuntu you also have to manually install the mjpg-streamer application/service to run a webcam and show in OctoPrint. Did you do those steps? They would be similar to what's listed in the manual setup instructions for OctoPrint on Raspbian.

It's the optional webcam section, and the parameters you'll set will be in the service definition file for the mjpg-streamer options rather than reading them from octopi.txt I believe.

1 Like

Thank you very much, Yes I followed all those steps and I am able to see the stream just fine. I can start and stop it using the interface buttons in octoprint too. the only thing I seem to be missing is the config to change the resolution.

If you followed those directions, then you just need to manually modify the file /home/pi/scripts/webcamDaemon wherever you saved that for these options.

# init configuration
camera="auto"
camera_usb_options="-r 640x480 -f 10"
camera_raspi_options="-fps 10"

Alternatively, it looks like you could just create the octopi.txt file in the /boot/ folder and edit it directly. The one that is shipped with octoprint can be found here.

if [ -e "/boot/octopi.txt" ]; then
    source "/boot/octopi.txt"
fi
2 Likes