Octolapse-Like Timelapses
-
@beefymclargehuge said in Octolapse-Like Timelapses:
@resam I had the same idea using about using some sort of layer change to trigger a camera- Possibly through GPIO.
Yes, very similar approach. Instead of writing a message to the Telnet session with M118, you can use M42 to set a pin high & low (maybe with a G4 in between). The Duet and RPi are both 3.3V devices, so make sure you use the correct pins and voltage levels.
Would what you are describing be effectively identical to Simplify 3D's layer-change script field?
I never used this in S3D - but AFAIK the layer-change script sounds about right for this.
-
@resam I tried to use your example script but I do not know my way around python or Linux. I pasted what you have above in a .sh file, included the "#!/bin/bash" and ran the chmod to make it executable. But I get a syntax error.
Can someone post an example script file that will create a jpeg every time I send a M118 S"snap" in my layer change script. If I see how that part works I think I can work out the rest.
-
I'm by no means any sort of expert but if you are using python, can't you just search for "G1 Z" and by pass the insertion of "Layer change"? That's one way that I use to post process gcode files to insert colour change commands.
-
@deckingman sure - but if you are using slicer-retract + zhops you might run into problems. And since I'm already doing post-processing, why not make it explicit?
But as far as I understand, the M118 insertion is not the problem @Railgunner13f has right now.
@Railgunner13f the code snippet I posted is a python script, so your shebang should be something like
#!/usr/bin/env python3
. You still need some glue code around that to open and read/write the Telnet connection (a simple TCP socket). -
Ahhhhh, that's true - forgot about Z hop ( don't use it myself).
-
Inserting the gcode is easy in S3d. my problem is the python script and telnet and glue? I am a mechanical engineer. I can modify some code but I cant write it outright.
-
I tried using telnet to connect to the duet. I can ping it fine. But the telnet fails. the Duet & the Pi are on the same wireless network.
--- 192.168.1.113 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9007ms
rtt min/avg/max/mdev = 18.092/112.886/221.724/69.362 ms
pi@octopi:~ $ telnet 192.168.1.113 23
Trying 192.168.1.113...
telnet: Unable to connect to remote host: Connection refused -
@railgunner13f said in Octolapse-Like Timelapses:
I tried using telnet to connect to the duet. I can ping it fine. But the telnet fails. the Duet & the Pi are on the same wireless network.
--- 192.168.1.113 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9007ms
rtt min/avg/max/mdev = 18.092/112.886/221.724/69.362 ms
pi@octopi:~ $ telnet 192.168.1.113 23
Trying 192.168.1.113...
telnet: Unable to connect to remote host: Connection refusedDo you have telnet turned on in your configuration?
M586 P2 S1
Or M586 with no parms to read current state.
-
That was it! Thanks Danal. Now time for a crash course in python to figure out what to do with the telnet message.
-
FYI: I created a tool to take timelapse snapshots on every layer change: https://forum.duet3d.com/topic/6058/timelapse-pictures-videos-with-duet-and-webcam-on-layer-change
-
Octolapse has now added a function to compare each picture and fire a warning if the difference is "too great"
https://twitter.com/ppaukstelis/status/1017576602266370048?s=19
-
I'm working on similar. Instead of doing it every layer, I want to take the photos every 30 Seconds. Is there a way to trigger a macro to run based on a time interval?
-
If you want to make it every 30 seconds - what do you need a macro for? You don't even have to use a slicer plugin - just a simple script to take the picture on you webcam / Raspberry Pi:
while True: takePicture() time.sleep(30)
-
Because I'm not using a Raspberry Pi, or a webcam. I'm trying to accomplish it all through the DUET.
-
Use an mobile phone's audio jack (4 connections) and connect it to the Duet Wifi trhough an opto coupler. the pin connects the pin on the audio jack to ground (i think with 200ohm).Then the phone takes an image.
The G-code is modified through a script that adds g-code on each layer that moves thehead to a fixed position toggles the pin.
link text -
@alexlin said in Octolapse-Like Timelapses:
The G-code is modified through a script that adds g-code on each layer
This is the same approach as discussed previously. I'm trying to trigger the event not on layer change, but instead at a specified time interval.
-
@punamenon if you want to do it at certain time intervals and with no relation to the g-code, I would just use an external controller like and arduino/attiny...you can then still connect an io from the Duet to the Arduino to indicate when to start/stop a timelapse.
-
@alexlin This is probably what I will resort to, but I shouldn't have to. The Aduino DUE which the DUET is based off should have full clock functionality. We just need to get a timer implemented in the firmware. I wish I was a programmer, I would join the Dev. team.
-
@punamenon I agree that what I miss most with the Due vs Octoprint is the possibility to add plug-ins like Octoprint has
-
I've succeeded in accomplishing Octolapse-Like Timelapse videos without using a raspberry pi: https://youtu.be/CwHVQ81GfXw
Total project cost was under $10
It would still be nice to be able to trigger photos based on a time interval.