Skip to content

webcamd multi-configuration-file directory is set to incorect location: .../octopi.txt/octopi.conf.d/ instead of .../octopi.conf.d/ #869

Description

@davidgro

Note: I filed this earlier ( #868 ) but I failed to clearly communicate the issue and do not have perms to reopen it.

This is not about the move from /boot/ to /boot/firmware, but it is about the related compatibility code added in commit 370549c having a bug.

That code in question is:

CONFIG_FILE=/boot/firmware/octopi.txt
if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then
CONFIG_FILE=/boot/octopi.txt
fi
...
config_dir="${CONFIG_FILE}/octopi.conf.d"

Which sets $config_dir to /boot/firmware/octopi.txt/octopi.conf.d/
(or /boot/octopi.txt/octopi.conf.d/ if only /boot/octopi.txt exists as a file)

It SHOULD set it to /boot/firmware/octopi.conf.d/
(or /boot/octopi.conf.d/)

I should not need to create an octopi.txt Directory (not file!) to set up multiple cameras.

Unfortunately I am very inexperienced at coding and don't know how to set up a pull request, but this is an easy fix, so here's one suggestion which I have tested in a shell script on my Pi and it seems to work correctly in both cases. Note the change from FILE to BASE in the config_dir line.

CONFIG_BASE=/boot/firmware
# Fallback for older images
if [ ! -f "${CONFIG_BASE}/octopi.txt" ] && [ -f "/boot/octopi.txt" ]; then
CONFIG_BASE=/boot
fi
CONFIG_FILE="${CONFIG_BASE}/octopi.txt"

brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "0458:6006" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0994" "0ac8:3450")

config_dir="${CONFIG_BASE}/octopi.conf.d"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions