Salamafet / ophom

Octoprint Philips Hue Outlet Manager
7 stars 1 forks source link

System command or gcode command #20

Open Ranney1 opened 3 years ago

Ranney1 commented 3 years ago

Dear all,

Is there a way to turn the wall plug on or off remotely? (Octopod)

Options:

Now I use M112 to turn it off remotely, but this is not the most elegant way. Thanks for help!!

Salamafet commented 3 years ago

Hi @Ranney1,

How is it possible to send GCODE if the printer is not powered ? What do you mean by system command ? Sorry but i'm pretty new with OctoPrint.

I have the idea to had an option for powering the plug if a data connection is try in OctoPrint. Do you think this is a good idea ?

Ranney1 commented 3 years ago

Hi,

Well, I'm really happy with the great plugin and all the great updates and support!

I'm controlling my printer with octopod (app for smartphone). This makes it for me now impossible to turn the plug on remote when it is off (after successful printing.) In this app, I can send GCODE to the printer (but this is off) and (I can system commands (raspberry terminal). So I was hoping that there is maybe an system command possible to turn the plug on/off remotely?

Thanks again for your help!

Salamafet commented 3 years ago

Thanks for your compliment.

I have recently install a same app on my Android phone. I have the same issue. I can't power On the printer. Hence the idea of power On the printer when a data connection is trying to establish.

Do you have a "Connection" button on your app ?

Ranney1 commented 3 years ago

Hi,

The connect button is visible in the app. So that is an option!

But maybe that this is an easier way: With 'system command edditor' it is possible to enter 'terminal commands' as shortcut. They are also visible in the app. What do you think that is the easiest way?

Thanks again for your help and time!

Salamafet commented 3 years ago

Hi,

Sorry for my late response. I have do not have a lot of time until October.

You can try use this request for toggle On or Off your printer: curl http://localhost/api/plugin/ophom?action=toggle This is the same request used by the navbar button.

Ranney1 commented 3 years ago

Hi,

No problem and take your time! The http request is not working because i can ony send GCODE or terminal commands. Maybe that i can do something with VPN. Thanks again for your time!

p.s. Is there a way to not 'toggle' the http command but instead send an 'on' or 'off' command?

Salamafet commented 3 years ago

This command should work in OctoPrint terminal. I have tested it this morning. Do you connect thought SSH ?

For the moment Ophom can't send specific status to the Hue Bridge.

Ranney1 commented 3 years ago

Sorry for my delayed response. No, i use the 'GCODE system commands' plugin. So i can send system commands by gcode. (for example, to start de cam stream as start GDOCE and stop de stream at the end of the print End GCODE)

I will play with it next week!

Salamafet commented 3 years ago

The command curl http://localhost/api/plugin/ophom?action=toggle doesn't work in the plugin "GCODE system commands" ?

I will create separated command for tuning On or Off the plug.

Ranney1 commented 3 years ago

Thanks! Looking forward for that option! 👍

Gyldenlow commented 3 years ago

Any update on this? 👀

Salamafet commented 3 years ago

No sorry 😕 With the current health situation, I have no quiet time to work on the plugin.

The external contributions are welcome 👍