Intergration with home automation
-
Last Christmas I was given an Alexa, and I didn't want it...
Now i'm too lazy to walk to the radio to turn it on, and the light switches are going the same way.
But as I walk down the road of home automation, it seems that the printer is a thing that I would really like to get stats on (and do things like trigger a light flash when done).
Can the status be polled simply over HTTP, or is there any way to get status over SSH (even firing GCODE at it would be sufficient).
I'd like to get Hotend/Bed/homeing/printing. I could infer "printing" by looking at the print head position and alter the end gcode.
-
Writing this post made me think more carefully about search terms, they lead me to find a partially unhelpful thread, which gave me more search terms......
And that lead me to https://devhub.io/repos/chrishamm-DuetWebControl
TLDR;
-
Also worth a look:
https://reprap.org/wiki/RepRap_Firmware_Status_responses -
@Willl said in Intergration with home automation:
I'd like to get Hotend/Bed/homeing/printing. I could infer "printing" by looking at the print head position and alter the end gcode.
Are you comfortable hooking up a arduinos and writing firmware for them?
If so, you may want to look at this project https://github.com/zapta/misc/blob/master/duet3d_monitor/board/board-schematic.pdf it sniffs the paneldue's serial communication and extract signals such as temp and status.
-
Or this one:
https://github.com/DanalEstes/DuetMonitor
It is a fork of someone else's original work; I did change a fair amount, and can certainly answer questions about how it works.
At the same time. @Willl point about http://The.printer.local/rr_status?type=1 really is the whole thing... that will return something like:
{"status":"I","coords":{"axesHomed":[1,1,1],"wpl":1,"xyz":[0.000,0.000,615.910],"machine":[0.000,0.000,615.910],"extr":[0.0]},"speeds":{"requested":0.0,"top":0.0},"currentTool":0,"params":{"atxPower":0,"fanPercent":[0,100,0,0,0,0,0,0,0],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"seq":0,"sensors":{"probeValue":0,"fanRPM":0},"temps":{"bed":{"current":20.1,"active":0.0,"standby":0.0,"state":0,"heater":0},"current":[20.1,19.5,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[0,2,0,0,0,0,0,0],"tools":{"active":[[0.0]],"standby":[[0.0]]},"extra":[{"name":"*MCU","temp":33.0}]},"time":1776413.0}
The "status" key gives you most of what you asked for in your first post. At the moment the above sample was requested, the printer was "I" - Idle. It could also be: P=Printing. S=Suspended (paused). And so forth.
You do need to poll it. For Home Auto, once a minute should be just fine.