Octolapse: How to turn off saving and, rendering to the PI?

I don't see any camera errors in your log file, but I DO see snapshots being taken VERY frequently (every 10 seconds or so). If your camera memory is slow and you are taking very high res images, you are probably overrunning your RAM buffer, which will likely cause an error in gphoto2.

Try a print that gives your camera more time to save images to SD, or just ignore the camera error and accept that you will miss a few snapshots if you have many very quick layers. See if the timelapse renders. Octolapse should nicely tolerate and report camera errors like this.

You could also try adding faster flash memory to your camera and see if that helps. Not sure about the specifics of your DSLR, but it could help. OR you could turn down the resolution or increase the image compression, both should help.

This really sounds like a hardware/gphoto2 limitation (I wouldn't call it an issue), but since I'm not seeing any camera error in the log, I can't be 100% sure. You could try manually calling gphoto2 and see how many images you can take in rapid succession before it starts reporting an error (My camera will do this, and I suspect pretty much all will). That should give us a decent error report.

Thanks!

I missed this earlier message. Did you ever get this to work? The initialization script is very important, because it sets the image target to SD (it defaults to RAM for most (all?) cameras).

If you are having trouble with that initialization script, try to run the command manually through the command line and see if there are problems. It is also possible to query the camera for its capabilities (look into the gphoto2 docs), perhaps yours requires a slightly different script? I would help more with this but I'm out of town and don't have access to the equipment necessary to try out commands :frowning: I should be back Sunday though.

This was just an error on my part. I did not give proper permission to the camera initialization script. It worked perfectly after that.

[quote="FormerLurker, post:15, topic:4341, full:true"]
I don't see any camera errors in your log file, but I DO see snapshots being taken VERY frequently (every 10 seconds or so). If your camera memory is slow and you are taking very high res images, you are probably overrunning your RAM buffer, which will likely cause an error in gphoto2.

This is probably my fault again, I wanted a way to quickly run tests so I made a 10 x 10 mm cylinder with 1mm wall thickness. Each layer runs super fast since it's only drawing two very small circles. I will try again with a more reasonable model and report back.

Cool, maybe just turn your feed rate way down to like 10%? That way you can reuse your test gcode without having to slice something new :slight_smile:

Ive been trying to get this scripts to work and followed the instructions just like you wrote and i really apreciate you for sharing this instructions.

the scripts and my camera were working and shooting but the photos didnt save on the SD and as mentioned by Shikan Yue every 15 layers the camera just stopped working, my personal solution was to write in the initialize-camera.sh

gphoto2 --set-config capturetarget=1

Instead of

gphoto2 --set-config capturetarget=2

After that my camera worked fine!

@3dprint3d, thank you for posting that! I actually updated the guides to reflect this a short time ago. Unfortunately the video still shows the old code, but I plan to create new videos soon.

Thanks a lot ill be following your youtube channel for those videos.

Is there any platform where you upload them?

And thanks to all your team for your development

El El sáb, 9 de noviembre de 2019 a la(s) 11:43, Brad via OctoPrint Community Forum noreply@community.octoprint.org escribió:

Is there any platform where you upload them?

Pretty much Youtube is all at the moment. Any suggestions?

And thanks to all your team for your development

Thanks! It's pretty much just me, though a few key features and various enhancements have been added by a few kind folks. I list out everyone in the about page of the plugin.

Hello again, ive upgraded from Octolapse 0.3.4 to 0.4.0rc1.dev2 with OctoPrint 1.3.12 running on OctoPi 0.16.0

And now im getting this error :frowning_face:

Unable to start the timelapse. Cancelling print. Error: Unable to start the timelapse. See plugin_octolapse.log for details

plugin_octolapse.log (130.2 KB)

hope you could help im thinking in a downgrade but i upgraded to try the new snap to print features.

Thanks in advantage

Yes, there was a bug in the script camera settings (DSLR) in dev1.rc2. I'm working on dev1.rc3 right now. I just have a few final things to finish. I'll PM you a link to the devel branch once I think it's close enough for you to upgrade.

I can't wait to hear what you think about snap-to-print. However, you will lose some of the benefits since DSLRs generally take a lot of time to snap a picture, which can lead to some oozing. There are several modes, however, one of which is 'High Quality' mode. This will reduce the smoothness of the timelapse somewhat, but can generally keep oozing inside of exterior perimeters.

Hello

Thanks for that I'll wait for the link to test all your new features i was thinking in a downgrade but i will wait your news!!

El El dom, 10 de noviembre de 2019 a la(s) 10:55, Brad via OctoPrint Community Forum noreply@community.octoprint.org escribió:

Hello FormerLurker, im trying to get to work the before render script described here after i upgraded to Octolapse v0.4.0rc1+u.9479c74 but when i try to execute from ssh the error im guetting is:

Creating directory:
mkdir: cannot create directory '' : no such file directory
saving file as _MG_8752.JPG
saving file as _MG_8753.JPG
saving file as _MG_8754.JPG
mv: cannot move '_MG_8752.JPG' to '' : No such file or directory
mv: cannot move '_MG_8753.JPG' to '' : No such file or directory
mv: cannot move '_MG_8754.JPG' to '' : No such file or directory
mv: cannot stat '.JPEG' : No such file or directory
mv: cannot stat '
.jpeg' : No such file or directory

i'll apreciate your kind help

can you paste in the exact command you are trying to execute?

thanks this is the exact commands i executed from SSH trying to figuring out why octolapse didnt render

/home/pi/scripts/before-render.sh

this is the before render script

#!/bin/sh
# Camera Pre-Render script
# Written by: Formerlurker@pm.me

# Put the arguments sent by Octolapse into variables for easy use
CAMERA_NAME=$1
SNAPSHOT_DIRECTORY=$2
SNAPSHOT_FILENAME_TEMPLATE=$3
SNAPSHOT_FULL_PATH_TEMPLATE=$4
# Check to see if the snapshot directory exists
if [ ! -d "${SNAPSHOT_DIRECTORY}" ];
then
echo "Creating directory: ${SNAPSHOT_DIRECTORY}"
mkdir -p "${SNAPSHOT_DIRECTORY}"
fi
# switch to the snapshot directory
cd "${SNAPSHOT_DIRECTORY}"
# download all of the images on the camera
gphoto2 --get-all-files --force-overwrite
# rename images according to the supplied file template
a=0
for i in *.JPG *.jpg *.JPEG *.jpeg; do
new=$(printf "${SNAPSHOT_FILENAME_TEMPLATE}" "${a}")
mv -- "${i}" "${new}"
a=$((a+1))
done

Ive uploaded the octolapse log if that helps.

Thanks again

plugin_octolapse.log (36.7 KB)

Lots of problems in the log, and it's hard to tell what has changed, and what is still a problem. However, this line:

The script at path 'https://github.com/FormerLurker/Octolapse/archive/devel.zip' could not be found for  for New Camera - Snapshot Camera Script.  Please check your script path and try again.

Is a problem. You should not have a URL in any of the camera script settings. That is only for .sh files.

Next issue:

The script at path '/home/pi/scripts/initialize-camera.s' could not be found for  for New Camera - Before Print Camera Script.  Please check your script path and try again.

Your path is incorrect. your script ends in .sh not .s, so be sure to fix that.

The rest of the errors look like permission problems. I see a before print script here:

/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_octolapse/script.py

Not sure what is going on there, but you shouldn't be calling scripts from the site package directory. Also, that is a python file, which you can't execute directly. Not sure exactly what's going on there. Are you using full path strings when calling these scripts, like this: /home/pi/....my_script.sh? If not, do that.

Next, have you tested the gphoto2 --get-all-files --force-overwrite command through the terminal to make sure it downloads all files on the SD? Make sure that works, and look at the file name format. Paste in a few samples if you can.

Perhaps you could clean out the log files (edit your logging profile and click clear logs), remove any scripts from all camera profiles you aren't having problems with, then click the test button next to the ones you are, then send me that log. That would be helpful since we could focus on one thing at a time.

Thanks!

Thanks again sorry for the messy log.

I get this when testing the gphoto2 line

pi@octopi:~/scripts $ gphoto2 --get-all-files --force-overwrite
Saving file as _MG_8912.JPG
Saving file as _MG_8913.JPG
Saving file as _MG_8914.JPG
Saving file as _MG_8915.JPG
Saving file as _MG_8916.JPG
Saving file as _MG_8917.JPG
Saving file as _MG_8918.JPG
Saving file as _MG_8919.JPG
Saving file as _MG_8920.JPG
Saving file as _MG_8921.JPG

This is de cleaned log just with the DSLR profile, My Webcam (logitech works perfect and the log didnt present errors)

plugin_octolapse.log (843 Bytes) !

!

1 Like

Perfect, thank you! That's what I like to see :wink:

So here is the issue:

	mv: cannot stat '*.jpg': No such file or directory
	mv: cannot stat '*.JPEG': No such file or directory
	mv: cannot stat '*.jpeg': No such file or directory

So, either no files are getting downloaded from the gphoto2 --get-all-files --force-overwrite command, or the file doesn't end with one of the three extensions above (case sensitive). I would check the /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp (or something similar, this is settings controlled) directory and see if your snapshots are somewhere in there. Next, I would take a few pics with the DSLR, plug it into your pi, and try downloading them with the gphoto2 --get-all-files --force-overwrite command. If no files are downloaded, either the command is not correct for your camera, or your camera doesn't support that function. If images do get downloaded, take a look at the file name and extension (post it here). The script may need some subtle adjustment.

One other possibility is that the images aren't actually being stored on your SD card. You should be able to check that out by deleting all images from your camera, running a timelapse in test mode (see Octolapse tab), letting your DSLR take a pic or two, then stopping the print and checking the SD card for images.

Let me know the results of your tests.

I hope that helps!!

Hello and thanks again.

Checking the /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp
I found only 2 images that i think are not from my DSLR (canon T6)

pi@octopi:~/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp $ ls
latest_354def78-9eea-409a-ad23-ee966dfff4ba.jpeg
latest_thumb_354def78-9eea-409a-ad23-ee966dfff4ba.jpeg

Next, I took and downloaded the images.

pi@octopi:~ $ gphoto2 --get-all-files --force-overwrite

Saving file as _MG_0001.JPG
Saving file as _MG_0002.JPG
Saving file as _MG_0003.JPG

pi@octopi:~ $ ls
_MG_0001.JPG
_MG_0002.JPG
_MG_0003.JPG
mjpg-streamer
OctoPrint
oprint
scripts

I cannot say if my camera doesnt support that function now. I´ve been using the same camera before the octolapse upgrade

The good thing is that the photos are being storen in my camera SD, i can render the timelapse manually when im shooting at higher resolution images :smiley:

Hmm.. It looks to me like it should have worked! I need to run this myself and attempt to replicate your issue. I will let you know when I've got that taken care of. Nudge me if it takes too long (will be a day or two).