random Duet3 + SBC questions...



  • (With no duet3 specific category, I'm really not sure where to put this post. Please move it if there's a category that works better than 'tuning and tweaking')

    Some random questions I haven't been able to find answers to while searching:

    When using a Duet3 with SBC, which board/processor is used for simulating gcode prints?

    I currently use a script from @resam for webcam timelapse videos. That script relies on being able to open a telnet port to the duet to see layer change notifications (via "M118 P4 S"..." gcodes inserted by the slicer.) This won't work with the Duet3/SBC combination due to the lack of telnet support. As an alternative, is there any hook in DSF to watch for gcodes, M118 messages, etc? (Is there any documentation available for hooking into DSF?)

    Is the "DuetPi" sdcard image based on raspbian "buster"? Other than the addition of the DSF (and server) being pre-installed (and with related repos added), how else is the image different?

    Is there a maximum suggested length for the ribbon cable between the Duet3 and SBC?

    Thank you
    Gary


  • administrators

    @garyd9 said in random Duet3 + SBC questions...:

    (With no duet3 specific category, I'm really not sure where to put this post. Please move it if there's a category that works better than 'tuning and tweaking')

    Some random questions I haven't been able to find answers to while searching:

    When using a Duet3 with SBC, which board/processor is used for simulating gcode prints?

    The Duet.

    I currently use a script from @resam for webcam timelapse videos. That script relies on being able to open a telnet port to the duet to see layer change notifications (via "M118 P4 S"..." gcodes inserted by the slicer.) This won't work with the Duet3/SBC combination due to the lack of telnet support. As an alternative, is there any hook in DSF to watch for gcodes, M118 messages, etc? (Is there any documentation available for hooking into DSF?)

    Yes, there is. I'll leave others to provide the details.

    Is the "DuetPi" sdcard image based on raspbian "buster"? Other than the addition of the DSF (and server) being pre-installed (and with related repos added), how else is the image different?

    Apart from DSF and the server being pre-installed, the buffer size of the SPI interface is changed. There may be other changes too. @chrishamm can give you the details.

    Is there a maximum suggested length for the ribbon cable between the Duet3 and SBC?

    I suggest 200mm maximum to permit the use of high SPI speeds.



  • @garyd9 said in random Duet3 + SBC questions...:

    I currently use a script from @resam for webcam timelapse videos. That script relies on being able to open a telnet port to the duet to see layer change notifications (via "M118 P4 S"..." gcodes inserted by the slicer.) This won't work with the Duet3/SBC combination due to the lack of telnet support. As an alternative, is there any hook in DSF to watch for gcodes, M118 messages, etc? (Is there any documentation available for hooking into DSF?)

    There are a handful of different ways to hook. It might be possible to setup something that makes the script work as is (not telnet per say, but the same payloads on the same TCP ports); however, there is likely to be a much better way, if we take a look at the script.

    May I please request a link, or post a copy here, of that script?



  • @garyd9 said in random Duet3 + SBC questions...:

    I currently use a script from @resam for webcam timelapse videos. That script relies on being able to open a telnet port to the duet to see layer change notifications (via "M118 P4 S"..." gcodes inserted by the slicer.) This won't work with the Duet3/SBC combination due to the lack of telnet support. As an alternative, is there any hook in DSF to watch for gcodes, M118 messages, etc? (Is there any documentation available for hooking into DSF?)

    lots of ways the simplest may be one of the ones offered here https://forum.duet3d.com/topic/13566/socat-the-guide-to-remote-serial-paneldue-and-telnet-ish
    but mind you i found the reliability of socat + codeconsole to be lacking, pending further investigation

    i suspect Danal will come up with a more involved, but cleaner and more reliable option



  • @Danal

    The original thread is here: https://forum.duet3d.com/topic/6058/timelapse-pictures-videos-with-duet-and-webcam-on-layer-change

    The gcode inserted by the slicer is: M118 P4 S"LAYER CHANGE"

    Here's a link to the python script hosted on github by the author: https://github.com/Kriechi/DuetRRF-timelapse/blob/master/timelapse.py

    It basically just opens a telnet port to the duet and waits for the string "LAYER CHANGE". On seeing that, it saves a snapshot from the PiCam.

    I could easily reproduce this in another language (including C#/.Net.) What I'd like to avoid, however, is having to parse EVERY gcode command in a .g file while it's being sent to the Duet3. (The impression I got from reading the DSF docs is that I can't filter that stream...)


  • administrators

    @garyd9 said in random Duet3 + SBC questions...:

    I could easily reproduce this in another language (including C#/.Net.) What I'd like to avoid, however, is having to parse EVERY gcode command in a .g file while it's being sent to the Duet3. (The impression I got from reading the DSF docs is that I can't filter that stream...)

    The command has already been parsed for you when you intercept it. All you need to do is check whether the command letter and command number are a combination that interests you. If not, just pass it on.



  • I believe there is an easier way. Take the script that currently connects to telnet, strip all the telnet socket stuff out, and make it read stdin. Then, run it on the SBC with: sudo journalctl -fu duetcontrolserver | timelapse.py (which could itself be a one line shell script)

    There is one other small change required: The M118 P4 that currently get embedded need to be M118 P0 to hit the log that the above command is scanning.

    Does that make sense? And/or do you need me to make that version of the scripts?



  • @Danal said in random Duet3 + SBC questions...:

    I believe there is an easier way. Take the script that currently connects to telnet, strip all the telnet socket stuff out, and make it read stdin. Then, run it on the SBC with: sudo journalctl -fu duetcontrolserver | timelapse.py (which could itself be a one line shell script)

    There is one other small change required: The M118 P4 that currently get embedded need to be M118 P0 to hit the log that the above command is scanning.

    Does that make sense? And/or do you need me to make that version of the scripts?

    It does make sense. I'm wondering what the "M118 P0" will do in DWC, though...



  • @Danal said in random Duet3 + SBC questions...:

    The M118 P4 that currently get embedded need to be M118 P0 to hit the log that the above command is scanning.

    does this have a version requirement? haven't updated in a while, but M118 did not show up in journalctl regardless of P



  • @garyd9 said in random Duet3 + SBC questions...:

    I'm wondering what the "M118 P0" will do in DWC, though...

    seems to vary. if executed in dwc console it shows in dwc, if executed elsewhere it does not. (at least on the version i tried)



  • Within a running job, it logs to the correct log on the SBC for the commands I was proposing.

    It also logs to DWC, log and popup.



  • @bearer said in random Duet3 + SBC questions...:

    @Danal said in random Duet3 + SBC questions...:

    The M118 P4 that currently get embedded need to be M118 P0 to hit the log that the above command is scanning.

    does this have a version requirement? haven't updated in a while, but M118 did not show up in journalctl regardless of P

    Maybe. I am on:

    DSF Version: 1.2.3.1



  • @Danal
    Not being super python savvy, I think it would be very handy if you could provide the modified version of timelapse.py and a bit of instructions on how to setup for others with a Duet3 + SBC. I would be willing to help test/verify/report on my setup. If it helps, I already have MJPG-streamer and FFMPEG setup and running on my SBC (Pi 3).



  • I will take a look!



  • Just to help complete anyone that come back through this thread:
    Danal has a Time Lapse Python script posted here for the Duet 3: https://github.com/DanalEstes/DuetLapse
    Also, I have one published for the Duet 3 here: https://github.com/JimsJump/Duet_3_6HC_Time_Lapse
    Danal's is more polished for multiple systems where my is more customized to my setup.



  • @Wally said in random Duet3 + SBC questions...:

    @Danal
    Not being super python savvy, I think it would be very handy if you could provide the modified version of timelapse.py and a bit of instructions on how to setup for others with a Duet3 + SBC. I would be willing to help test/verify/report on my setup. If it helps, I already have MJPG-streamer and FFMPEG setup and running on my SBC (Pi 3).

    I may have misread this when I replied back on the 18th.

    DuetLapse can run on any Pi. Personally, I wouldn't run it on a Pi zero, but it will probably work (very slowly). The Pi on which DuetLapse runs only needs to be able to reach the printer that it is going to monitor or control via the network, and the camera it is told to use. If a command or library is missing, it will tell you how to get it.

    To say this same thing phrased another way:

    • DuetLapse can be run on the Pi in a Duet 6HC + Pi configuration. With no modifications.

    • DuetLapse does not require running on a Duet 6HC + Pi. It runs on any Pi that has network connectivity to the printer.

    Therefore, the instructions are:


Log in to reply