Thermo Fan values in JSON responses
-
I can obtain the following JSON response either via http or from the Panel Due serial port
{"status":"I","coords":{"axesHomed":[0,0,0],"wpl":1,"xyz":[0.000,0.000,0.000],"machine":[0.000,0.000,0.000],"extr":[0.0]},"speeds":{"requested":0.0,"top":0.0},"currentTool":0,"params":{"atxPower":-1,"fanPercent":[0,0,0,10,100,100],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"seq":0,"sensors":{"probeValue":524,"fanRPM":[-1,-1,-1,-1,-1,-1]},"temps":{"bed":{"current":21.5,"active":0.0,"standby":0.0,"state":0,"heater":0},"current":[21.5,21.4],"state":[0,2],"tools":{"active":[[0.0]],"standby":[[0.0]]},"extra":[]},"time":24.0}
The "fanPercent":[0,0,0,10,100,100]," only seems to show the correct value for non-thermostatically controlled fans. For the thermo fans it shows whatever the maximum defined value is from the M106 S parameter. In this example the value 10 is for my LED lights on fan3 (duex2) which are non-thermo. The two at 100 are both thermo fans and always show 100 regardless of actual speed.
Not sure if this is correct behaviour or not or down to them being on the duex not main board. Is there another way of getting the current fan speed (the S value not RPM) as a JSON response. It can be obtained as a console msg in DWC by running M106 Pn so it must be available somewhere. -
Further info:
config.gBoard: Duet WiFi 1.02 or later + DueX2
Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.0RC2 (2019-12-29b1)
Duet WiFi Server Version: 1.23
Duet Web Control 2.0.4If I execute M106 P4 from console in DWC I get back:
M106 P4 Fan 4 (Enclosure Fans), speed: 100%, min: 40%, max: 100%, blip: 0.10, temperature: 26.0:65.0C, sensors: 2 3, current speed: 40%:
P4 is the enclosure fans which are currently running. Maybe I need to dig through the DWC code to see where it gets the '40%' value from.
-
Ok. Just looked at the javascript console in Chrome to see what happens when I send that M106 P4 in DWC.
I see the expected
http://192.168.1.104/rr_gcode?gcode=M106%20P4
About 16mS later DWC sends an rr_reply request
http://192.168.1.104/rr_reply
which, suprise suprise has the response
Fan 4 (Enclosure Fans), speed: 100%, min: 40%, max: 100%, blip: 0.10, temperature: 26.0:65.0C, sensors: 2 3, current speed: 40%:
I did't see any mention of rr_reply in any docs I have seen.
Next question is can I get that information via the Panel Due port?
-
Found this old post that gave me a hint.
So sending the followingM106 P4 M408 S0 R1
to Duet via the Panel Due port gives me the data I want. Response to the M408 is
{"status":"I","heaters":[21.5,21.1],"active":[0.0,0.0],"standby":[0.0,0.0],"hstat":[0,2],"pos":[0.000,0.000,0.000],"machine":[0.000,0.000,0.000],"sfactor":100.00,"efactor":[100.00],"babystep":0.000,"tool":0,"probe":"525","fanPercent":[0.0,0,0,0,24,100,100,-1,-1,-1,-1,-1,-1],"fanRPM":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"homed":[0,0,0],"msgBox.mode":-1,"seq":20,"resp":"Fan 4 (Enclosure Fans), speed: 100%, min: 40%, max: 100%, blip: 0.10, temperature: 26.0:65.0C, sensors: 2 3, current speed: 40%:\n"}
with the message text in the "resp" field at the end of the JSON response. Just need to extract & parse to get the value I want (40%).
The reason I'm doing all this is to put a simple 20x4 LCD on the front of my Duet enclosure showing some basic info. Especially the hotend fan speed as the fan I now have on the Titan Aero is so quiet I can't tell if it is running or not (Noctua 40x20mm). The stock Titan fan sounds like a jet taking off in comparison.
I want to also develop some kind of SMS or email messaging out of the connected RPi to warn of certain conditions or let me know when the print has finished (I'm usually sat in another room watching the telly).