Page 6 of 9

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 22:44
by manjh
ycahome wrote: Thursday 01 February 2018 22:37
manjh wrote: Thursday 01 February 2018 22:26
ycahome wrote: Thursday 01 February 2018 20:52 Do you have password protection on your domoticz?
Yes I do. But anything coming from within my network (10.0.0.*) comes in free. As wel as 127.0.0.*, and 10.0.8.*.
try to add "::1", I saw that connections from localhost logged as "Incoming connection from: ::1"

Don't forget to use version 1.2.2. Contains some corrections.
I just tried to remove the access control (removed userid/pw), and ran the debug cycle again. Now the mail comes in without problems, so I can confirm that this was the root cause.

For testing sake I have reinstated the access control but now added "::1", as you suggested. I will know in five minutes...

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 22:47
by manjh
Another usability suggestion: expand the text in the warning mail to be more descriptive.
For example:

Code: Select all

WAN IP address has changed.
Old IP : 145.129.114.127
New IP: 145.129.114.125

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 22:50
by ycahome
manjh wrote: Thursday 01 February 2018 22:47 Another usability suggestion: expand the text in the warning mail to be more descriptive.
For example:

Code: Select all

WAN IP address has changed.
Old IP : 145.129.114.127
New IP: 145.129.114.125
:lol: You are totally right but, there are some limitations on the API.
Seems that cannot work with spaces.

I will keep trying

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 22:53
by manjh
No luck.

I still get this:

Code: Select all

