Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT subscribe on OctoPrint does not work. #117

Open
molodeztom opened this issue Mar 13, 2022 · 4 comments
Open

MQTT subscribe on OctoPrint does not work. #117

molodeztom opened this issue Mar 13, 2022 · 4 comments

Comments

@molodeztom
Copy link

I am using Octoprint Plugin from here.
So I have a MQTT Broker on a separate raspberry "Controller".
I recieve MQTT Messages on the "Controller" as described for temperatures and so on. This works well!

Additionally I want to shutdown the OctoPrint Raspberry by sending an MQTT command to OctoPrint-MQTT plugin.

To do so I utilize the mqtt_subscribe helper by a modified mqtt_test.py file in the plugin folder.

I would expect the MQTT plugin to recieve the shutdown message and answer "Yay, recieved..." then shutdown the pi.

But since the Octoprint update to the latest python version it does not work anymore.
I do not get the message "Yay, recieved…." nor does it shutdown.

Version of OctoPrint: V1.7.3 OctoPi 0.18.0 on Pi3 env.python.version: 3.7.3

Version of the MQTT plugin: 0.8.12

@jneilliii
Copy link
Collaborator

This plugin only is for sending data out, it does not react to messages received from outside messages pushed to a topic IIRC. That was why I made the MQTT Subscribe plugin.

@molodeztom
Copy link
Author

Thanks for an immediate answer. So the sample script does not work anymore? The Subscribe plugin does only support Octoprint REST API. Do you have a hint how to issue a raspbi shutdown command with this api?

@molodeztom
Copy link
Author

Ok I think I found it myself.
REST API: /api/system/commands/core/shutdown
REST Parameters { "confirm"."0" }
or maybe
REST API: /api/system/commands/
REST Parameters { "source"."core", "action"."shutdown", "confirm"."0" }

@jneilliii
Copy link
Collaborator

I believe it's the first one, and I don't think it has any additional parameters necessary so you don't need the confirm I don't think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants