thelastWallE / OctoprintKlipperPlugin

A plugin for a better integration of Klipper into OctoPrint.
GNU Affero General Public License v3.0
65 stars 14 forks source link

Save_config command not catched if not sent directly from OctoPrint #79

Open luco85 opened 2 years ago

luco85 commented 2 years ago

klippy.log.zip

Octoklipper v.0.3.9.4 Octoprint v. 1.7.2

klipper last version

Seems that after issue a save_config it not save data to config file. I see that mine bed_mesh not changes after run bed mesh calibrate. after some try i deleted the automatic data generated in printer file and restart bed mesh. after probing my probe macro issue save_config and after klipper firmware restart there wasn't bed mesh data in config file

luco85 commented 2 years ago

I found that the data of bed mesh are writed on printer file if I open it with sublime text but not isn't update in editor plugin If I use reload from file the editor show the correct data

thelastWallE commented 2 years ago

Hi, it should detect a save_config command and asks if you want refresh the editor after it. Let me check if i missed some behavior that prevents the command to be caught. Were do you send the save_config command? If you use the display on the printer then i need more work here, because the command then isn't going through OctoPrint.

luco85 commented 2 years ago

Hi! The save_config is issue automatically at the end of macro g29. No issue till this version.

thelastWallE commented 2 years ago

So the gcode command would be "G29" that got send from OctoPrint. And Klipper then internally runs this macro and executes SAVE_CONFIG at the end. The thing is that OctoPrint is not knowing that there was a SAVE_CONFIG command. I checked again in Klipper and as i just remembered correctly is that Klipper is not giving a response over the terminal after SAVE_CONFIG and just does a restart. So i can't easily catch the command and know that the cfg was changed to reload it.

After a little playing this through in the head the best i can do is catch the "G29" and then the connection gets lost i know that Klipper is restarting and then ask if one wants to reload the cfg.

I think i will create a PR for a gcode response just before klipper restarts or after the SAVE_CONFIG has written the new cfg.

-> We can actually use this: RESPOND TYPE=command MSG="SAVE_CONFIG" from Klipper G-Codes.md. Insert the [respond] section in the cfg to enable this. This would be placed in the G29 macro just before the SAVE_CONFIG command. I can check then for a response from Klipper that is: // SAVE_CONFIG and pop a dialog that is requesting a reload of the cfg file. I will work on it in the next 2 days.

luco85 commented 2 years ago

Ok! Thanks for your time