2018-02-01 22:50:22.433 (WAN IP Checker) IP Discovery Site's response len is:15
2018-02-01 22:50:22.433 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 22:50:22.433 (WAN IP Checker) Previous WAN IP:145.129.114.127
2018-02-01 22:50:22.433 Error: (WAN IP Checker) Debug is on. Trigering IP Change:
2018-02-01 22:50:22.433 (WAN IP Checker) WAN IP Updated to:145.129.114.127
2018-02-01 22:50:22.433 (WAN IP) Updating device from 1:'145.129.114.127' to have values 1:'145.129.114.127'.
2018-02-01 22:50:22.795 (WAN IP Checker) Running WAN IP Notifications
2018-02-01 22:50:22.795 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 22:50:22.795 (WAN IP Checker) ConstructedURL ServerURL is:http://localhost:8080/json.htm?param=sendnotification&type=command
2018-02-01 22:50:22.795 (WAN IP Checker) ConstructedURL is:http://localhost:8080/json.htm?param=sendnotification&type=command&subject=WAN-IP-Changed&body=145.129.114.127
2018-02-01 22:50:22.801 Error: (WAN IP Checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?param=sendnotification&type=command&subject=WAN-IP-Changed&body=145.129.114.127
The values in the local networks are:

Code: Select all

10.0.0.*; 127.0.0.*; 10.8.0.*;::0
For my own installation, I am going to remove userid/pw protection, since the only outside access to my net is through a VPN server anyway. Extra userid/PW protection is not needed anymore.

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 22:55
by manjh
ycahome wrote: Thursday 01 February 2018 22:50
manjh wrote: Thursday 01 February 2018 22:47 Another usability suggestion: expand the text in the warning mail to be more descriptive.
For example:

Code: Select all

WAN IP address has changed.
Old IP : 145.129.114.127
New IP: 145.129.114.125
:lol: You are totally right but, there are some limitations on the API.
Seems that cannot work with spaces.

I will keep trying
OK. Can you store in a variable and hand that to the API?
Alternatively, use underscores instead of spaces (brrrr :shock: ).

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 23:05
by manjh
manjh wrote: Thursday 01 February 2018 22:53 No luck.

I still get this:

Code: Select all

2018-02-01 22:50:22.433 (WAN IP Checker) IP Discovery Site's response len is:15
2018-02-01 22:50:22.433 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 22:50:22.433 (WAN IP Checker) Previous WAN IP:145.129.114.127
2018-02-01 22:50:22.433 Error: (WAN IP Checker) Debug is on. Trigering IP Change:
2018-02-01 22:50:22.433 (WAN IP Checker) WAN IP Updated to:145.129.114.127
2018-02-01 22:50:22.433 (WAN IP) Updating device from 1:'145.129.114.127' to have values 1:'145.129.114.127'.
2018-02-01 22:50:22.795 (WAN IP Checker) Running WAN IP Notifications
2018-02-01 22:50:22.795 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 22:50:22.795 (WAN IP Checker) ConstructedURL ServerURL is:http://localhost:8080/json.htm?param=sendnotification&type=command
2018-02-01 22:50:22.795 (WAN IP Checker) ConstructedURL is:http://localhost:8080/json.htm?param=sendnotification&type=command&subject=WAN-IP-Changed&body=145.129.114.127
2018-02-01 22:50:22.801 Error: (WAN IP Checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?param=sendnotification&type=command&subject=WAN-IP-Changed&body=145.129.114.127
The values in the local networks are:

Code: Select all

10.0.0.*; 127.0.0.*; 10.8.0.*;::0
For my own installation, I am going to remove userid/pw protection, since the only outside access to my net is through a VPN server anyway. Extra userid/PW protection is not needed anymore.
OK, removed the userid/pw again, and it now works like a charm.
I'm happy, but if you want to solve the access topic: let me know if I can do more testing.

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 23:09
by manjh
What I wanted to add to this discussion: sorry if I seemed to be a nuisance, but that is the usual tension between developer and tester.
In the end it is the quality of the plugin that counts, I think that's worth it. Don't you? :)

Re: Plugin - Wan IP Checker

Posted: Thursday 01 February 2018 23:26
by manjh
Suggestion: in stead of "http://localhost:8080" would it be possible to try "http://127.0.0.1:8080"?

Re: Plugin - Wan IP Checker

Posted: Friday 02 February 2018 9:17
by ycahome
If I try to integrate authentication we should cover multiple cases and am afraid that is too much work for nothing.
I think we should wait for a native plugin notification option.

For the authentication, you can go and modify line 133 of the plugin in order to test with authentication.

Change:

Code: Select all

ServerURL = "http://localhost:8080/json.htm?param=sendnotification&type=command"


to:

Code: Select all

ServerURL = "http://username:password@localhost:8080/json.htm?param=sendnotification&type=command"

As for the localhost, will be changed to "127.0.0.1" on the next release.

Re: Plugin - Wan IP Checker

Posted: Friday 02 February 2018 9:28
by manjh
ycahome wrote: Friday 02 February 2018 9:17 If I try to integrate authentication we should cover multiple cases and am afraid that is too much work for nothing.
I think we should wait for a native plugin notification option.

For the authentication, you can go and modify line 133 of the plugin in order to test with authentication.

Change:

Code: Select all

ServerURL = "http://localhost:8080/json.htm?param=sendnotification&type=command"


to:

Code: Select all

ServerURL = "http://username:password@localhost:8080/json.htm?param=sendnotification&type=command"

As for the localhost, will be changed to "127.0.0.1" on the next release.
I am not suggestion to incorporate userid/pw authentication into the plugin. All users would have to modify the code, and that is not a good idea.
Changing the "localhost" into "127.0.0.1" would be better, since it would then fall into the "local networks" exception. Specifying that mask in the "local networks" field in the settings tab means that any connection coming in from that subnet address mask, is excempt from userid/pw checking.

Re: Plugin - Wan IP Checker

Posted: Friday 02 February 2018 9:39
by manjh
I changed "localhost" into "127.0.0.1", activated the userid/pw authentication and ran a test:

Code: Select all

2018-02-02 09:35:41.818 Error: (WAN IP Checker) Debug is on. Trigering IP Change:
2018-02-02 09:35:41.818 (WAN IP Checker) WAN IP Updated to:145.129.114.127
2018-02-02 09:35:42.465 (WAN IP Checker) Running WAN IP Notifications
2018-02-02 09:35:42.465 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-02 09:35:42.466 (WAN IP Checker) ConstructedURL ServerURL is:http://127.0.0.1:8080/json.htm?param=sendnotification&type=command
2018-02-02 09:35:42.466 (WAN IP Checker) ConstructedURL is:http://127.0.0.1:8080/json.htm?param=sendnotification&type=command&subject=WAN-IP-Changed&body=145.129.114.127
The warning mail was sent successfully! So I would suggest this change in the next version would solve the triggering problem. Also, add a line covering this in the instructions: "when userid/pw checking is active, make sure to add 127.0.0.* to the Local Networks field" and the Settings tab of Domoticz.

Re: Plugin - Wan IP Checker

Posted: Friday 02 February 2018 9:52
by ycahome
manjh wrote: Friday 02 February 2018 9:39 I changed "localhost" into "127.0.0.1", activated the userid/pw authentication and ran a test:

The warning mail was sent successfully! So I would suggest this change in the next version would solve the triggering problem. Also, add a line covering this in the instructions: "when userid/pw checking is active, make sure to add 127.0.0.* to the Local Networks field" and the Settings tab of Domoticz.
I ve changed the version and added the "disclaimer" to the first post.

Thank you for your help

Re: Python Plugin: Wan IP Checker

Posted: Sunday 04 February 2018 23:29
by lmet
Hi,
I have installed your plugin and I have a problem. I receive notifications every two minutes while my WAN-IP address has not changed.
img_003.jpg
img_003.jpg (87.17 KiB) Viewed 3227 times
My wife receives SMS with the same message also with the same frequency.
I disabled the plufin while waiting for a response.
thank you in advance
I forgot to tell that I have nothing on Utility tab.

Re: Python Plugin: Wan IP Checker

Posted: Monday 05 February 2018 9:23
by ycahome
Plugin posts 3 notifications/minute on debug mode.

You can either disable "debug" mode or "notifications"

Re: Python Plugin: Wan IP Checker

Posted: Tuesday 06 February 2018 15:37
by lmet
Thank's a lot. Now waiting my IP to change ;)

Re: Python Plugin: Wan IP Checker

Posted: Friday 09 February 2018 3:20
by hamster
hey @ycahome, posted same question in thread of another plugin I use and figured I'd ask here too:
Do you have any plans to create a plugin version to work with beta versions? The way the beta handles plugins will eventually be the stable way, so was hoping you might be willing to have two versions until the merge :)

