Salandora / octoprint-customControl

This plugin makes Custom Controls editable through the OctoPrint WebUI
GNU Affero General Public License v3.0
25 stars 15 forks source link

Update deletes all buttons #32

Open energiebrand opened 4 years ago

energiebrand commented 4 years ago

Unfortunately all my button (containers, commands) are deleted after the update from today. I am running a RPi 3B with OctoPi 1.4.0 on Octroprint 0.16.0. I created them new, stored them and they seem to be working (I am running a print currently, so I cannot check in deep, but I can control the LED on a Sidewinder x1 during the print...) Would be great if I will get a warning before the update that the configuration will be deleted with this update, so I can make some screenshots in before. On the other side if this behaviour was not expected from your side I think this is a bug...

However a very good PlugIn!

energiebrand commented 4 years ago

In addition... unfortunately after switching off and on the RPi I can see that all configuration are non more existent. So they where not saved! This means you can define them, save them, use them but after power off they are gone...

mralko99 commented 4 years ago

Same here, possible solution?

mralko99 commented 4 years ago

I solved, so I made 2 things, 1. I update python to 3.8.3rc1, but I don't think that's the problem, 2. erase all the plugin data from plugin manager

p.s. not working anymore, nice

Silventar commented 4 years ago

I have the same issue. After update, all my custom buttons are gone.

Even if this is solved for future releases, I would like to suggest a new feature: we need to have the ability to easily export and import our custom buttons to a backup file.

Silventar commented 4 years ago

Ok, new information. I spent 30 min adding back in essential (to me) custom commands. Tested, worked, good. I started a print AND THEY ALL DISSAPEARED. Gone. Poof. Noting in the display. When I go to the editor, they don't exist there. No containers, no commands. Jus gone.

yet-another-average-joe commented 4 years ago

Thanks for the info, guys ! I was just looking here about issues before updating, just in case.

I know it's a bit late now for some of you, but settings are easy to backup ; configuration for the buttons is stored in /home/.octoprint/config.yaml

Knowing this, you can easily backup the whole file using a SSH client, with a couple of commands. Also, it's a good idea to backup an image of the whole SD card

The easiest way to maintain OctoPrint server (IMHO) is to share .octoprint and some other folders over the local network (samba shares). Probably not the safest, but the easiest. If you are under Windows, you will have to install SMB 1 and change a value in the registry, or the shared folder(s) won't appear in explorer.

Also, it's sometime easier and faster to edit and reorganize buttons directly in config.yaml, with some copy/paste ; definitions are under "controls.", with keys as "- children", - commands", etc.

Hope this helps.

How to backup config.yaml

command line : cd, ls, mv, etc. CC01

nano : you can copy text and paste it to a desktop computer CC02

doing the same from within Windows :

samba shares CC03

contents of .octoprint : CC04

editing and cpopying text from config.yaml using NPP (do NOT use Notepad !!!) : CC05

energiebrand commented 4 years ago

Hi Joe,

thanks a lot for these tips! Especially regarding the xxx.yaml it seems to be easy to manipulate these configurations. However do you plan to examine the behaviour of your PlugIn and will try to fix it or do you you think that this will work on most installations and we all have here an individual problem? Would be great to get a solution. Otherwise, I did not check if available, but maybe a fallback to a previous release could be a (temporary) solution.

yet-another-average-joe commented 4 years ago

I am not the author for this plugin !

Finally, I updated to 0.2.2 ; nothing went wrong, and all my 50+ buttons were still there. Then, I ceated a 2nd level container with a button, and also a 1st level one with another button : no issue.

Capture

(subcontainer "Container", 2nd level container sould be indented ; maybe a future feature request...)

On my side, I can't reproduce the problem.

Downgrading to 0.2.1 is easy : uninstall, then install 0.2.1 from : https://github.com/Salandora/octoprint-customControl/releases/tag/0.2.1

@energiebrand : I see you use OctoPrint 0.16.0 ; your OctoPrint is not the newest release (0.17.0). Could it be related ?

energiebrand commented 4 years ago

Hi Joe, ok, then it was a misunderstanding! But thanks a lot about your work and your help above!!! I think I will downgrade until a solution will come. So we have to wait what the developer will do! But as you see, I am not the only one but don´t know the SW/HW configuration the others have. I have a 2nd RPi (3B+) on a different printer but with 0.17.0. So I will check there and in before I will do a back up. Not so easy due to my complicated installation of the RPi.

However you are a lucky guy...with 50+ buttons...!!!

yet-another-average-joe commented 4 years ago

A backup is done everytime by OctoPrint when config.yaml is edited by a plugin (at least after editing buttons with Custom Control Editor...) : config.backup ; but it keeps the last version only (and this gives me an idea for a feature request on OctoPrint Git : having config.backup01, config.backup02 and so on would have saved your life). I will do it right now.

I forgot to say : I also issued apt-get update/apt-get upgrade after I tested ; the previous update/upgrade was after a fresh OctoPi/OctoPrint install, april, 18

config.yaml (and some other system files) were restored from a previous backup over the fresh install

energiebrand commented 4 years ago

OK, I will check the content of the back-up config.yaml. It should contain my buttons from my (re-)configuration I did after I saw that all were gone after the update. In addition, as you will see there was another guy some days before who has reported that he could not save new buttons (issue #31). I don´t know what PlugIn version he was using (before or after new plug in version...) Unfortunately today I cannot investigate. I will continue tomorrow, as well as I will check my other Octoprint installation...

yet-another-average-joe commented 4 years ago

I posted a FQ, but a contributor told me about the Backup/Restore feature ! Nothing's easier than doing an entire backup configuration before any change in OctoPrint ! Far easier and faster than all the crap I explained ! I've been using OctoPrint for 2+ years, and never payed attention, doing individual files backups and system imaging...

Conclusion : before any change, plugin install or update : backup ! If something goes wrong : restore !

energiebrand commented 4 years ago

I added a comment in issue #31 because it seems to be the same behaviour like there. Only addition is that still configured buttons are gone. However it is not possible to define buttons. They will be lost after reboot. More information in my comment in issue #31

PS.: I revert to old 0.2.1 version and it works. I can define buttons, reboot and they still remain!

energiebrand commented 4 years ago

Tested now on a RPi 3B+ with OctoPi 1.4.0 on Octroprint 0.17.0. Same behaviour. So I made here also I downgrade to 0.2.1, copied the relevant backup.yaml code into the faulty yaml and back to live. Works with old revision :-)

Salandora commented 4 years ago

Okay, bug is under investigation, thought I had it yesterday but turns out I was just miss reading my own code -.- Anyway the code base will receive a massive rewrite in the near future. Actually testing it for System Command Editor and if it turns out to work great you can expect an Undo/Redo for Custom Controls Editor :D and a code base that will not remove commands because of a higup...

Until then, please refrain from using this plugin or use it to create your custom commands and the disable it.

energiebrand commented 4 years ago

Well, thanks a lot! Works with the old release currently. If you will rewrite the code would you also please have look on the "Themeify" compatibilty. Not a big issue but with the dark themes it is not possible to see the letters in the configuration menu. The text (letters) there is also dark. In the GUI everything is fine (white letters). If you like to have an eye on it I can add a screenshot.

Salandora commented 4 years ago

yes please add a screenshot but maybe open a new issue for that, so we don't get 2 different issues in here. Thanks in advance.

Salandora commented 4 years ago

@energiebrand just a note you mixed it up Octoprint 1.4.0 and OctoPi 0.17.0 ;-)

Also it seems like I can not reproduce the problem. I installed Octoprint 1.4.0 and CustomControlsEditor 0.2.1. Created a container and a command with the editor. Restarted Octoprint -> Controls still there Updated CustomControls -> Controls still there Restarted Octoprint -> Controls still there Added new commands -> Controls still there

