I am trying to run a wget command when a custom action is triggered using the ActionCommands plugin.
the action is "materialempty"
the test with type 'gcode' and command 'M114' works
the test with type 'system' and command 'wget ...url...' doesn't work
(also tried 'sudo wget ...url...)
the wget command works in the terminal on the same machine
pretty important maybe: I am running octoprint on ubuntu
does it has to do with rights?
what usefull information can I post to get the question clear...
cheers / joris
thanks to @jneilliii, but also the other replies
probably will need to enable debugging for the action commands plugin and then try the process and then share your logs.
On the Ubuntu terminal or the OctoPrint terminal (what would me make wonder)
You can't access the backend (Putty, CLI) not from the frontend (OctoPrint).
wget command in the ubuntu terminal...
I am not a ubuntu/terminal expert at all, do you mean you cannot acces the wget?
how to bypass that, with a bash script and then run the bash script?
(how would the bash script look like then and where to store the bash script?!)
yes, good suggestion...!
but running quite a long print at the moment, so not the possibility to do that...
another thing to consider is that just running
wget won't work, you need to include the full path to the executable, because there is no "Path" environment loaded I suspect. Try with
May 24, 2023, 8:17pm
You can try to grant wget passwordless sudo permissions
Create a rule by adding a new file in the folder /etc/sudoers.d/octoprint-wget for example.
Then add to the file:
your_pi_username ALL=NOPASSWD: /usr/bin/wget
You shouldn't need sudo to use
wget, and if you do you'll likely just end up with the wrong permissions on whatever it has downloaded.
this didn't work unfortunately....
this didn't work either unfortunately....
I am not downloading anything, just want to activate an scenario at make/integromat to send out an email and/or slack message so I can see when the material is empty.
The trick is I want to make it work while octoprint is printing and cannot be restarted, so with the plugins already installed... : )
I think I am pretty close, but cannot figure why the command is not working...
I know I had similar problems with the shutdown command, I think I fixed that somehow, but cannot test at the moment. It had to do with Ubuntu (vs rapberry pi) iirc.
found sonmething in the logs...!!
the 'sudo wget' returned: 256
the 'wget' returned 1024
haven't found the answer yet...
as usual a user error, my fault...
I tested the gcode version with the same action, but disabled, that caused that the enabled version wasn't executed either.
After that I changed to the full path, but it was never triggered. This I found in the logs (thtanks for the tip!!)
removing the gcode version and using the full path made it work.
Thanks for the help...!!!
cheers / joris