Re: Python Plugin: Wan IP Checker

Posted: Friday 09 February 2018 10:25
by ycahome
hamster wrote: Friday 09 February 2018 3:20 hey @ycahome, posted same question in thread of another plugin I use and figured I'd ask here too:
Do you have any plans to create a plugin version to work with beta versions? The way the beta handles plugins will eventually be the stable way, so was hoping you might be willing to have two versions until the merge :)

Hello @hamster.

what am reading on the article you mention is that a specific breaking change happened on plugin framework. This change is related to HTTP support of this framework.
I don't use this functionality yet on my plugins via this framework. Am using urllib instead.

Apart from the above, i already tested my plugins to the latest Beta and seem to work fine.
You are facing problems?or your question was informational?

Re: Python Plugin: Wan IP Checker

Posted: Friday 09 February 2018 13:30
by hamster
Oh, I just assumed that may have been the issue because I recently went from stable to the latest beta and now none of my 3rd party plugins appear in the hardware list anymore. so, trying to figure out whats wrong.

edit: DONKEY BALLS. so, apparently the "enabled" slider for lua/events/scripts doesnt show properly in Chrome, so the thing was disabled this whole time. finally ran across another forum post that mentioned it and tried IE and could see it... geez. sorry for false report.

Re: Python Plugin: Wan IP Checker

Posted: Sunday 11 February 2018 16:48
by manjh
remark for the instructions on the plugin: the directory where to install is "plugins", not "plugin". Nitpicking.... :oops:

Re: Python Plugin: Wan IP Checker

Posted: Sunday 11 February 2018 16:51
by manjh
I'm confused. I have this plugin running on my "production" Domoticz server with no problems.
But now I am setting up a second R-Pi as testbed, and somehow can't get the WAN IP checker installed.
Created the WAN-IP-CHECKER directory with the plugin.py file in it.
Then restarted Domoticz service, but the hardware dropdown does not show the plugin.
I double checked and found nothing wrong. Also tried a full reboot, no luck.

Any idea what might be causing this? I'm sure it must be something I forgot, but what? :o :shock: