@norder Great! Thanks!
Best posts made by DuetUser
Latest posts made by DuetUser
-
RE: Custom gcode upload function in python - RRF HTTP server options
@chrishamm There is and I successfully do it by passing an iterator as "data" to POST request, it feeds the request with chunks of data. Everything is fine but it is a blocking IO. I'm trying to make it async, ond one of the ways is to pass chunks sequentially in subsequent POST requests, only RRF treats each chunk as a separate file.
I have to dig into it more and perhaps make an async iterator and use it with async uploader, which I failed to do as of yet.This is a working non async upload code:
import requests class upload_in_chunks(object): def __init__(self, filename, chunksize=1 << 13): self.filename = filename self.chunksize = chunksize self.totalsize = os.path.getsize(filename) self.readsofar = 0 def __iter__(self): with open(self.filename, 'rb') as file: while True: data = file.read(self.chunksize) if not data: sys.stderr.write("\n") break self.readsofar += len(data) percent = self.readsofar * 1e2 / self.totalsize sys.stderr.write("\r{percent:3.0f}%".format(percent=percent)) yield data def __len__(self): return self.totalsize def sendme(): requests.get(baseurl+'/rr_connect?password=reprap') requests.post(url, data=upload_in_chunks(afile, chunksize=10))
-
Custom gcode upload function in python - RRF HTTP server options
I try to write a simple python software to upload gcode to a machine in async manner.
I have it working synchronously by passing an iterator to request object, but I need async to send lots of files to different machines.
A file is divided into chunks and each chunk is an async task.
The problem is that subsequent chunks gets uploaded in separate POST requests as separate files, overwriting each other, so the uploaded file has last chunks size.I've set the X-File-Id header but it does not seem to work.
So the question is is it at all possible to send one file in many POST requests to RRF?
-
Gcode upload problem on linux
I cannot reliably upload a g-code file via DWC on a Linux Mint 21 machine. It starts and after proceeding for a while the connection goes down and upload fails. The printers have Duet 6HC boards with 3.4 firmware. Uploading from W10K works normally, only on Mint it fails, I tried Firefox and Brave, same result, no matter what connection settings are in the DWC. Perhaps there are some networking settings I don't know about. Did you have any problems alike?
-
RE: Two different motors used by E0
@deckingman
Ofcourse! Thanks a lot it's so elegant! -
RE: M567 Tool-Mixing issues/quirks
@oozebot So it is a loop. What a nice idea.
-
RE: Two different motors used by E0
When 2 motors are connected this way is it possible to drive only one of them (to load filament)
One way would be to create a dummy tool :M563 P1 D1
and driving it :
T1
G1 E1500 F1000but it is too much of a hack.
I know there is M302 P0 to allow cold extrusion, but is there a
way to force a certain piece of silicon on the board to feed pulses to connected motor? -
RE: M567 Tool-Mixing issues/quirks
Great, happy to hear it!
What do you mean by "loop"? Is it a physical loop of filament? Where is it placed in the printer?
I've just connected the secondary extruder (42mm NEMA 17), set it to 300 mA, and mixed so it extrudes more than tha main extruder.
We'll see how far it goes -
RE: Two different motors used by E0
@dc42 Thanks a lot! works like a charm!