Issue setting up Arducam with Octoprint

Camera model
Arducam Pi Camera with motorized lens.

What is the problem?
I've followed the steps on

and when i get to the portion where i have to enter
"if ! grep -Fxq "^#ArduCamFocus$" /boot/config.txt; then
sudo cat << end_of_file >> /boot/config.txt
#ArduCamFocus
dtparam=i2c_vc=on
dtparam=i2c_arm=on
end_of_file
fi"
i get the error "-bash: /boot/config.txt: Permission denied".

My ultimate issue is that the camera shows in the control tab and I can see an image, however it doesn't allow me to change the cameras focus. The adjustment sliders are there, but are grayed out. I thought the problem with me not being able to enter the code above was my issue, however, the changes it's supposed to make are already in /boot/config.txt so I'm thinking that's not the issue. I just stated it here just incase that can give an idea for fixing the bigger issue.

What did you already try to solve it?
I have tried reinstalling octopi several times on my sd card to hopefully solve the issue. I have also tried accessing the /boot/config.txt and adding that line of code manually. I have followed every step of that guide and I get stuck. Octoprint isn't allowing me to change the focus on the camera.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)

OctoPrint version : 1.6.1
OctoPi version    : 0.18.0
------------------------------------------------------------------------------
 
pi@octopi:~ $ if ! grep -Fxq "^#ArduCamFocus$" /boot/config.txt; then
sudo cat << end_of_file >> /boot/config.txt
#ArduCamFocus
dtparam=i2c_vc=on
dtparam=i2c_arm=on
end_of_file
fi
-bash: /boot/config.txt: Permission denied

Additional information about your setup (OctoPrint version, OctoPi version, ...)
I'm using a raspberry pi 3 B+ for octopi. I am using Windows 10 and using puTTY to access SSH. Thanks.

Hi
The easiest way would be to just do it without the script.

run

sudo  /boot/config.txt

scroll down to the end of the file and add this

#ArduCamFocus
dtparam=i2c_vc=on
dtparam=i2c_arm=on

Exit the editor with ctrl + x, confirm the save question with y and the filename with enter.

1 Like

I checked /boot/config.txt and it already has that in there.

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
# enable raspicam
start_x=1
gpu_mem=128



#ArduCamFocus
dtparam=i2c_vc=on
dtparam=i2c_arm=on

well then you don't need to add it again :slight_smile:

I didn't state it in the first post and I should have. I was thinking that not being able to put that in the code was my issue, it clearly isn't since it's already there. The camera shows up in octopint control and I can see live footage, but it will not let me change the cameras focus.

Can you upload the octoprint.log? There may be errors or other useful information relating to the plugin there.

octoprint.log (64.4 KB)

I would love to know the solution to this. I have the same exact Pi, same situation, tried everything and get nothing. Here is my log for comparison sake. octoprint 111021.log (146.5 KB)

I have a possible idea that could fix it. I haven't tried it yet because I couldn't find a solution and gave up and bought a regular webcam. It involves taking the sd card out of the raspberry pi, inserting it into your PC, opening octopi.txt using notepad++ and uncommenting the appropriate lines for a raspberry pi camera. Then trying again. I plan on trying this to see if it works because I would like to set up my pi camera specifically for time lapse and the webcam for overall monitoring. Let me know if this works.

Edit- Do this on top of everything else that is supposed to work for the installation with the correct plugin.

Thanks, i have completed that task multiple times now without success.
Pardon my newb question.
Can i use VS code to edit everything on the SD card by uncommenting the sections and avoid the SSH thing. - do those two thing accomplish the same task two different ways?

In other words, i can't get SSH to work, can i just do everything right on the SD card?

From what I understand about using SSH to access a file, is to be able to do it remotely. So if this is correct, then in theory, if you can access the actual file via SD card, then you can edit it without using SSH. I'm fairly new to this as well so I'm having to learn with trial and error.

Ok, i got it figured out, 2 main things i changed that led to success.

1- I was running in circles because my password included (@) symbol which comes out as (") when you type it directly into the Raspberry Pi so my password was always incorrect. - I changed my password, then went into Localization options and changed the keyboard from generic to my keyboard. Then @ came out as @.
2- I started the whole installation over with a 8gb card (anything below 32gb) because I could not format my card in the correct Fat32 format (never payed attention before) with my 64gb card. I don't know all of the i/o on that but since ExFat isn't the same i guess it keeps something from working correctly . Not sure if all that was said correctly, hopefully you get the drift.

I used this install to get it right.

You should not need to format the SD card manually, the imager will take care of that.

While you can avoid using SSH and edit files directly on the SD card, the OS where the SD card will be attached needs to be able to mount the / partition. This is easily accomplished if that OS is Linux but it gets harder for others.

I strongly suggest you figure out how to use SSH. Your life with a 3D printer and OctoPrint will be much easier.

Well I also have setup issues with my ArduCam Autofocus camera.

Camera model ArduCam 16 MP IMX519 Autofocus
Raspberry Pi 4 Model: B + 8GB Ram + 64 GB SD Card

What is the problem?. Build Issues of libcamera (and possibly others too).
the command vcgencmd get_camera gets supported=1 detected=0
Does this mean possibly my camera is faulty or connected incorrecty ?

Some of the documented instructions do not work.
[ yes I did read the manual for the camera and tried the instructions there, but although the instructions executed without error, the camera still not working ]

Concern that Ocotpi Build is 32 bit kernel - why not 64 bit ?
Concern about the OS Release version (10) when the camera docs talk about (11).

What did you already try to solve it?. Tried doing everything over again. Not sure where to begin
Tried the instructions at:

It fails at step 2.2 and also 2.3.3

**pi@octopi**:**~ $** raspistill -t 0
mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
octoprint-systeminfo-20220930101811.zip (157.1 KB)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint version : 1.8.4
OctoPi version : 0.18.0

Other symptoms:
Installation of camera software is supposed to create /dev/video0 and /dev/video1 but they are not present , The system tries to use /dev/video10 (first of 10 video devices that are created by default).
so its obvious cause of some issues, but the build process fails due to what looks like basic programming issues ::

There are a myriad of possible issues and probably some blind alleys. So I need some help with a place to start methodical approach to debugging the issue.

I'm having the same issue as the OP.

Octoprint 1.8.6
Raspberry Pi 3 Model B 1GB RAM + 32GB SD Card
ArduCam 5MP SKU B0176 motorized focus

Problem: I've installed all the libraries, enabled I2C, as specified by arducam and in the plug-in pages.
I have a good camera feed in Octoprint, but neither of the Arducam plug-ins enable control of the focus capability. I had the same problem as the OP (bash error on config.txt) but manually inspected the config.txt file and found the two I2C parameters were already enabled.

ArducamCameraControl 0.3. PTZ and focus sliders are grayed-out and non-functional
ArducamFocus 0.0.6 Clicking on the focus arrows generates the error "Trouble accessing camera. I2C bus failure. Is camera plugged in?"

I2C is enabled in the config.txt parameters and via raspbi-config. The camera video stream is working. But I'm unable to control focus using either of these plug-ins.

In case it helps, I was having the same problem. Camera worked, i2c error on focus. I switched the camera aspect ratio to 4:3 in octoprint "Webcam & Time Lapse" settings, and it works now.

Hi, I'm new to this 3D printing hobby and this Chat. And like others my question is : Do we have or plan a fix for this issue of Arducam Camera Control or should I kiss my purchase goodbye and go another way?
It would seems that noting is really working for this type of cam. What are your recommendation for replacement if required or the solution?
Thank you very much for your attention.
A newbie!

A lot has happened in the last three years and since the only information we have on your issue is your new and have an unknown Arducam connected to an unknown system running unknown software there's probably not much we can do to help. However, if you open a new Get Help topic and fill out the template with as much detail as possible, then there is probably something we can do.

1 Like