bbqkees / ems-esp-domoticz-plugin

Domoticz plugin for the EMS Wi-Fi Gateway with Proddy's EMS-ESP firmware
MIT License
7 stars 8 forks source link

Error messages during start-up #12

Closed FireWizard52 closed 4 years ago

FireWizard52 commented 4 years ago

@bbqkees (Kees)

This issue we have briefly discussed by mail, about two weeks ago.

Currently after a restart of Domoticz, e.g. after a software update, I receive the following error messages in Domoticz:

2020-03-18 15:43:04.991 Error: (Nefit Smartline) 'onMessage' failed 'NameError'. 2020-03-18 15:43:04.991 Error: (Nefit Smartline) ----> Line 961 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-03-18 15:43:04.991 Error: (Nefit Smartline) ----> Line 900 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-03-18 15:43:04.991 Error: (Nefit Smartline) ----> Line 113 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/mqtt.py', function onMessage 2020-03-18 15:43:04.991 Error: (Nefit Smartline) ----> Line 932 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMQTTPublish

Currently running the latest Domoticz beta v4.11795.

I also noticed the same error message, when I restarted Domoticz, while the EMS-ESP interface was powered down, as I had to install the new Thermostat Moduline 400. So obviously the plug-in cannot find the EMS-ESP interface fast enough. As long as Domoticz is running, the error message does not come back.

Regards

bbqkees commented 4 years ago

I checked it again on a Pi 4 with Buster and Domoticz 2020.1 and I cannot reproduce this error.

FireWizard52 commented 4 years ago

Hello Kees,

I am running the latest Domoticz beta, currently v2020.1, build 11836. Updated some minutes ago. During restart I see the following information, regarding "Nefit Smartline". 2020-03-26 15:33:49.919 Status: (Nefit Smartline) Entering work loop. 2020-03-26 15:33:49.921 Status: (Nefit Smartline) Initialized version 1.0 2020-03-26 15:33:50.078 (Nefit Smartline) Successful connect to: 192.168.10.51:1883 2020-03-26 15:33:50.079 (Nefit Smartline) MQTT CONNECT ID: 'Domoticz_1585233230' 2020-03-26 15:33:50.131 (Nefit Smartline) onMessage called with: CONNACK 2020-03-26 15:33:50.182 (Nefit Smartline) onMessage called with: SUBACK 2020-03-26 15:33:50.193 Error: (Nefit Smartline) 'onMessage' failed 'NameError'. 2020-03-26 15:33:50.193 Error: (Nefit Smartline) ----> Line 821 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-03-26 15:33:50.193 Error: (Nefit Smartline) ----> Line 760 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-03-26 15:33:50.193 Error: (Nefit Smartline) ----> Line 113 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/mqtt.py', function onMessage 2020-03-26 15:33:50.193 Error: (Nefit Smartline) ----> Line 792 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMQTTPublish

What is 'NameError'? Is there anything, I can do or check? It happens only after reboot. Has it to do with the speed of the Raspberry Pi's? In my case Domoticz runs on a Raspberry Pi 2B+ and, of course, Buster, with all updates installed. My MQTT server, Mosquitto, runs on a Raspberry Pi 1B, so the first generation.

If not, we leave it, for the moment, as it does not prevent correct operation, but creates only that error. I assume that the next time "onMessage" is called, everything is correct.

Just a question. Which version of Python is used for you plugin? 2 or 3? Regards

bbqkees commented 4 years ago

Yesterday I updated my own machine from Debian Stretch to Buster and to Domoticz 2020.1. Now I finally have the same error. On a Pi4 here with a initial install of Buster I don't have it.

I am not going to put any more effort into it for the moment as it only happens at boot and it does not disturb anything. I'll leave this open and put it on the To Do list.

A NameErrror is raised when something is being called which is not there (but is supposed to be).

FireWizard52 commented 4 years ago

Hello Kees,

Also my Raspberry Pi's, were updated from Stretch to Buster, because of the new requirements for Domoticz after beta v4.11665. Strange that an initial install reacts different than a updated version. Ok, at least it is not the speed difference between the Raspberry Pi versions.

I fully agree, not to put special effort in this issue, as it it occurs only during start up. Put it on the "To Do" list. In the meantime I already found what the background of this NameError is. Thanks for the info and your reaction.

I think we can close this issue for now, unless you want to leave it open as a reminder, but you have it already in your Feature backlog.

FireWizard52 commented 4 years ago

Śome additional information. Not only after a restart of Domoticz you will see these error message, but also after MQTT issues. At the moment I have something like that and it gives me the following in the log:

2020-04-01 05:15:21.132 Error: MQTT: disconnected, restarting (rc=7) 2020-04-01 05:15:22.360 Error: (Nefit Smartline): Async Read Exception (192.168.10.51:1883): 104, Connection reset by peer 2020-04-01 05:15:30.711 Error: (Nefit Smartline) 'onMessage' failed 'NameError'. 2020-04-01 05:15:30.711 Error: (Nefit Smartline) ----> Line 821 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-04-01 05:15:30.711 Error: (Nefit Smartline) ----> Line 760 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage 2020-04-01 05:15:30.711 Error: (Nefit Smartline) ----> Line 113 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/mqtt.py', function onMessage 2020-04-01 05:15:30.711 Error: (Nefit Smartline) ----> Line 792 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMQTTPublish

Perhaps, this gives a more info. `

sq4bja commented 4 years ago

It is still in newest beta updated today, but everything is working good:

2020-04-03 16:16:24.357 Error: (BUDERUS) 'onMessage' failed 'NameError'.
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 822 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 761 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 113 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/mqtt.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 793 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMQTTPublish
2020-04-03 16:16:24.357 Error: (BUDERUS) 'onMessage' failed 'NameError'.
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 822 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 761 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 113 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/mqtt.py', function onMessage
2020-04-03 16:16:24.357 Error: (BUDERUS) ----> Line 793 in '/home/pi/domoticz/plugins/ems-esp-domoticz-plugin/plugin.py', function onMQTTPublish
FireWizard52 commented 4 years ago

As I had other issues with the MQTT connection, I suspected my Rasberry Pi is causing the problems. This is still a first generation Pi (Model 1B) running Domoticz (as a slave), Mosquitto and Node-Red. This all on Raspbian Buster. Some flows may cause a high CPU load.

Therefore I decided to install a new Mosquitto server. This is running in a FreeBSD jail on my FreeNas Server on a HP MicroGen 8 server. I routed my EMS-ESP through this new MQTT server to Domoticz. Since then I did not see that message again. I think that the Raspberry Pi 1B is to slow and therefore the message is not available at the moment we need it.

However I will test the new beta.

For me it is already solved, so I close this topic.

Thanks and regards