Die Fehlermeldung ist geringfügig anders:
Meine plugin.yaml:
die Mosquitto Config:
und vielleicht auch mal der MQTT Broker Service Status:
Code:
2018-09-21 22:49:37 INFO plugins.mqtt Connecting to broker '192.168.168.44:1883'. Starting mqtt client 'smarthome' 2018-09-21 22:49:37 ERROR lib.plugin Plugin 'mqtt' from section 'mqtt' exception: 'LogRecord' object has no attribute 'message' Traceback (most recent call last): File "/usr/local/smarthome/plugins/mqtt/__init__.py", line 419, in ConnectToBroker self._client.connect(self.broker_ip, self.broker_port, 60) File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 768, in connect return self.reconnect() File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 895, in reconnect sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "/usr/lib/python3.5/socket.py", line 712, in create_connection raise err File "/usr/lib/python3.5/socket.py", line 703, in create_connection sock.connect(sa) [MARKIEREN]OSError: [Errno 113] Keine Route zum Zielrechner[/MARKIEREN] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/smarthome/lib/plugin.py", line 129, in __init__ plugin_thread = PluginWrapper(smarthome, plugin, classname, classpath, args, instance, self.meta, self._gtrans) File "/usr/local/smarthome/lib/plugin.py", line 567, in __init__ exec("self.plugin.__init__(smarthome{0}{1})".format("," if len(arglist) else "", argstring)) File "<string>", line 1, in <module> File "/usr/local/smarthome/plugins/mqtt/__init__.py", line 168, in __init__ self.ConnectToBroker() File "/usr/local/smarthome/plugins/mqtt/__init__.py", line 421, in ConnectToBroker self.logger.error(self.get_loginstance()+'Connection error:', e) File "/usr/lib/python3.5/logging/__init__.py", line 1309, in error self._log(ERROR, msg, args, **kwargs) File "/usr/lib/python3.5/logging/__init__.py", line 1416, in _log self.handle(record) File "/usr/lib/python3.5/logging/__init__.py", line 1426, in handle self.callHandlers(record) File "/usr/lib/python3.5/logging/__init__.py", line 1488, in callHandlers hdlr.handle(record) File "/usr/lib/python3.5/logging/__init__.py", line 856, in handle self.emit(record) File "/usr/local/smarthome/bin/smarthome.py", line 132, in emit self._log.add([timestamp, record.threadName, record.levelname, record.message]) AttributeError: 'LogRecord' object has no attribute 'message'
Code:
mqtt: class_name: Mqtt class_path: plugins.mqtt host: 192.168.168.44 # host: localhost or 127.0.0.1 port: 1883 qos: 0 # last_will_topic: 'shng/$online' # last_will_payload: False # birth_topic: 'shng/$online' # birth_payload: True # user: None # username (or None) # password: None # password (or None) # hashed_password: 1245a9633edf47b7091f37c4d294b5be5a9936c81 ... # === The following parameters are not yet implemented: # publish_items: no # NEW: publish using item-path # items_topic_prefix: 'shng' # NEW: prefix for publishing items # acl: pub # NEW: access control (none, pub, sub, pubsub) # tls: None # use TLS version (v1 or None) # ca_certs: '/etc/...' # path to the Certificate Authority certificate files
Code:
pid_file /var/run/mosquitto.pid log_dest file /var/log/mosquitto/mosquitto.log # include_dir /etc/mosquitto/conf.d listener 1883 # 192.168.178.60 persistence true persistence_location /var/lib/mosquitto/ persistence_file mosquitto.db # remote_username <your user name> # remote_password <your password> log_dest syslog log_dest stdout log_dest topic log_type error log_type warning log_type notice log_type information connection_messages true log_timestamp true allow_anonymous true password_file /etc/mosquitto/pwfile
Code:
smarthome@smarthome:~$ sudo systemctl status mosquitto.service ● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled) Active: active (exited) since Fri 2018-09-21 22:49:28 CEST; 5min ago Docs: man:systemd-sysv-generator(8) Process: 388 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 4915) CGroup: /system.slice/mosquitto.service Sep 21 22:49:28 smarthome systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker... Sep 21 22:49:28 smarthome mosquitto[388]: Starting network daemon:: mosquitto. Sep 21 22:49:28 smarthome systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker. smarthome@smarthome:~$
Kommentar