New JSON response on M408 S2 status
-
Hi, I noticed little issue with JSON responses on M408 S2 and M408 S4 with new firmware (2.01+). I am parsing these responses and noticed that it stopped getting me 'heads' temperatures after firmware upgrade. It was working all the time for at least one year now, last working firmware is 2.01beta2(RTOS) (2018-07-14b5). I could not find any details on this in WHATS_NEW.md documentation, so no idea if its feature or bug - and if I should rewrite my parser or it will be fixed
I am going to show you those responses for better understanding - same config:
old: M408 S2
{"status":"I","coords":{"axesHomed":[0,0,0],"xyz":[0.000,0.000,317.000],"machine":[0.000,0.000,317.000],"extr":[0.0]},"currentTool":0,"params":{"atxPower":0,"fanPercent":[100,0,100,0,0,0,0,0,0],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"sensors":{"probeValue":0,"fanRPM":0},"temps":{"bed":{"current":21.9,"active":0.0,"state":0,"heater":0},"chamber":{"current":20.8,"active":0.0,"state":0,"heater":2},"current":[21.9,30.6,20.8,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[0,2,0,0,0,0,0,0],"heads":{"current":[30.6],"active":[30.0],"standby":[0.0],"state":[2]},"tools":{"active":[[30.0]],"standby":[[0.0]]},"extra":[{"name":"MCU","temp":37.2}]},"time":344.0}new: M408 S2
{"status":"I","coords":{"axesHomed":[1,1,1],"xyz":[0.000,-120.000,280.736],"machine":[0.000,-120.000,280.736],"extr":[-3.0]},"speeds":{"requested":0.0,"top":0.0},"currentTool":0,"params":{"atxPower":0,"fanPercent":[100,0,100,0,0,0,0,0,0],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"sensors":{"probeValue":0,"fanRPM":0},"temps":{"bed":{"current":49.4,"active":0.0,"state":2,"heater":0},"chamber":{"current":22.0,"active":0.0,"state":0,"heater":2},"current":[49.4,88.0,22.0,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[2,2,0,0,0,0,0,0],"tools":{"active":[[0.0]],"standby":[[130.0]]},"extra":[{"name":"MCU","temp":37.3}]},"time":515.0}- you can see its missing "heads":{"current":[30.6],"active":[30.0],"standby":[0.0],"state":[2]}
My current firmware (where its not working):
Firmware Version: 2.01(RTOS) (2018-07-26b2)
WiFi Server Version: 1.21
Web Interface Version: 1.22.3- newest RC tested: not working either
Last working firmware (I just downgrade today for testing):
Pre-release Firmware Version: 2.01beta2(RTOS) (2018-07-14b5)
.. and previousSo the question is "new" JSON the new constant or still variable? Or just bug?
Thank you so much for support.If you have any questions about this behaviour feel free to ask.
Thanks, David.Btw thank you for fixing the M112
-
The "heads" field has been deprecated for a long time and far before the 2.xx firmware releases. It was removed several versions ago. Instead of "heads" the web interface now uses "tools.*.heaters" (from M408 S3), "temps.current" and "tools.[active|standby]" (M408 S2).
-
Ok, thank you. Can you please just confirm the pattern of that JSON. It looks that in that "current" json array the first one is "bed", second one "heater" and third is "chamber".
I find it little inconvenient, because right know I don't know what happen if I will add another heater. It will be:
a) "current":[bed,heater1,heater2,chamber,2000.0,2000.0,2000.0,2000.0]
or
b) a) "current":[bed,heater1,chamber,heater2,2000.0,2000.0,2000.0,2000.0]and what if I will have printer without chamber?
c) "current":[bed,heater1,2000.0,heater2,2000.0,2000.0,2000.0,2000.0]
d) "current":[bed,heater1,heater2,2000.0,2000.0,2000.0,2000.0,2000.0]Before I knew exactly what is what because there were:
heads":{"current":[30.6],"active":[30.0],"standby":[0.0],"state":[2]}
"bed":{"current":21.9,"active":0.0,"state":0,"heater":0}
"chamber":{"current":20.8,"active":0.0,"state":0,"heater":2}Thank you, I am just trying to figure out parser that will work for most of my use cases. Thanks
-
@david The "current" field holds the current temperatures of all the configured heaters including bed+chamber heaters. You need to have a look at the tools.*.heaters arrays to get the corresponding indices for the "current" field (type 2). Bed and chamber still provide separate "current" fields for the temperature so you don't need to worry about that. See https://reprap.org/wiki/RepRap_Firmware_Status_responses for futher details.