Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating mesh from printer clears all custom system actions defined in config.yaml #228

Closed
ghost opened this issue Apr 21, 2020 · 32 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 21, 2020

When the "Update mesh now" button is clicked, it clears all custom actions under the system section of config.yaml after updating the mesh.

Steps to reproduce:

  1. Click "Update mesh now".
  2. Refresh OctoPrint's UI.
  3. Check config.yaml see any custom actions defined under the system section disappear. Instead you see system: {}.

Octoprint version: 1.4.0
BedLevelVisualizer version: 0.1.13 (latest)

@ghost ghost changed the title Updating mesh from printer clears all system actions defined in config.yaml Updating mesh from printer clears all custom system actions defined in config.yaml Apr 21, 2020
@jneilliii
Copy link
Owner

Can you provide an example custom system command you had configured? Also, are you using a plugin to set those or manually adding in config.yaml?

@ghost
Copy link
Author

ghost commented Apr 22, 2020

I have tried using the System Command Editor (https://plugins.octoprint.org/plugins/systemcommandeditor/) and tried editing config.yaml manually to create two actions. Both times, updating the mesh clears the custom actions. The actions are:

system:
    actions:
    -   action: poweron
        command: gpio -1 write 16 1
        confirm: false
        name: Power on printer
    -   action: poweroff
        command: gpio -1 write 16 0
        confirm: This will turn off the connected 3D printer.
        name: Power off printer

I use these actions to turn my 3d printer on and off using the telegram bot and as an alternative to PSU Control from the Power menu in Octoprint.

Ignore the incorrect indentation. I can't seem to get it right.

@jneilliii
Copy link
Owner

Thanks, I'll do some testing on my end and try to find out what's going on. No worries on the formatting, I fixed it up for you.

@jneilliii
Copy link
Owner

This appears to be an issue reported a while back on the System Command Editor plugin's repo over here with other user's reporting the same thing. The last couple of reports are from user's that were seeing it with Bed Visualizer. Does it also happen if you disable System Command Editor completely and manually update the system commands?

@ghost
Copy link
Author

ghost commented Apr 23, 2020

My troubleshooting steps involved the following:

  1. Both Bed Visualizer and System Command Editor installed.
  2. Custom system commands defined.
  3. Updated mesh.
  4. Lost custom system commands.
  5. Re-defined custom system commands using System Command Editor.
  6. Updated mesh.
  7. Lost custom system commands.
  8. Uninstalled System Command Editor.
  9. Restarted OctoPrint.
  10. SSH'd into OctoPrint and defined custom system actions in config.yaml.
  11. Updated mesh.
  12. Lost custom system actions.
  13. Uninstalled BedVisualizer.
  14. Restarted OctoPrint.
  15. Confirmed custom system actions persist across server restarts and reboots.

I hope this makes sense.

@jneilliii
Copy link
Owner

Ok, just did some testing on my development machine and the commands don't appear to be deleting falling these steps.

  1. Uninstall System Command Editor
  2. SSH to the Pi
  3. Run command sudo service octoprint stop
  4. update config.yaml with your commands. For my testing since I'm on windows I modified to open notepad and calc for the two commands.
system:
    actions:
    -   action: poweron
        command: notepad.exe
        confirm: false
        name: Power on printer
    -   action: poweroff
        command: calc.exe
        confirm: This will turn off the connected 3D printer.
        name: Power off printer
  1. run command: sudo service octoprint start
  2. Open web page, update mesh: no changes to system commands
  3. restart OctoPrint: no changes to system commands
  4. Update mesh: no changes to system commands

I'm about to test on a pi to verify these steps on it as well, but wanted to give you my initial findings.

@jneilliii
Copy link
Owner

So several tests with the above steps seem to work for me. The system commands stick no matter how many times I restart OctoPrint or run Update Mesh, etc. I have not been able to reproduce this issue.

@ghost
Copy link
Author

ghost commented Apr 23, 2020

Thanks for taking the time to investigate this. I will run some tests again and come back to you.

@ghost
Copy link
Author

ghost commented Apr 23, 2020

This is very strange. The troubleshooting steps I performed above definitely confirmed the issue, but now I have reinstalled Bed Level Visualizer and System Command Editor and tried them again and the issue is gone. This is so strange. I'm going to try a couple more things and get back to you. Thank you.

@ghost
Copy link
Author

ghost commented Apr 26, 2020

I have reinstalled Bed Level Visualizer and System Command Editor, but I didn't use the latter to define custom actions. My custom actions were defined manually in config.yaml. I tried updating the mesh several times and it didn't clear my custom actions. This morning, I turned my printer on using PSU Control and clicked connect in OctoPrint. Once connected to the printer, I clicked Update Mesh Now and it immediately cleared my custom actions.

I don't think it happens every time, but it happens under specific conditions. Would there be some place where I can look at logs or send them to you to investigate?

@jneilliii
Copy link
Owner

Logs probably won't help in this case if the issue isn't consistently reproducible. Does it do it every time with psu control process?

@ghost
Copy link
Author

ghost commented Apr 26, 2020

No, it doesn't. I turn my printer on and off heaps of times and it doesn't clear the custom actions ever. This time I turned the printer on, clicked Connect and waited for the Update Mesh Now button to be enabled. Once it was enabled, I clicked on it, and silently my custom actions vanished.

@ghost
Copy link
Author

ghost commented Apr 28, 2020

Any progress on this issue? Do you need me to do any further troubleshooting?

@jneilliii
Copy link
Owner

Nothing yet. I still haven't been able to reproduce, but have been trying.

@EagleB3
Copy link

EagleB3 commented May 8, 2020

Today I had a very similar problem. I do not think that it requires a separate issue topic. Rather, it is an idea of ​​possible causes ...

I have been using the "Custom Control Editor" plugin (v.0.2.2) for a very long time. Later, "Bed Visualizer" was added, and later, "Terminal Commands Extended". All this without problems was jointly operated on OctoPrint 1.3 and 1.4.
Yesterday I performed a Raspberry software update ("apt-get update" + "apt-get upgrade"). And today I got a problem - right after building the mesh ("Update Mesh Now"), the Custom Controls buttons disappeared from the "Controls" tab - the corresponding section was deleted in the "config.yaml" file.
The plugin "Custom Control Editor" continued to work - with its help it was possible to create buttons and sections for "Custom Controls", they were saved, and displayed normally after restarting OctoPrint. But they disappeared after building the mesh ("Update Mesh Now") - the section was also deleted.

After disabling the "Custom Control Editor" plugin, the problem ceased to appear. For verification, I turned on this plugin again - and the problem resumed.

Besides the Raspberry update ("apt-get update" + "apt-get upgrade"), I haven’t done any changes / updates for three weeks now. During this time, I printed a lot, and each time before printing I did the construction of the grid. There were no problems.

By the way, the "Python 3 Check (0.1.3)" plugin reports that "Custom Control Editor v.0.2.2" is not compatible with python v.3.6

@ghost
Copy link
Author

ghost commented May 9, 2020

Thank you, @EagleB3. I hope this can help @jneilliii get to the bottom of this.

@jneilliii
Copy link
Owner

@Salandora has actually identified an issue with the Custom Control Editor and System Control Editor plugins that is causing this issue and is currently working on rewriting them both. I still recommend Setting up your system controls/custom controls using his plugins and then saving, and then disable both immediately after.

@jneilliii
Copy link
Owner

@DuDecancoDe there's a prerelease version of system commands that might fix the problem for you. Salandora/OctoPrint-SystemCommandEditor#5 (comment)

@jneilliii
Copy link
Owner

Warning, that system commands editor version is very buggy...he's working on it.

@ghost
Copy link
Author

ghost commented Jun 6, 2020

Thanks, @jneilliii. I appreciate you looking into this for me. Your plugins is pretty awesome and I use it often.

@jneilliii
Copy link
Owner

Yeah, again the issue is in the other plugin and how it loads/saves settings. I supplied a fix to the other plugin or you can setup all your buttons and then disable the custom control plugin. It's not required to be loaded to be able to function, it just needs to be loaded to make it easier to setup your buttons.

@EagleB3
Copy link

EagleB3 commented Jun 6, 2020

@jneilliii , Many thanks!

Just because of my poor knowledge of English, I did not understand one aspect. You wrote: "I supplied a fix to the other plugin" - you sent a variant of possible corrections to the author of the plugin (Salandora ?), and now we are waiting for him to fix his plugins?

And, taking this opportunity, I want to ask: did the buttons made to you (in plugins "Bed Level Visualizer" and "Terminal Commands Extended") support the execution of external script files (* .gco)? I am referring to an analog of the opportunity provided by config.yaml, for example:
- confirm: 'Find table by probe in CURRENT nozzle position?'
name: Find table
script: custom / FindTable.gco

@jneilliii
Copy link
Owner

you sent a variant of possible corrections to the author of the plugin (Salandora ?)

Yes, that is correct. I don't know if he's even considered the merge because I know he plans on re-writing the whole plugin though. The pull request is here and the related issue is here.

support the execution of external script files

No they do not, just the ability to send configured GCODE commands.

@EagleB3
Copy link

EagleB3 commented Jun 6, 2020

@jneilliii , Many thanks!

@jneilliii
Copy link
Owner

jneilliii commented Jun 6, 2020

No problem. If you want to install my patched Custom Control you can do so by installing it using this URL in plugin manager and it should resolve the issue, if Salandora doesn't get around to merging the change for a while. The only thing you won't be able to do is delete all the custom controls.

https://github.com/jneilliii/octoprint-customControl/archive/devel.zip

@EagleB3
Copy link

EagleB3 commented Jun 6, 2020

@jneilliii ,
I installed the plugin from your archive and performed the first checks (edited congig.yaml, saved the results, built a bed table, saved the results. Control panel settings did not change and did not disappear. After octoprint reloaded, the Control panel settings also did not change and did not disappear.

P.S. The buttons you made in your plugins are much more convenient than the "standard" buttons. The standard buttons really lack pop-up hints ...

P.P.S. Thank you, thank you very much!

@yvessa
Copy link

yvessa commented Jun 7, 2020

Hello, Is there a way to get back Custom Control commands after hitting bed mesh update? I lost everything. I looked at config.backup but nothing. Thank you

@jneilliii
Copy link
Owner

Not that I know of

@EagleB3
Copy link

EagleB3 commented Jun 7, 2020

@yvessa , I'm afraid that nothing. Some time ago, the "Custom Control commands" plugin stopped correctly creating a backup copy of the "config.yaml" file before saving the edited file. issue

It’s a good idea to periodically back up the entire Raspberry SD card image, or at least the Octoprint directory.

@yvessa
Copy link

yvessa commented Jun 7, 2020

Yep lesson learned today :) I had a pretty long custom commands list... Thanks

@jneilliii
Copy link
Owner

That really sucks @yvessa, sorry that happened. Yeah the new backup restore option in settings is definitely a benefit in those situations. Especially without including files/timelapses for speed. Would be beneficial to have that possibly on a schedule. Maybe a good plugin idea. Might even be possible via CLI cron jobs, but I'd have to check.

@jneilliii
Copy link
Owner

closing since issue is not with this plugin, but other plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants