-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
[Question]: Is it possible to power on the smart plug when Octoprint starts? #204
Comments
There is a way, although a little convoluted. Create a new file called startup.sh in
after creating the file you need to run this command to make it executable.
and then edit your config.yaml to include the startup event by adding this.
|
Thanks a lot for your answer! But it doesn't work yet.
Works after removing the S from HTTPS. Now it turns on my printer like it should.
When I add this lines to my config.yaml and restart Octoprint it crashes. The status is active (exited). Nothing written to ~/.octoprint/logs/octoprint.log Do you have an idea why? |
The space indentation of those lines are extremely important in config.yaml. Just make sure that you match up the space indentation in the areas around it. Some config.yam files use 2 spaces, others use 4. Just make sure it matches the way it looks elsewhere. |
Thank you, now everything works! I replaced the tabs with 4 spaces and this fixed the problem. Then it showed the following error in the logs:
I fixed it by adding @jneilliii Is it possible to add this directly to the plugin? That you have a checkbox for every object in the web interface: Power on when Octoprint starts |
Yes, it's possible. I was just giving you a temporary solution until I'm able to get around to making the change. |
@jneilliii Thank you a lot! I am looking forward to the feature. |
Startup event monitoring implemented in the above commit and will be included in next release. If you want to try it out you can install by copying/pasting the URL below in plugin manager > get more > ...from URL and clicking install.
|
Thank you a lot for implementing, but I have just tested it and it does not work. When I just restart Octoprint it works, but when I restart my whole Raspberry Pi it does not work. I had exactly the same problem with my script. I have solved it with adding sleep 5 before the turn on command, but maybe there is a better way to solve this. |
Interesting, I'll have to do some additional testing with a full power up. I was just testing by restarting octoprint from the system menu. |
Okay, thank you! |
@jneilliii Thank you for your work, but I still have this problem:
|
Sorry @Alwinator I forgot to test a full power on. Probably just need to move the stuff into a different startup event section. |
I think I got this startup issue really resolved now. I have tested with my pi here going from a cold boot and it works as expected here. If you want to test it out you can copy/paste the URL below into plugin manager > get more > ...from URL and clicking install.
|
@jneilliii Thank you a lot! It works perfectly! |
Great news, thanks for reporting back. |
It would be very convenient. By the way thank you for your great plugin! Thank you in advance.
The text was updated successfully, but these errors were encountered: