Open ProbablyAnds opened 2 years ago
If (and only if) connection is succesful, it takes a bit of time before the printer comes online and allows sending commands. What happens if you uncomment the following line? (I.e. drop the hash '#' symbol)
#while not p.online : time.sleep(1)
The program just waits forever on all branches. The ardiuno connects perfectly fine with pronterface, but just not through the python code.
My end goal is to have a raspberry pi camera attached to the printer head, instead of an extruder, so I can move the head to predefined points in order to take photos every set time interval. Thus I don't think I would be able to import the raspberry pi python camera library using gcode marcos with !.
Would it be a better idea to use octoprint? do you have any other suggestions?
The ardiuno connects perfectly fine with pronterface, but just not through the python code.
Well if Pronterface works a code similar to what you propose above should work. Apart from [allowing the printer to connect][1]. Things that come to mind:
import time
G0 x100 y0
might not work straight away. Try sending command G28
(which homes all axes) first.
from printrun.printcore import printcore
from printrun import gcoder
import time
p=printcore('COM5',250000) while not p.online : time.sleep(1)
p.send_now("G28") # home all axes, should see some response from the printer by now p.send_now("G0 x100 y0")
[1]: https://github.com/kliment/Printrun/issues/1243#issuecomment-1048490972
Try dtr param and the many other proposals in here https://github.com/kliment/Printrun/issues/1201#issuecomment-885250173 Try to push the hardware reset button of arduino or this plug out its power while the script is looping in the while statement. Enable p.loud to see if you are using marlin with broken 'start' command.
Hi there, Ive tried with mutliple different branches of the project to no avail. I am using a Ardiuno Mega 2560, with a Ramps 1.4.
`from printrun.printcore import printcore from printrun import gcoder p=printcore('COM5',250000)
while not p.online : time.sleep(1)
If you need to interact with the printer:
p.send_now("G0 x100 y0") # this will send M105 immediately, ahead of the rest of the print `
I have this in the init.py folder and I get this output ERROR:root:Not connected to printer.