octoprint / octoprint-mqtt Goto Github PK
View Code? Open in Web Editor NEWAn OctoPrint Plugin that adds support for MQTT.
License: GNU Affero General Public License v3.0
An OctoPrint Plugin that adds support for MQTT.
License: GNU Affero General Public License v3.0
Updated the plugin to 0.8.5
The plugin keeps working
The plugin stopped working due to the last changes.
OctoPrint 1.3.11 running on OctoPi 0.15.1
0.8.5
Docker container from dockerhub: cyrilix/rabbitmq-mqtt
2019-09-29 10:50:23,839 - octoprint.plugin - ERROR - Error while calling plugin mqtt
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 219, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 82, in on_startup
self.mqtt_connect()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 299, in mqtt_connect
self._mqtt = mqtt.Client(client_id=client_id, protocol=protocol, clean_session=clean_session)
File "/home/pi/oprint/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 511, in __init__
raise ValueError('A client id must be provided if clean session is False.')
ValueError: A client id must be provided if clean session is False.
If i remember correctly, the client id was configured before the update. It seems, the update process deleted this setting (problem A) and then does not tell the user, that the settings are not configured as they should (problem B).
I have installed octoprint-mqtt on octopi with the plugin manager. The installation look good, I can configure and save settings. My octopi server never connects to my mqtt server.
Ideally provide exact steps to follow in order to reproduce your problem: -->
I expected to see activity on /octoprint on my mqtt server. I also expected to see traffic in tcpdump to my mqtt server IP on port 1883 from the octopi (I can see pings). Both devices are on the same network and can interact otherwise vi ping and nc <ip> 1883
works from the octopi machine,
No connection attempt is made to my mqtt server
OctoPrint 1.3.6 running on OctoPi 0.14.0
MQTT (0.6)
mosquitto version 1.4.14 (build date Mon, 10 Jul 2017 23:48:43 +0100)
mosquitto is an MQTT v3.1.1/v3.1 broker.
Will add
Using Fhem Homeautomation Server, that system requires a static MQTT client_id. As a result, the MQTT plugin does not connect. Please see community forum post at link below for additional details.
https://community.octoprint.org/t/mqtt-plugin-need-static-mqtt-client-id/9019
Mqtt is not working and when I start octoprint manually I found this strange error
I added some debugstatements in the plugin... the _on_connect callback never gets called because of the error in socket.py... why does this happen?
2016-04-07 21:16:42,574 - octoprint.plugins.mqtt - INFO - before conn async
2016-04-07 21:16:42,576 - octoprint.plugins.mqtt - INFO - connect async
2016-04-07 21:16:42,578 - octoprint.plugins.mqtt - INFO - loop started
Exception in thread Thread-11:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(_self.__args, *_self.__kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2283, in _thread_main
self.reconnect()
File "/home/pi/oprint/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 734, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 111] Connection refused
As far as I can see the plugin only sends out messages but cannot receive any? It would be great to be able to send some commands in to OctoPrint in this way, to instruct it to connect to the printer for example.
I am currently using the api successfully to do this, just thought if it were possible to use this it would feel cleaner being able to design flows in nodered
The plugin cant seem to send data over MQTT since a variable cant be calculated
Not this error in the log
octoprint | 2019-02-06 18:22:35,557 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0x7f083933d310>
octoprint | Traceback (most recent call last):
octoprint | File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint/printer/standard.py", line 167, in _sendAddTemperatureCallbacks
octoprint | callback.on_printer_add_temperature(data)
octoprint | File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 213, in on_printer_add_temperature
octoprint | or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold \
octoprint | TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
1.3.10
0.8.0
Mosquitto, unkown (latest docker container toke/mosquitto around 2018-12-01 (
These lines repeat once per second and nothing else
octoprint | 2019-02-06 18:22:35,557 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0x7f083933d310>
octoprint | Traceback (most recent call last):
octoprint | File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint/printer/standard.py", line 167, in _sendAddTemperatureCallbacks
octoprint | callback.on_printer_add_temperature(data)
octoprint | File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 213, in on_printer_add_temperature
octoprint | or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold \
octoprint | TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
N/A
N/A
mosquito_sub -v -t octoprint/#
The printer profile correctly reflects the missing heated chamber:
temperate messages for bed
and tool0
only
regular temperate messages for chamber
with updating _timestamp
readings and temperature values null
OctoPrint 1.3.11 auf OctoPi 0.16.0
0.8.1
octoprint/temperature/chamber {"_timestamp": 1557933342, "actual": null, "target": null}
octoprint/temperature/bed {"_timestamp": 1557933342, "actual": 24.22, "target": 0.0}
octoprint/temperature/chamber {"_timestamp": 1557933345, "actual": null, "target": null}
octoprint/temperature/bed {"_timestamp": 1557933345, "actual": 23.98, "target": 0.0}
octoprint/temperature/chamber {"_timestamp": 1557933348, "actual": null, "target": null}
octoprint/temperature/tool0 {"_timestamp": 1557933348, "actual": 23.24, "target": 0.0}
octoprint/temperature/chamber {"_timestamp": 1557933351, "actual": null, "target": null}
octoprint/temperature/tool0 {"_timestamp": 1557933351, "actual": 23.52, "target": 0.0}
octoprint/temperature/bed {"_timestamp": 1557933351, "actual": 24.14, "target": 0.0}
octoprint/temperature/chamber {"_timestamp": 1557933354, "actual": null, "target": null}
octoprint/temperature/bed {"_timestamp": 1557933354, "actual": 23.91, "target": 0.0}
octoprint/temperature/chamber {"_timestamp": 1557933357, "actual": null, "target": null}
octoprint/temperature/bed {"_timestamp": 1557933357, "actual": 24.1, "target": 0.0}
wrong ticket sorry
Hi!
This is more of a suggestion than an issue, but I was wondering if it would be possible to send out the printer's temperature during heat up-phases?
Maybe a hook into Octoprint's temperature readouts could be made, and the printer temperature, as well as status (like heating, heated, cooldown/off), could be sent out?
It would be cool to have an IoT-Connected display device show a small bar graph of the current temps of the printer as it warms up!
Hmm I think ;)
At some point I did a
mosquitto_sub -h IP -t '#'
and the terminal get flooded with this
octopi-ender3/temperature/tool0 {"_timestamp":1537650653,"actual":22.15,"target":0}
Since my printer is still powered off I assume the is the last state from the day before, before I powered it off.
no message since the printer is disconnected
but definitely not a all those messages and surely not in a flooding/spamming fashion
OctoPrint 1.3.9 auf OctoPi 0.15.0
0.7.1
pi@octopi-ender3:~ $ apt show mosquitto
Package: mosquitto
Version: 1.5-0mosquitto2
https://gist.github.com/StefanIGit/f8c2064d6057dc7b51a1a4ae3c45f9e3
The plugin is not working for me at all. No message is sent ever.
How can I debug it?
Running the latest version of MQTT, octoprint and plugin. MQTT server is working fine for all other nodes in my network.
Some brokers like mqtt.thingspeak.com require a flag "clean session=true" to be sent at authentication or it will return a permanent not authorised.
I have my hands way too full with OctoPrint's maintenance to give this plugin the attention it needs. Hence I'm looking for a new maintainer to adopt it.
Hi, not sure how to provide info, as this is not an issue:
I am using Domoticz as homeautomation server, and have created this node-red flow that uses this nice MQTT octoprint plugin
https://www.domoticz.com/forum/viewtopic.php?f=21&t=14021&p=162935#p162935
I have everything correctly configured (AFAIK), I have other systems writing to my MQTT server (running on another machine, not locally on the octoprint Raspberry Pi) so I know that part is working, yet I get zero info in there from the plugin.
I tried doing a tail
on the octoprint log file (whilst setting the debug level of the plugin to INFO) but I see nothing appearing there.
Any suggestions on how to track what might be happening?
Thanks
Hi, I love the idea of this to enable me to integrate messages from Octoprint into my Node-Red messaging system. However after having setup the plugin nothing is received by my MQTT broker. I'm sure I'm probably doing something wrong but I can't fathom what!
(and of Mosquitto)
Mosquitto v 1.3.4 running on Mac OS X 10.10.3
N/A
I have read the FAQ.
I would be nice if the plugin had an configuration dialog
I installed the plugin via pluginmanager and set the broker's IP address, but there are no published messages. I tcpdumped port 1883 on my raspi, but there is no traffic...
I use also the telegram plugin, therefore I'm sure that there are events which will be fired by octoprint itself.
config.yaml:
accessControl:
salt: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
api:
key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
appearance:
color: black
plugins:
announcements:
_config_version: 1
channels:
_blog:
read_until: 1513605600
_important:
read_until: 1509547500
_octopi:
read_until: 1499253000
_plugins:
read_until: 1516579200
_releases:
read_until: 1513079100
enabled_channels:
- _plugins
- _releases
- _important
cura:
cura_engine: /usr/local/bin/cura_engine
discovery:
publicPort: 80
upnpUuid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
mqtt:
broker:
protocol: MQTTv311
url: 192.168.0.24
softwareupdate:
_config_version: 6
check_providers:
mqtt: mqtt
telegram: telegram
checks:
octoprint:
checkout_folder: /home/pi/OctoPrint
prerelease: false
prerelease_channel: null
telegram:
[...]
printerProfiles:
default: _default
serial:
autoconnect: true
baudrate: 115200
port: /dev/ttyUSB0
server:
commands:
serverRestartCommand: sudo service octoprint restart
systemRestartCommand: sudo shutdown -r now
systemShutdownCommand: sudo shutdown -h now
firstRun: false
onlineCheck:
enabled: true
pluginBlacklist:
enabled: true
secretKey: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
seenWizards:
corewizard: 3
cura: null
telegram: 1
system:
actions: []
temperature:
profiles:
- bed: 100
extruder: '220'
name: ABS
- bed: '65'
extruder: '210'
name: PLA
webcam:
ffmpeg: /usr/bin/avconv
snapshot: http://127.0.0.1:8080/?action=snapshot
stream: /webcam/?action=stream
streamRatio: '4:3'
octoprint.log:
2018-01-24 19:41:51,950 - octoprint.server - INFO - OctoPrint 1.3.6 2018-01-24 19:41:51,952 - octoprint.plugin.core - INFO - 10 plugin(s) registered with the system: | Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/announcements | Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/corewizard | CuraEngine (<= 15.04) (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/cura | Discovery (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/discovery | MQTT (0.5) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt | OctoPi Support Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/octopi_support | Plugin Manager (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/pluginmanager | Software Update (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/softwareupdate | Telegram Notifications (1.4.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_telegram | Virtual Printer (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/virtual_printer 2018-01-24 19:41:51,974 - octoprint.environment - INFO - Detected environment is Python 2.7.9 under Linux (linux2). Details: | hardware: | cores: 4 | freq: 1200.0 | ram: 901685248 | os: | id: linux | platform: linux2 | plugins: | octopi_support: | model: 3B | revision: a02082 | version: 0.13.0 | python: | pip: 8.1.1 | version: 2.7.9 | virtualenv: /home/pi/oprint 2018-01-24 19:41:51,975 - octoprint.server - INFO - ------------------------------------------------------------------------------ 2018-01-24 19:41:51,946 - octoprint.util.comm - INFO - Finished in 12739.966 s. 2018-01-25 05:58:51,512 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.162 2018-01-25 16:32:20,530 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.162 2018-01-25 16:32:22,910 - octoprint.plugins.announcements - INFO - Loaded channel _important from https://octoprint.org/feeds/important.xml in 0.31s 2018-01-25 16:32:23,626 - octoprint.plugins.announcements - INFO - Loaded channel _releases from https://octoprint.org/feeds/releases.xml in 0.3s 2018-01-25 16:32:24,233 - octoprint.plugins.announcements - INFO - Loaded channel _plugins from https://plugins.octoprint.org/feed.xml in 0.47s 2018-01-25 16:32:26,341 - octoprint.plugins.softwareupdate - INFO - Saved version cache to disk 2018-01-25 16:33:10,242 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
plugin_pluginmanager_console.log:
2018-01-11 15:00:55,752 /home/pi/oprint/bin/python -m pip install https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip 2018-01-11 15:01:02,869 > Collecting https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip 2018-01-11 15:01:03,905 > Downloading https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip 2018-01-11 15:01:09,177 > Requirement already satisfied (use --upgrade to upgrade): OctoPrint in /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg (from OctoPrint-MQTT==0.5) 2018-01-11 15:01:09,178 > Collecting paho-mqtt (from OctoPrint-MQTT==0.5) 2018-01-11 15:01:10,182 > Downloading paho-mqtt-1.3.1.tar.gz (80kB) 2018-01-11 15:01:15,379 > Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.9 in /home/pi/oprint/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,380 > Requirement already satisfied (use --upgrade to upgrade): Jinja2<2.9,>=2.8 in /home/pi/oprint/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,382 > Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.9,>=0.8.3 in /home/pi/oprint/lib/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,383 > Requirement already satisfied (use --upgrade to upgrade): tornado==4.0.2 in /home/pi/oprint/lib/python2.7/site-packages/tornado-4.0.2-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,384 > Requirement already satisfied (use --upgrade to upgrade): sockjs-tornado<1.1,>=1.0.3 in /home/pi/oprint/lib/python2.7/site-packages/sockjs_tornado-1.0.3-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,386 > Requirement already satisfied (use --upgrade to upgrade): PyYAML<3.11,>=3.10 in /home/pi/oprint/lib/python2.7/site-packages/PyYAML-3.10-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,387 > Requirement already satisfied (use --upgrade to upgrade): Flask-Login<0.3,>=0.2.2 in /home/pi/oprint/lib/python2.7/site-packages/Flask_Login-0.2.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,388 > Requirement already satisfied (use --upgrade to upgrade): Flask-Principal<0.4,>=0.3.5 in /home/pi/oprint/lib/python2.7/site-packages/Flask_Principal-0.3.5-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,390 > Requirement already satisfied (use --upgrade to upgrade): Flask-Babel<0.10,>=0.9 in /home/pi/oprint/lib/python2.7/site-packages/Flask_Babel-0.9-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,390 > Requirement already satisfied (use --upgrade to upgrade): Flask-Assets<0.11,>=0.10 in /home/pi/oprint/lib/python2.7/site-packages/Flask_Assets-0.10-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,391 > Requirement already satisfied (use --upgrade to upgrade): markdown<2.7,>=2.6.4 in /home/pi/oprint/lib/python2.7/site-packages/Markdown-2.6.8-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,392 > Requirement already satisfied (use --upgrade to upgrade): pyserial<2.8,>=2.7 in /home/pi/oprint/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,393 > Requirement already satisfied (use --upgrade to upgrade): netaddr<0.8,>=0.7.17 in /home/pi/oprint/lib/python2.7/site-packages/netaddr-0.7.17-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,394 > Requirement already satisfied (use --upgrade to upgrade): watchdog<0.9,>=0.8.3 in /home/pi/oprint/lib/python2.7/site-packages/watchdog-0.8.3-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,394 > Requirement already satisfied (use --upgrade to upgrade): sarge<0.2,>=0.1.4 in /home/pi/oprint/lib/python2.7/site-packages/sarge-0.1.4-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,395 > Requirement already satisfied (use --upgrade to upgrade): netifaces<0.11,>=0.10 in /home/pi/oprint/lib/python2.7/site-packages/netifaces-0.10.0-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,396 > Requirement already satisfied (use --upgrade to upgrade): pylru<1.1,>=1.0.9 in /home/pi/oprint/lib/python2.7/site-packages/pylru-1.0.9-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,397 > Requirement already satisfied (use --upgrade to upgrade): rsa<3.3,>=3.2 in /home/pi/oprint/lib/python2.7/site-packages/rsa-3.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,398 > Requirement already satisfied (use --upgrade to upgrade): pkginfo<1.3,>=1.2.1 in /home/pi/oprint/lib/python2.7/site-packages/pkginfo-1.2.1-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,398 > Requirement already satisfied (use --upgrade to upgrade): requests<3,>=2.18.4 in /home/pi/oprint/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,399 > Requirement already satisfied (use --upgrade to upgrade): semantic-version<2.5,>=2.4.2 in /home/pi/oprint/lib/python2.7/site-packages/semantic_version-2.4.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,400 > Requirement already satisfied (use --upgrade to upgrade): psutil<6,>=5.4.1 in /home/pi/oprint/lib/python2.7/site-packages/psutil-5.4.3-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,401 > Requirement already satisfied (use --upgrade to upgrade): Click<6.3,>=6.2 in /home/pi/oprint/lib/python2.7/site-packages/click-6.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,402 > Requirement already satisfied (use --upgrade to upgrade): awesome-slugify<1.7,>=1.6.5 in /home/pi/oprint/lib/python2.7/site-packages/awesome_slugify-1.6.5-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,402 > Requirement already satisfied (use --upgrade to upgrade): feedparser<5.3,>=5.2.1 in /home/pi/oprint/lib/python2.7/site-packages/feedparser-5.2.1-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,403 > Requirement already satisfied (use --upgrade to upgrade): chainmap<1.1,>=1.0.2 in /home/pi/oprint/lib/python2.7/site-packages/chainmap-1.0.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,404 > Requirement already satisfied (use --upgrade to upgrade): future<0.16,>=0.15 in /home/pi/oprint/lib/python2.7/site-packages/future-0.15.2-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,405 > Requirement already satisfied (use --upgrade to upgrade): scandir<1.4,>=1.3 in /home/pi/oprint/lib/python2.7/site-packages/scandir-1.3-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,406 > Requirement already satisfied (use --upgrade to upgrade): websocket-client<0.41,>=0.40 in /home/pi/oprint/lib/python2.7/site-packages/websocket_client-0.40.0-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,406 > Requirement already satisfied (use --upgrade to upgrade): python-dateutil<2.7,>=2.6 in /home/pi/oprint/lib/python2.7/site-packages/python_dateutil-2.6.0-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,407 > Requirement already satisfied (use --upgrade to upgrade): wrapt<1.11,>=1.10.10 in /home/pi/oprint/lib/python2.7/site-packages/wrapt-1.10.11-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,408 > Requirement already satisfied (use --upgrade to upgrade): futures<3.2,>=3.1.1 in /home/pi/oprint/lib/python2.7/site-packages/futures-3.1.1-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,409 > Requirement already satisfied (use --upgrade to upgrade): emoji<0.5,>=0.4.5 in /home/pi/oprint/lib/python2.7/site-packages/emoji-0.4.5-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,410 > Requirement already satisfied (use --upgrade to upgrade): monotonic<1.4,>=1.3 in /home/pi/oprint/lib/python2.7/site-packages/monotonic-1.3-py2.7.egg (from OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,410 > Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in /home/pi/oprint/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg (from flask<0.11,>=0.9->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,411 > Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /home/pi/oprint/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7-linux-armv7l.egg (from Jinja2<2.9,>=2.8->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,412 > Requirement already satisfied (use --upgrade to upgrade): certifi in /home/pi/oprint/lib/python2.7/site-packages/certifi-2017.11.05-py2.7.egg (from tornado==4.0.2->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,413 > Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /home/pi/oprint/lib/python2.7/site-packages/backports.ssl_match_hostname-3.5.0.1-py2.7.egg (from tornado==4.0.2->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,414 > Requirement already satisfied (use --upgrade to upgrade): blinker in /home/pi/oprint/lib/python2.7/site-packages/blinker-1.4-py2.7.egg (from Flask-Principal<0.4,>=0.3.5->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,414 > Requirement already satisfied (use --upgrade to upgrade): Babel>=1.0 in /home/pi/oprint/lib/python2.7/site-packages/Babel-2.3.3-py2.7.egg (from Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,415 > Requirement already satisfied (use --upgrade to upgrade): speaklater>=1.2 in /home/pi/oprint/lib/python2.7/site-packages/speaklater-1.3-py2.7.egg (from Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,416 > Requirement already satisfied (use --upgrade to upgrade): webassets>=0.10 in /home/pi/oprint/lib/python2.7/site-packages/webassets-0.11.1-py2.7.egg (from Flask-Assets<0.11,>=0.10->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,417 > Requirement already satisfied (use --upgrade to upgrade): argh>=0.24.1 in /home/pi/oprint/lib/python2.7/site-packages/argh-0.26.1-py2.7.egg (from watchdog<0.9,>=0.8.3->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,417 > Requirement already satisfied (use --upgrade to upgrade): pathtools>=0.1.1 in /home/pi/oprint/lib/python2.7/site-packages/pathtools-0.1.2-py2.7.egg (from watchdog<0.9,>=0.8.3->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,419 > Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.3 in /home/pi/oprint/lib/python2.7/site-packages (from rsa<3.3,>=3.2->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,420 > Requirement already satisfied (use --upgrade to upgrade): chardet<3.1.0,>=3.0.2 in /home/pi/oprint/lib/python2.7/site-packages/chardet-3.0.4-py2.7.egg (from requests<3,>=2.18.4->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,421 > Requirement already satisfied (use --upgrade to upgrade): idna<2.7,>=2.5 in /home/pi/oprint/lib/python2.7/site-packages/idna-2.6-py2.7.egg (from requests<3,>=2.18.4->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,422 > Requirement already satisfied (use --upgrade to upgrade): urllib3<1.23,>=1.21.1 in /home/pi/oprint/lib/python2.7/site-packages/urllib3-1.22-py2.7.egg (from requests<3,>=2.18.4->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,423 > Requirement already satisfied (use --upgrade to upgrade): regex in /home/pi/oprint/lib/python2.7/site-packages/regex-2016.04.15-py2.7-linux-armv7l.egg (from awesome-slugify<1.7,>=1.6.5->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,423 > Requirement already satisfied (use --upgrade to upgrade): Unidecode<0.05,>=0.04.14 in /home/pi/oprint/lib/python2.7/site-packages/Unidecode-0.04.19-py2.7.egg (from awesome-slugify<1.7,>=1.6.5->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,424 > Requirement already satisfied (use --upgrade to upgrade): six in /home/pi/oprint/lib/python2.7/site-packages (from websocket-client<0.41,>=0.40->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,425 > Requirement already satisfied (use --upgrade to upgrade): pytz>=0a in /home/pi/oprint/lib/python2.7/site-packages/pytz-2016.3-py2.7.egg (from Babel>=1.0->Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-MQTT==0.5) 2018-01-11 15:01:15,426 > Installing collected packages: paho-mqtt, OctoPrint-MQTT 2018-01-11 15:01:15,426 > Running setup.py install for paho-mqtt: started 2018-01-11 15:01:19,434 > Running setup.py install for paho-mqtt: finished with status 'done' 2018-01-11 15:01:19,435 > Running setup.py install for OctoPrint-MQTT: started 2018-01-11 15:01:22,907 > Running setup.py install for OctoPrint-MQTT: finished with status 'done' 2018-01-11 15:01:22,908 > Successfully installed OctoPrint-MQTT-0.5 paho-mqtt-1.3.1 2018-01-11 15:01:25,690 ! You are using pip version 8.1.1, however version 9.0.1 is available. 2018-01-11 15:01:25,692 ! You should consider upgrading via the 'pip install --upgrade pip' command.
My home automation system (HomeSeer) watches this topic /event/ UpdatedFiles and if a message is received, the HA will provide power to the printer after 2 min.
With the latest version (0.6), a message is being sent on /event/ UpdatedFiles at the end of a print, (without a file being updated).
This of course is causing the printer to restart.
Only have a message sent when an actual file update takes place.
A message is being sent after a print completes, when no file updates take place.
1.3.6
0.6
Developping my home assistant
1.3.9
0.7.1
How do we query data? It's good to have randomly heartbeat, but querying the progress and others would make sense?
Publishing to AWS IoT via mosquitto broker
https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/
AWS IoT would receive the messages
All messages from the mosquitto broker stopped being processed by AWS, even ones unrelated to OctoPrint.
1.3.10
0.8.0
mosquitto 1.5.5
Clone plugin source
cd OctoPrint-MQTT/octoprint_mqtt/
sed -i 's/retained=True/retained=False/' __init__.py
sed -i 's/retain=True/retain=False/' __init__.py
Install plugin
I've tried to install the MQTT Plugin via all 3 possible ways. It's installing properly but not showing up afterwards.
The MQTT Plugin to show up^^
Nothing
1.3.4 (master branch)
current master branch (can't check via plugin manager)
doesnt matter here
Starting dependency resolution...
packed_core.js:12820:9
... dependency resolution done
packed_core.js:12921:9
Initial application setup done, connecting to server...
packed_core.js:13150:9
Connected to the server
packed_core.js:11368:9
Finalizing application startup
packed_core.js:13154:17
Going to bind 29 view models...
packed_core.js:13058:13
Did not bind view model CoreWizardAclViewModel to target #wizard_plugin_corewizard_acl since it does not exist
packed_core.js:13099:29
Did not bind view model CoreWizardPrinterProfileViewModel to target #wizard_plugin_corewizard_printerprofile since it does not exist
packed_core.js:13099:29
Did not bind view model CoreWizardWebcamViewModel to target #wizard_plugin_corewizard_webcam since it does not exist
packed_core.js:13099:29
Did not bind view model CoreWizardServerCommandsViewModel to target #wizard_plugin_corewizard_servercommands since it does not exist
packed_core.js:13099:29
Did not bind view model CuraViewModel to target #wizard_plugin_cura since it does not exist
packed_core.js:13099:29
Did not bind view model SoftwareUpdateViewModel to target #wizard_plugin_softwareupdate since it does not exist
packed_core.js:13099:29
... binding done
packed_core.js:13132:13
Application startup complete
packed_core.js:13143:13
Connected to the server
Thanks in advance :)
Is it possible to only publish a Firmware Error event?
I am just wanting to notify the MQTT broker if/when there is a firmware error (printer halt, thermal runaway, etc).
I see there is a Printer Data option, but I don't need all that constant traffic. I just want to know if there was an error.
Thanks!
How can I see the printing time and the remaining printing time?
I would like to connect OctoPrintto my home monitor on node-red.
How can i check status of various events provided by OctoPrint via MQTT?
Example:
Send command to read that any client is connected to Octoprint webpage.
Octoprint reads message and publish status of event.
OctoPrint: 1.3.4 (stable)
MQTT(plugin) : 0.5
Problem:
Cannot get any messages
Disconnected from mqtt broker for unknown reasons
What errors I got:
2017-09-06 09:43:38,303 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 09:46:38,040 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 09:49:37,307 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 09:52:37,589 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 09:55:37,515 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 09:58:37,128 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 10:01:37,037 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 10:04:36,906 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 10:07:36,531 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 10:10:36,876 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
2017-09-06 10:13:36,537 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
Any ideas what are the unknown reasons? (have checked other similar issues, doesn't work though)
The Plugin was easy to install and works as described. I am only interested in one thing: get a notification when a printjob is finished. Currently, I wait for "progress 100%" which kind of works, but the event fires three times for each printjob.
Am I doing something wrong? Can you just add a new topic "octoprint/event/PrintFinished" similar to "octoprint/event/PrintStarted"?
I am trying to create a node-red flow to execute an action when Octoprint starts up and shuts down. I happily receive Shutdown events over MQTT, but it appears that no Startup event is sent by the MQTT plugin.
We should see a Startup message.
No Startup message. Other events such as ClientOpened/Shutdown etc arrive when expected.
1.13.11
0.8.6
mosquitto 1.4.14
No web browser involved.
Can the plugin publish the Printer Profile? At least the Printer Id
http://docs.octoprint.org/en/master/modules/printer.html#module-octoprint.printer.profile
I'm using the plugin to create a dashboard to monitor multiple printers, without the Printer Id, it's impossible to know which data is from which printer
I am trying to use this plugin on OctoPi from a Raspberry Pi. I've installed, rebooted, and configured the MQTT Broker to listen on the server IP and 127.0.0.1 with no luck. I am unable to connect to MQTT from any Chrome extension or Node-Red.
I ran netstat on the Pi and don't see port 1883 in use, unsure how to gather information for troubleshooting.
mqtt:
broker:
url: iot.eclipse.org
publish:
baseTopic: home/office/p3steel/
Messages to appear on the broker.
No messages and the log is filled with:
2016-08-26 22:23:22,795 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2016-08-26 22:23:22,872 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons
Version: 1.2.15 (master branch)
https://gist.github.com/jawilson/6554f264cc11181ab4413a3e0381db44
I have read the FAQ.
I was curious if it was a problem with python and/or paho-mqtt, so I created this test script that works just fine.
In the terminal I see that there is regulary issued command M73.
Send: N17240 M73 P9 R353*25
Recv: NORMAL MODE: Percent done: 9; print time remaining in mins: 353
Recv: SILENT MODE: Percent done: 9; print time remaining in mins: 358
Recv: ok
Can be 'Percent done' and 'remaining time' published?
The MQTT plugin suddenly stopped publishing information.
v1.3.9
v0.7.1
Using Mosquitto on a remote Raspberry Pi.
Áll was working fine, until october 18th. Since that time, the debug of the MQTT plugin displays some errors and isn't connecting to the MQTT broker.
2018-11-02 18:25:42,707 - octoprint.plugins.mqtt - INFO - Settings changed (broker_diff={}, lw_diff={'lw_active': False, 'lw_topic': None}), reconnecting to broker
2018-11-02 18:25:43,721 - octoprint.server.api.settings - ERROR - Could not save settings for plugin MQTT (0.7.1)
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/settings.py", line 535, in _saveSettings
plugin.on_settings_save(data["plugins"][plugin_id])
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 148, in on_settings_save
self.mqtt_connect()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 273, in mqtt_connect
self._mqtt.tls_set(ca_certs, **tls_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 764, in tls_set
context.load_cert_chain(certfile, keyfile)
IOError: [Errno 2] No such file or directory
2018-11-02 18:25:45,087 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/tool0 - {"_timestamp": 1541179545, "actual": 19.77, "target": 0.0}
2018-11-02 18:25:48,895 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/bed - {"_timestamp": 1541179548, "actual": 23.06, "target": 0.0}
2018-11-02 18:25:50,909 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/bed - {"_timestamp": 1541179550, "actual": 23.16, "target": 0.0}
2018-11-02 18:25:52,905 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/tool0 - {"_timestamp": 1541179552, "actual": 19.88, "target": 0.0}
2018-11-02 18:25:52,917 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/bed - {"_timestamp": 1541179552, "actual": 23.06, "target": 0.0}
Also when trying to connect it to a temporary locally installed MQTT broker, the same error is displayed.
2018-11-02 18:33:38,978 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/bed - {"_timestamp": 1541180018, "actual": 22.06, "target": 0.0}
2018-11-02 18:33:40,503 - octoprint.plugins.mqtt - INFO - Settings changed (broker_diff={'url': u'127.0.0.1'}, lw_diff={}), reconnecting to broker
2018-11-02 18:33:41,518 - octoprint.server.api.settings - ERROR - Could not save settings for plugin MQTT (0.7.1)
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/settings.py", line 535, in _saveSettings
plugin.on_settings_save(data["plugins"][plugin_id])
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 148, in on_settings_save
self.mqtt_connect()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/__init__.py", line 273, in mqtt_connect
self._mqtt.tls_set(ca_certs, **tls_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 764, in tls_set
context.load_cert_chain(certfile, keyfile)
IOError: [Errno 2] No such file or directory
2018-11-02 18:33:43,172 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/tool0 - {"_timestamp": 1541180023, "actual": 19.53, "target": 0.0}
2018-11-02 18:33:44,972 - octoprint.plugins.mqtt - DEBUG - Not connected, enqueuing message: octoprint/temperature/tool0 - {"_timestamp": 1541180024, "actual": 19.73, "target": 0.0}
Already tried removing the plugin and re-installing it, but that didn't change anything. Rebooted Octoprint RPi completely, no change.
What can this be?
Regards,
Martijn
The MQTT client library supports both MQTTv31
and MQTTv311
protocol versions. The plugin should allow to specify which version to use with the selected broker.
TODOs:
MQTTv31
)See also: Client docs
I updated octoprint to the latest version.
I have both MQTT and IFTT plugins installed
IFTT started spamming ClientOpened messages every few seconds = disabling MQTT plugin made it stop
i saw errors in the log
no errors. and no ClientOpen messages every few seconds
errors:
the client causes something to crash with other plugins (IFTTT plugin keeps sending the OpenClient message ) and I see these errors in the log
OctoPrint 1.3.8 running on OctoPi 0.14.0
MQTT (0.7.1)
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 145, in _sendAddTemperatureCallbacks
callback.on_printer_add_temperature(data)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 204, in on_printer_add_temperature
or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
2018-05-13 15:30:53,387 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0xb4
03b090>
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 145, in _sendAddTemperatureCallbacks
callback.on_printer_add_temperature(data)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 204, in on_printer_add_temperature
or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
2018-05-13 15:30:55,370 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0xb4
03b090>
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 145, in _sendAddTemperatureCallbacks
callback.on_printer_add_temperature(data)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 204, in on_printer_add_temperature
or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
2018-05-13 15:30:56,298 - octoprint.plugins.IFTTTmaker - INFO - URL: https://maker.ifttt.com/trigger/op-ClientOpened/with/key/dUWVcmGy4B_FUwT8D0Zgit
2018-05-13 15:30:56,331 - octoprint.plugins.IFTTTmaker - INFO - Trigger: op-ClientOpened Response: Congratulations! You've fired the op-ClientOpened event Payload: {'value3': '192.168.1.108', 'value2': '', 'value1': ''}
2018-05-13 15:30:56,443 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.1.108
2018-05-13 15:30:56,521 - octoprint.plugins.IFTTTmaker - INFO - Event skipped: ClientClosed
2018-05-13 15:30:57,404 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0xb403b090>
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 145, in _sendAddTemperatureCallbacks
callback.on_printer_add_temperature(data)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 204, in on_printer_add_temperature
Do you need the full log or is this engouh?
I tested some gcode that incorporates a filament change (M600) and watched the output of the plugin on octoprint/#
but I didn't see anything that would indicate a filament change status. Is this a feature that can be added or is it something I would need to implement via a plugin?
Thanks for your assistance with this. My printer is in my garage and I can't hear the beeps when it's time for a filament change. Writing something to notify me when a specific MQTT message is published would be an easy fix to that problem!
does this work with 1.2.7 and 1.2.8?
Hi. Printing using the Octoprint server is sometimes very slow when printing complex shapes so I often print from the SDCARD. Currrently there is no status / update when using this method. Is there any way to get regular status / feedback from the 3D Printer via MQTT? I publish the MQTT topics using OpenHAB so I can monitor the progress remotely. Many thanks, Andrew.
Install OctoPrint-MQTT via pluging manaer and command line.
Install plugin.
Error log:
pi@raspberrypi:~ $ pip install "https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip"
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip
Downloading https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/usr/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 283, in prepare_linked_requirement
progress_bar=self.progress_bar
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 836, in unpack_url
progress_bar=progress_bar
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 673, in unpack_http_url
progress_bar)
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 897, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 619, in _download_url
consume(downloaded_chunks)
File "/usr/lib/python2.7/dist-packages/pip/_internal/utils/misc.py", line 866, in consume
deque(iterator, maxlen=0)
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 585, in written_chunks
for chunk in chunks:
File "/usr/lib/python2.7/dist-packages/pip/_internal/download.py", line 574, in resp_read
decode_content=False):
File "/usr/share/python-wheels/urllib3-1.24.1-py2.py3-none-any.whl/urllib3/response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/share/python-wheels/urllib3-1.24.1-py2.py3-none-any.whl/urllib3/response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/share/python-wheels/urllib3-1.24.1-py2.py3-none-any.whl/urllib3/response.py", line 374, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='codeload.github.com', port=443): Read timed out.
1.3.11
None
Is it possible to limit the number of messages published for temperature change through config? Ideally I'd like to limit it to maybe every x seconds so as not to swamp out listening devices.
Also, a list of messages to publish would be good - I'm not really interested in listening to CaptureEvents and would rather they weren't sent at all.
I run multiple octoprint instances with MQTT plugin installed (thanks!). I would like to control those instances from central server by using octoprint API.
Note: I'm currently working on a rework, this is more a Note book and ToDo list than a bug report
octoprint/opalblau/event/('FileAdded',) {"path": "aaa-test/9021e438-6016-4577-b161-50e5484c6c7b.gcode", "_event": ["FileAdded"], "storage": "local", "name": "9021e438-6016-4577-b161-50e5484c6c7b.gcode", "type": ["machinecode", "gcode"]}
I'm pushing output of this plugin into Elasticsearch, which doesn't like having a field use its internal name of _timestamp.
Perhaps the name of that field could be configurable? I might do it but I have a bunch of loose ends, so I wanted to at least place it here.
Doesn't appear that the plugin sends out the time remaining on any channels. Is there any way we can get that info published?
I would like to be able to publish a message on shutdown that my HomeAssistant instance can act upon and power down my printer.
Hi,
I'm trying to develop a plugin that publish an MQTT message when a M600 is detected (which in turn will send me a push notification)
So far I've got to
import octoprint.plugin
class MqttM600Plugin(octoprint.plugin.SettingsPlugin, octoprint.plugin.StartupPlugin):
def __init__(self):
self.mqtt_publish = lambda *args, **kwargs: None
self.mqtt_subscribe = lambda *args, **kwargs: None
self.mqtt_unsubscribe = lambda *args, **kwargs: None
def initialize(self):
#self._printer.register_callback(self)
if self._settings.global_get(["plugins","mqtt","broker","url"]) is None:
self._logger.error("No broker URL defined, MQTT plugin won't be able to work")
return False
def on_after_startup(self):
helpers = self._plugin_manager.get_helpers("mqtt", "mqtt_publish", "mqtt_subscribe", "mqtt_unsubscribe")
if helpers:
if "mqtt_publish" in helpers:
self.mqtt_publish = helpers["mqtt_publish"]
if "mqtt_subscribe" in helpers:
self.mqtt_subscribe = helpers["mqtt_subscribe"]
if "mqtt_unsubscribe" in helpers:
self.mqtt_unsubscribe = helpers["mqtt_unsubscribe"]
self._logger.info("***MqttM600Plugin startup correctly***")
#self._logger.info(self._settings.global_get(["plugins","mqtt","publish","baseTopic"]))
#self._logger.info("************************************")
def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs):
if gcode and cmd[:4] == "M600":
try:
baseTopic = self._settings.global_get(["plugins","mqtt","publish","baseTopic"])
self._logger.info("M600 registered, sending message to " + baseTopic + "GCODE/M600")
self.mqtt_publish(baseTopic + "GCODE/M600", {"message:":"M600 detected","cmd":cmd, "cmd_type":cmd_type, "gcode":gcode, "args":args})
except:
self._logger.error("M600 MQTT message could not be sent")
def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = MqttM600Plugin()
global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.comm.protocol.gcode.sent": __plugin_implementation__.processGCODE
}
__plugin_name__ = "M600 MQTT Action"
__plugin_version__ = "0.0.1"
__plugin_description__ = "Plugin that sends an MQTT message if a M600 gcode is sent to the printer."
(untested code)
What I'd like was a way to access the base topic setting so that I wouldn't need to hard code that topic.
Would that be possible and if yes how?
The MQTT plugin currently does not support connecting to SSL secured brokers. It should be adjusted to change that.
TODOs:
tls_set
Hello, first of all thank you for this plugin.
I've been using intensively this MQTT plugin, retrieving most data in my automation system. Since last update I don't get octoprint/progress messages anymore.
I get many polluting "positionupdate" and "zchange" messages I would like to get rid of, but progress messages are gone. What happened?
Firstly would just like to say how good this is, very impressive. I've been playing around with this getting it set up all weekend :)
Currently you have the connected topic: "octoprint/event/Connected" which is broadcast when OctoPrint connects to the printer but there is no corresponding disconnected topic. The only way I can see to do this is by making a call to the api to get the current state of the connection.
It would be cool if you could issue MQTT publications on another device and have the octoprint perform actions based on subscriptions. Either octoprint native actions or sending Gcode options to the printer.
For example, if you were to send {"message": "connect", "port": "/dev/ttyUSB0", "baudrate": "115200"} to the topic /octopi/cmnd/ then the octopi instance would attempt to connect to the printer on USB0 at the given baud rate.
Or {"message": "position", "home": "all"} to the topic /octopi/cmnd/ then octopi would sent G28 to the printer while {"message": "position", "home": "X Y"} would home just the X and Y axis with G28 X Y.
I guess you might not need an entire library for gcode, could do something like {"message": "printer control", "gcode": "G28 X Y"}
Incoming messages from other devices could be executed immediately with a "now", or if printing, queued and executed when printer status is Operational
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.