Sending orders to plugin via SSH or CURL #99
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello
I'm using printoid (https://printoid.net) a lot. This for me is more useful that my printer LCD i also use Enclosure plugin a lot. I wonder is there any possibility to send to the plugin commands via SSH or CURL so i can for example make led lights on off buttons in enclosure plugin to control a relay and make custom buttons for that in my printoid software ?
I also wrote to the author of printoid to try implement enclosure controls such as temp and so on to printoid software.
Yes, you can make http requests with CURL and do pretty much everything that you can do from the ui.
For example, you can send a request like this to set outputs on or off:
http://{URL}/plugin/enclosure/setIO?status=false&index_id=1&apikey={APIKEY}
Note that index_id is the number under settings for that output, and status is true to turn it on and false to turn the output off.
You can request current gpio status with
http://{URL}/plugin/enclosure/getOutputStatus?apikey={APIKEY}
If you go on the enclosure.js file, everything that has a $ajax function are request, and the data sent is basically what you need to provide.