If someone can reliably reproduce the problem could you please make a detailed step by step instruction (including the names, actions and commands you used). Also please include a list of which plugins you installed.

Andrei-Pozolotin commented 4 years ago

same story here: controls are gone with octoprint 1.4.0 and this plugin 0.2.2

energiebrand commented 4 years ago

To all above... I droped back to the previous release and this works. However now I have big issues with the Dashboard PlugIn and Display Layer Progress. If I remove the Custom Control Editor everything works fine within these PlugIns but with CCE installed some informationss disappeard or RPi values get frozen. So maybe there are side effects...

jneilliii commented 4 years ago

So I have a reliable step by step for you @Salandora with the BedLevelVisualizer plugin, probably the same with a couple of other of my plugins (smartplug based ones). With your plugin installed and configured, install the BLV plugin and then setup your gcode to run a mesh leveling process. For a virtual printer for debugging you can use the below in the BLV plugin's settings. Once it's configured press the Update Mesh button on the BLV tab and poof...custom controls get removed from config.yaml. I cannot tell how/why this is happening. If I disable your plugin with the custom controls configured they are never removed. Can't tell if it's only the first update mesh process, as the second attempt this didn't happen.

@BEDLEVELVISUALIZER
!!DEBUG:send Bed Topography Report:
!!DEBUG:send -0.452 -0.319  -0.237  0.287   0.140   0.139   0.136   0.317   0.247   0.247
!!DEBUG:send -0.195 -0.273  -0.180  -0.178  0.014   0.018   0.111   0.214   0.210   0.210
!!DEBUG:send -0.270 -0.252  -0.151  -0.119  0.009   0.016   0.072   0.249   0.224   0.224
!!DEBUG:send -0.307 -0.205  -0.163  -0.124  -0.094  -0.002  0.036   0.151   0.174   0.196
!!DEBUG:send -0.186 -0.130  -0.152  -0.105  -0.144  -0.007  0.044   0.093   0.181   0.270
!!DEBUG:send -0.010 -0.077  -0.073  0.155   -0.006  -0.133  0.110   0.046   0.109   0.173
!!DEBUG:send 0.059  -0.094  -0.072  -0.002  -0.006  0.037   0.050   0.065   0.124   0.184
!!DEBUG:send -0.057 -0.028  0.039   0.028   0.024   0.005   0.102   0.165   0.176   0.187
!!DEBUG:send 0.067  0.015   0.096   0.117   0.001   0.079   0.138   0.346   0.185   0.185
!!DEBUG:send 0.071  0.014   0.061   -0.127  0.167   0.040   0.098   0.195   0.194   0.194
!!DEBUG:send ok
jneilliii commented 4 years ago

Ok, seems to happen after an OctoPrint restart to reproduce.

jneilliii commented 4 years ago

@Salandora changing to the below in your init.py will fix this....

    def on_settings_save(self, data):
        if len(data["controls"]) > 0:
            self._settings.global_set(["controls"], data["controls"])
jneilliii commented 4 years ago

Would recommend also getting rid of the settings import and using this as well...

    def on_settings_load(self):
        return dict(
            controls=self._settings.global_get(["controls"])
        )
jneilliii commented 4 years ago

Of course, this wouldn't allow you to delete all the custom controls, so might have to think of other logic for that,

energiebrand commented 4 years ago

Status from my side. Last days I have opened some issues for the PlugIns "Octoprint Display layer progress" #148 and "Octoprint Dashboard" (#163 #164 and cross reference issue #160). Those plugin owners are not able to reproduce ist but I continued investigations.

Firstly I went back to the previous "Custom Control" version. With this I was able to define new buttons, save them and they were available still after reboot. So everything fine with this. Then I copied from an old YAML all my buttons to the new YAML file. Everything works. Then some days later I made updates for "Display layer progress" and Dashboard PlugIn´s. Always after pressing a button of the Custom Control Editor, some features did not work anymore in the above listed PlugIns like frozen RPI values like CPU clock, no Layer duration time and some more. Now I removed the "Custom Control Editor" but all buttons were still available in YAML. So I deleted them manually. Now Dashboard and Display Layer Progress were working 100%. Finally I made acomplete new installation of the latest version of the Custom Control Editor, defined some buttons, saved and rebootet and now it seems that all problems are gone! So all 3 PlugIns seems to work. I will repeat this today on a second RPi to check if it works there also.

Here is my list how I will do:

I don´t know if that helps others but thats the way I did with my first RPi and I will do with my second with the same behaviour. Maybe there are incompatibilies with these 3 PlugIns which cam up after the last updates. I am not a SW developer, so don´t ask me to explain... I everything works I will close the issues for the other PlugIns but here for Custom Control Editior there seems to be definetly an issue bacause also others have here the same problem as I had.

energiebrand commented 4 years ago

Update! I had some issues in combination of the Custom Control PlugIn with Dashboard and Display Layer progress PlugIn. So I removed all 3 PlugIn´s, did a Sudo apt-get update & upgrade. Then I installed all 3 PlugIns on one of my RPI´s with all latest versions. On this RPi Custom Control PlugIn is now working without loosing data or impact on Dashboard or Display Layer Progress (Octoprint 1.4.0 on Octopi 0.17.0)

I did the same on my other RPi (Octoprint 1.4.0 on Octopi 0.16.0) Dashboard and Display Layer Progress are working now perfectly again, but here the same problem with the latest release of Custom Control Editor again. Buttons are not saved and gone after reboot. So I did a fallback to the old revision of Custom Control Editor. Here everything is now working!

So finally the issue here is still present on one of my Pi´s as on other users...

maukcc commented 4 years ago

For me this happens ever so often, with no specific cause. Just yesterday I went from the control tab to the terminal tab and then when I went back to the control tab, poof, everything gone.(also in config.yaml) What also happens, is that the width of all the buttons (in horizontal grid) gets set back to default 2. This happens every couple of days

maukcc commented 4 years ago

Did some further testing. And it has to do with the "active filters extended" plugin. @jneilliii When the "active filters extended" plugin is disabled everything works as expected. But when the "active filters extended" plugin is active... then it is a crapshoot. It does not matter which filter I toggle (on or off), it either sets the width of all the buttons (in horizontal grid) back to default 2. or it deletes the controls section in the config.yaml If it defaults the width to 2 first, then I can not get it to delete the controls section any more.

jneilliii commented 4 years ago

Interesting, have you tried with my patched version of custom controls? Use this URL in plugin manager.

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

maukcc commented 4 years ago

With the above plugin installed, and active filters extended installed, I could not get it to disappear completely, but the width does go back to default 2. With the custom control plugin uninstalled, everything (including the custom controls) works fine.

energiebrand commented 4 years ago

Did not see that there is a possible solution above. Since I had the problem now also permanently on my second RPi always after I made changes in other PlugIn configurations I removed the official release but kept the settings. Then I installed the above shown version. Will see if it works...

pediegoivan commented 3 years ago

I'm having the same problem here. After python 3 update

maxkool007 commented 3 years ago

Still happens, Every time I use it the commands are gone. I redo them. Use the printer for a while and when I go look to use them again they are gone. Completely useless in this state. Any suggestion?

jneilliii commented 3 years ago

Installing my fork will prevent that from happening until @Salandora can get around to fixing the save logic. Copy/Paste the URL below into Plugin Manager > Get More > ...from URL and click Install.

https://github.com/jneilliii/octoprint-customControl/archive/devel.zip
synman commented 2 years ago

this just bit me while implementing custom controls within a custom tab for a plugin I maintain. I thought for sure I had some latent code messing with "controls" in config.yaml.