jneilliii / OctoPrint-TasmotaMQTT

18 stars 16 forks source link

Plugin can't be loaded / doesn't do anything / buttons don't work #41

Closed pReya closed 4 years ago

pReya commented 4 years ago

Hey there, I have a problem with the plugin. It won't work at all with my installation.

In the frontend I get two different console errors:

Error calling onBeforeBinding on view model TasmotaMQTTViewModel : TasmotaMQTTViewModel/self.onBeforeBinding@https://bla.user.de/static/webassets/packed_plugins.js?f07a20fb:8127:12
callViewModelIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16543:34
callViewModel@https://bla.user.de/static/webassets/packed_core.js?3514a079:16497:20
bindViewModels/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:17245:42
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
bindViewModels@https://bla.user.de/static/webassets/packed_core.js?3514a079:17225:19
Error calling onDataUpdaterPluginMessage on view model TasmotaMQTTViewModel : TasmotaMQTTViewModel/self.onDataUpdaterPluginMessage@https://bla.user.de/static/webassets/packed_plugins.js?f07a20fb:8169:13
callViewModelIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16540:35
callViewModelsIf/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:16489:28
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
callViewModelsIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16487:7
callViewModels@https://bla.user.de/static/webassets/packed_core.js?3514a079:16481:21
DataUpdater/self._onPluginMessage/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:15175:27
DataUpdater/self._ifInitialized@https://bla.user.de/static/webassets/packed_core.js?3514a079:15199:13
DataUpdater/self._onPluginMessage@https://bla.user.de/static/webassets/packed_core.js?3514a079:15174:14
OctoPrintSocketClient.prototype.propagateMessage/<@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:421:24
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
OctoPrintSocketClient.prototype.propagateMessage@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:420:15
onMessage/<@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:515:22
Zt/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11225:23
_t@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11213:392
Vt/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11224:369
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:73
onMessage@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:514:15
[5]</EventTarget.prototype.dispatchEvent@https://bla.user.de/static/webassets/packed_libs.js?3339d949:22600:20
[14]</</SockJS.prototype._transportMessage/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:23313:16
[14]</</SockJS.prototype._transportMessage@https://bla.user.de/static/webassets/packed_libs.js?3339d949:23311:17
[3]</EventEmitter.prototype.emit@https://bla.user.de/static/webassets/packed_libs.js?3339d949:22516:18
WebSocketTransport/this.ws.onmessage@https://bla.user.de/static/webassets/packed_libs.js?3339d949:25387:10

The OctoPrint logfile looks like this:

2020-07-17 17:04:47,634 - octoprint.plugin - ERROR - Error while calling plugin tasmota_mqtt
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 224, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_tasmota_mqtt/__init__.py", line 186, in on_after_startup
    for relay in self._settings.get(["arrRelays"]):
TypeError: 'NoneType' object is not iterable
2020-07-17 17:04:48,171 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2020-07-17 17:04:48,312 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=de', 'path': '/', 'base_url': 'https://bla.user.de/'}
2020-07-17 17:04:54,027 - octoprint.server.util.sockjs - INFO - New connection from client: 91.64.147.20
2020-07-17 17:04:54,327 - octoprint.server.util.flask - INFO - Passively logging in user admin from 91.64.147.20
2020-07-17 17:04:54,356 - octoprint.access.users - INFO - Logged in user: admin
2020-07-17 17:04:54,483 - octoprint.server.util.sockjs - INFO - User admin logged in on the socket from client 91.64.147.20
2020-07-17 17:04:54,776 - octoprint.server.api.settings - ERROR - Could not load settings for plugin Tasmota-MQTT (0.3.6)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/settings.py", line 288, in _get_plugin_settings
    result = plugin.on_settings_load()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/types.py", line 1506, in on_settings_load
    if self.config_version_key in data:
TypeError: argument of type 'NoneType' is not iterable

Any ideas on how to fix this?

jneilliii commented 4 years ago

This looks like an error caused by the octoprint uninstall/clear data option that should be fixed in the next release of OctoPrint. If you manually edit your file ~/.octoprint/config.yaml and check for the tasmotamqtt section underneath plugins do you see the word null? If so, delete the entire tasmotamqtt section from it and save the file and restart octoprint.

pReya commented 4 years ago

Thanks @jneilliii ! Indeed, the value in the config was set to null. Removing the line helped to make the plugin work again.