Sending orders to plugin via SSH or CURL #99

Closed
opened 2018-03-01 21:34:42 +00:00 by StudioKamar · 1 comment
StudioKamar commented 2018-03-01 21:34:42 +00:00 (Migrated from github.com)

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.

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.
vitormhenrique commented 2018-03-01 21:41:32 +00:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#99