Read the contents of a file via HTTP GET request / gcode
-
Is it possible to have a http get request return the gcode contents of a file stored on the Duet? I have an external program thats separate from the duet web control and I was hoping to be able to read the contents of files on the Duet simply through GET requests. Any help is appreciated ! RRF3 if that helps.
-
@nickpm Yep...
https://github.com/chrishamm/DuetWebControl/tree/legacy#rr_downloadnamexxxhttp://<your_duet>/rr_download?name=<yourfile>
-
See: https://github.com/DanalEstes/DuetWebAPI
Example invocation of getting a file:
import DuetWebAPI as DWA printer=DWA.DuetWebAPI("http://192.168.7.101") printer.getFilenamed("/sys/config.g") ['; Jubilee CoreXY ToolChanging Printer - Config File', '; This file intended for Duet 3 hardware, main board plus two expansion boards (or, later, four tool boards)', '; As of 10/14/2019 INCOMPLETE AND ONLY PARTIALLY TESTED. See the discord for more info. ', '', '; Name and Identification', '; Printer name is now set on the R Pi. ', '', '; Networking', ';;;M552 P192.16..........
It is all python, but you can use it as an example to code in whatever you want.
-
You guys rock!