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

@Shikan_Yue,

  1. If I'm going with option 2, am I able to remove the camera SD card once the print is finished and all images are taken?

Yes! The images should remain until you start another print. Remember that the initialization script is deleting ALL images from the SD card.

  1. Can you tell me if i'm calling my scripts in the correct places?

There really is no wrong place as long as you have added the proper permissions. However, this looks suspect:

Before Render Script - /home/pi.scripts/before-render.sh

Maybe you meant this:

Before Render Script - /home/pi/scripts/before-render.sh

I hope that helps!

EDIT: Reading thorough the thread again, I did not give the script permission to run without a password. Will try that and let you know how it goes.

You were not kidding about the quick response!

I ended up fixing that before testing.

I'm am getting an error immediately if I try to start a test print or if I try to test the before print start script. It goes away if I remove the script.

Error message:

Octolapse - Camera Settings Error

There were 1 errors while applying custom camera settings/scripts:
camera_initialization_error: The custom camera initialization script failed with the following error message: The process does not exist

Any thoughts?

Hi again,

I've spent the past few hours trying to run this and have had little luck. The best result was that the camera would take snapshots for the first 10-15 layers. After that an unspecified camera error would pop up and the camera would no longer take snapshots. I've uploaded a log file as well as the octolapse.json

The snapshot acquisition code from the wiki page works great, I just can't seem to get this version running.

Thanks for your help!Octolapse Log Files.zip (287.7 KB)

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