General Question about File Transfer of Duet and Rasperry PI
-
Hey guys,
I am relativly new to the topic and I currently do not understand the architecture od the Duet3 in combination with RPI. Especially file transfer is completly unclear for me.
Maybe one of the experts can bring light into the dark:
Main question: What are possible (and good) ways to transfer (programmatically not manually over the Web Control GU) Gcode to the duet?
Currently I am using : PC in Network with Samba folder to RPI with pythonscript (call of M28 with @Danal interface ) to Duet3.Can I transfer the file directly over ftp from RPI to duet instead of using M28?
Should I use for file transfer the ribbon cable (SPI), a usb cable or even an ethernet cable between RPI and duet? I am confussed.
-
When operating with DuetSoftwareFoundation (DSF) on the Pi all the transfers between the Pi and the Duet3 are over SPI/the ribbon cable. There shouldn't be a SD card in the Duet in this scenario, and when you run M28 it should output to /opt/dsf/sd/gcode/ so you might as well share that file over samba/ftp/sftp/ssh or just upload the files through the web interface running on the pi? (you can run wget/fetch/curl/whatnot against the web interface as well)
-
Thx @bearer . Are you telling me that if I ran a gcode command M28 it is never excuted on the duet? Is just copying my file via M28 to another folder on the RPI? What excatly is than the advantage of M28 instead of just copying?
-
@lepetitmort said in General Question about File Transfer of Duet and Rasperry PI:
Are you telling me that if I ran a gcode command M28 it is never excuted on the duet? I
not 100% sure but I suspect so, as the M28 is sent to the Pi and the Duet doesn't have a sd card so no reason it involve it in the process; but I can't say I've studied the implementation in detail; at least it isn't neccecary to do so.
When using a rPi I'm not sure I see any advantage to using M28 unless the source is a legacy serial system maybe.
-
Standalone Duet firmware, working with Duet Web Control, uses their own combination of things to move gcode files (that will later be printed) and/or system files, or whatever. Depending on the exact version of Duet Firmware and DWC, this may be HTTP or Websockets under the covers... but that's really not all that relevant, the actual "transport protocol" is Firmware & DWC custom code. DWC places files in various directories, /sys, or /www, or others, based on the file extension, and on which upload button you used (system files vs. jobs).
In addition, a standalone Duet can have FTP enabled, in which case you can FTP to and from the SD card. It is up to you to put the right files in the right directories.
Duet3+Pi is different. The DWC buttons still work as described in the first paragraph above. In addition, if you turn on FTP (which would require installing an FTP server on the Debian OS on the Pi), that FTP will have access to whatever you configured to be able to reach in the file system of the Pi. Not the Duet board, it doesn't have a file system in this configuration. If you allow FTP to get there, what the Pi sees as '/opt/dsf/sd' is what the Duet board sees at its SD. Again, up to you to put the right files in the right directories.
-
@Danal That helps me. Thanks!
-
The easiest way to transfer a file from a PC to the Pi would be to upload it using the HTTP PUT endpoint DuetWebServer provides: https://github.com/chrishamm/DuetSoftwareFramework#put-machinefilefilename
So for example you can send
PUT /machine/file/gcodes/mygcode.g
with the whole body being the file content and it would be transmitted without issues. I suggest you look for a Python REST API and use that.I'll try to reproduce and fix the issue you reported about M28.