What is the problem?
I want to use the SSH Tunneling through Spaghetti Detective to get to my OctoPrint when I'm away and would like the Pi to send a magic packet over LAN to turn on my PC when I'm away from my home wi-fi
What did you already try to solve it?
Researched online but haven't found any supporting documentation.
Since I already have the tunnel to the OctoPi I thought I could put something in there to send this request or build a plugin if I have to. Just wanted to see if any other users have ever tried their hand at creating/doing something like this!
Is Spaghetti Detective using SSH tunneling to connect to your OctoPrint instance? That doesn't sound like something that would have been approved on the plugin repo during review.
In any case, if you can find the linux command to send the magic packet you could use Event Manager to do run it on specific events (ie, PrintStart, PrintFail, etc.). The other option would be using GCODE System Commands to run the command from a button you add using Custom Controls in config.yaml.
I get the error pop-up when trying to select "System Update"
{"error":"Command does not define a command to execute, can't proceed"}
When I put the command in the action like
- action: systemupdate
command: sudo apt update
name: System Update
I get:
{"error":"Command for custom:systemupdate failed: 500 Internal Server Error: Command for custom:systemupdate failed with return code 1:\n\nSTDOUT:\n\n\nSTDERR:\nsudo: no tty present and no askpass program specified\n"}
Not sure if I'm heading in the write direction or if I'm testing this correctly - I'm new to YAML and Linux.
separate issue to the original request, but the problem is that you're using sudo. that isn't allowed because you have to enter the password when running those commands. you could add a sudoers rule to allow passwordless running of the apt command, that is why sudo service and sudo shutdown work. this is the command that is run to support it on the octopi image.
There are some really great suggestions in the thread (thank you everyone!!) but I don't have the technical understandings of Linux/Python to do what is being asked
Just returned home from vacation, I saw your suggestion and customized a python code i found to send a wol packet. how do you suggest i use the code with octoprint and connect it to a button. already tried using octoprint system command editor to no avail
i feel like this isn't a good solution, after some testing i found that it only works if the phone is on the same network as the pc. so I have started to work on a wol plugin for octoprint. wish me luck