dnpwwo / Domoticz-Pinger-Plugin

Python plugin that pings and shows response times for network devices
MIT License
5 stars 1 forks source link

Object has no attribute 'Name' #2

Open MarcusKlerks opened 6 years ago

MarcusKlerks commented 6 years ago

On my (test setup) Raspberry PI - Stretch, fully updated running Domoticz latest beta I get the following errors in the log upon installing the Pinger plugin. Any idea what I`m doing wrong? Thanks, Mark <2018-08-02 19:19:26.329 (Ping) Update 0:'' (Ping - 192.168.2.215) 2018-08-02 19:19:26.331 (Ping) Update 0:'' (Ping - 192.168.2.215) 2018-08-02 19:19:26.137 Status: (Ping) Started. 2018-08-02 19:19:26.324 Status: (Ping) Entering work loop. 2018-08-02 19:19:26.324 Status: (Ping) Initialized version 3.1.3, author 'dnpwwo' 2018-08-02 19:19:35.901 (Ping) Update 1:'On' (Ping - 192.168.2.215) 2018-08-02 19:19:35.903 (Ping) Update 1:'1' (Ping - 192.168.2.215) 2018-08-02 19:19:45.871 Error: (Ping) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2018-08-02 19:19:45.871 Error: (Ping) ----> Line 187 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:19:45.871 Error: (Ping) ----> Line 155 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:19:55.838 Error: (Ping) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2018-08-02 19:19:55.838 Error: (Ping) ----> Line 187 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:19:55.838 Error: (Ping) ----> Line 155 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:20:05.854 Error: (Ping) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2018-08-02 19:20:05.855 Error: (Ping) ----> Line 187 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:20:05.855 Error: (Ping) ----> Line 155 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:20:15.870 Error: (Ping) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2018-08-02 19:20:15.870 Error: (Ping) ----> Line 187 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:20:15.870 Error: (Ping) ----> Line 155 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py, function onHeartbeat 2018-08-02 19:20:24.983 Status: (Ping) Stop directive received. 2018-08-02 19:20:25.333 Status: (Ping) Exiting work loop. 2018-08-02 19:20:55.005 Status: (Ping) Stopping threads. 2018-08-02 19:20:55.006 Status: (Ping) Stopped. >

Sandolution commented 5 years ago

Got the same error, looked a bit into the Python code but couldn't get it fixed

abertolin commented 5 years ago

I have the same problem, I don't know what to do more ! Please, Help !!

dnpwwo commented 5 years ago

Can you post the details of the parameters you have set in the Hardware tab?

Sandolution commented 5 years ago

Settings are as follows: Address(es) comma separated: see below Ping frequency: 10 Timeout lost devices: true Debug: none

The behaviour differs depending on the addresses I enter. One address (192.168.64.1) (gateway) gives me one switch (On) and one custom sensor with value 34585ms, which seems a bit to much :) Two or more addresses (192.168.64.1, 192.168.64.5) (gateway & server) give me both two switches and two custom sensor, but one is one and one is off.

If needed I can do some more detailed test tomorrow

abertolin commented 5 years ago

Mine are as follows: one address (the gateway) Ping Frequency: 20 Timeout lost devices: true Debug: none

The behaviour is: It doesn't create the switches anthe custom sensor and in the log I have every 20 seconds the following messages: 2019-01-15 13:48:01.731 Error: (Ping gateway) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-01-15 13:48:01.731 Error: (Ping gateway) ----> Line 187 in '/home/pi/domoticz/plugins/Pinger/plugin.py', function onHeartbeat 2019-01-15 13:48:01.731 Error: (Ping gateway) ----> Line 155 in '/home/pi/domoticz/plugins/Pinger/plugin.py', function onHeartbeat

Version of Python installed:

Tell me if you need some more. Kind Regards

abertolin commented 5 years ago

One more thing: if I try to remove the Pinger from the hardware, Domoticz crash !!! I have to delete the folder from plugin, restart Domoticz and then I'm able to remove the Pinger without problem Thanks

FearNaBoinne commented 5 years ago

I am seeing the exact same error:

2019-07-09 16:28:38.379 (Is it alive) Update 1:'On' (Is it alive - 10.50.164.5) 2019-07-09 16:28:38.379 (Is it alive) Update 1:'1' (Is it alive - 10.50.164.5) 2019-07-09 16:28:48.202 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:28:48.202 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:28:48.202 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:28:58.174 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:28:58.174 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:28:58.174 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:08.197 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:08.198 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:08.198 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:13.754 (Is it alive) Update 372:'372' (Is it alive - 10.50.164.5) 2019-07-09 16:29:13.754 Error: (Is it alive) 'onMessage' failed 'AttributeError':''NoneType' object has no attribute 'Disconnect''. 2019-07-09 16:29:13.754 Error: (Is it alive) ----> Line 183 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onMessage 2019-07-09 16:29:13.754 Error: (Is it alive) ----> Line 147 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onMessage 2019-07-09 16:29:13.754 Error: (Is it alive) ----> Line 81 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function Close 2019-07-09 16:29:18.214 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:18.214 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:18.214 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:28.186 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:28.186 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:28.186 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:38.369 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:38.369 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:38.369 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:48.192 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:48.192 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:48.192 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:51.751 (Is it alive) Update 689:'689' (Is it alive - 10.50.164.5) 2019-07-09 16:29:51.751 Error: (Is it alive) 'onMessage' failed 'AttributeError':''NoneType' object has no attribute 'Disconnect''. 2019-07-09 16:29:51.751 Error: (Is it alive) ----> Line 183 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onMessage 2019-07-09 16:29:51.751 Error: (Is it alive) ----> Line 147 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onMessage 2019-07-09 16:29:51.751 Error: (Is it alive) ----> Line 81 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function Close 2019-07-09 16:29:58.216 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:29:58.216 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:29:58.216 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:30:08.189 Error: (Is it alive) 'onHeartbeat' failed 'AttributeError':''IcmpDevice' object has no attribute 'Name''. 2019-07-09 16:30:08.189 Error: (Is it alive) ----> Line 187 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat 2019-07-09 16:30:08.189 Error: (Is it alive) ----> Line 155 in '/opt/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onHeartbeat

FearNaBoinne commented 5 years ago

The No Name part was easy to fix by adding it to the class IcmpDevice... The Disconnect however is a bigger challenge, it is as if Domoticz is not exporting that function, even though it is defined in PythonObjects... Not using Disconnect() seems to heap the listeners on top of eachother, causing many concurrent listeners doing concurrent changes... It gets messy after a while! Still looking at that bit... The example linked to in the wiki doesn't use the disconnect, so that seems kinda wrong.., ;)

FearNaBoinne commented 5 years ago

Yeah, gave up on this (even though it is based on an official example, it doesn't work well) despite fixing the Name and Disconnect attribute missing issues. The ICMP instances never get destroyed, so the old pings stay in there and stack up, causing ridiculously high ping times... As I am not really interested in the ping times, only whether it is up or down, I have turned to using monit for the up/down testing

FearNaBoinne commented 5 years ago

(PS: If the Is Alive 'hardware' built in to Domoticz just worked, not even that would have been necessary, but it doesn't...)

jerkelens commented 4 years ago

Has this ever been resolved? It's still generating these errors. Thanks

cric-ric commented 4 years ago

Same here. Domoticz 2020.2, it has crashed several time my Domoticz instance (running on Raspbian Buster) and it shows a ping device with cumulative values, and the same error message : 2020-05-12 19:44:15.853 Error: (Pinger-ICMP) ----> Line 147 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', function onMessage 2020-05-12 19:44:15.861 Error: (Pinger-ICMP) 'onMessage' failed 'AttributeError':''NoneType' object has no attribute 'Close''. 2020-05-12 19:44:15.861 Error: (Pinger-ICMP) ----> Line 185 in '/home/pi/domoticz/plugins/Domoticz-Pinger-Plugin/plugin.py', functiononMessage`