Update to DynDNS module
DHawthorne
Posts: 4,584
Repost from ACE area, which not everyone has access to:
I've updated this module with a few bug fixes:
1) If the master was reset while an IP connection was pending, it would never try to reconnect again. Fixed so that a pending status is cleared on restart.
2) One client that had this installed was having some difficulty with his cable modem so that responses across the Internet were extremely lagged at times, resulting in timeouts on IP checks. This, in turn, resulted in the IP being set as blank, and forced an update to DynDNS. DynDNS took exception to that and shut down the host for "abusive" updates. To prevent this, I've added code that checks IP values to at least verify they are complete and in the proper format, and if not, flags the IP as unknown rather than changed so it will not act unless a check goes through, gets a valid address, and determines the IP really has changed. I also applied the check to the "SET IP=" command while I was at it.
All that is needed is to drop the new TKO file where the old one was in your project, then recompile and load the project. The AXI file has only changed in terms of the documentory comments; you do not need to replace it (and if you do anyway, make sure you edit it for your project appropriately). You can verify the new version was installed by Telnetting your master after the update, turning on diagnostic messages, and using a send_command to the virtual device interface (default is 33020) of "'QUERY=STATUS'". Among the information that is returned should be a version number of 1.0a.
I've updated this module with a few bug fixes:
1) If the master was reset while an IP connection was pending, it would never try to reconnect again. Fixed so that a pending status is cleared on restart.
2) One client that had this installed was having some difficulty with his cable modem so that responses across the Internet were extremely lagged at times, resulting in timeouts on IP checks. This, in turn, resulted in the IP being set as blank, and forced an update to DynDNS. DynDNS took exception to that and shut down the host for "abusive" updates. To prevent this, I've added code that checks IP values to at least verify they are complete and in the proper format, and if not, flags the IP as unknown rather than changed so it will not act unless a check goes through, gets a valid address, and determines the IP really has changed. I also applied the check to the "SET IP=" command while I was at it.
All that is needed is to drop the new TKO file where the old one was in your project, then recompile and load the project. The AXI file has only changed in terms of the documentory comments; you do not need to replace it (and if you do anyway, make sure you edit it for your project appropriately). You can verify the new version was installed by Telnetting your master after the update, turning on diagnostic messages, and using a send_command to the virtual device interface (default is 33020) of "'QUERY=STATUS'". Among the information that is returned should be a version number of 1.0a.
0
Comments
Hi DAVE,
I tried to use DYNDNS module, I followed the installation notes...but the result is this list of errors:
UNKNOW HOST: checkip.dyndns.org
ClientOpen PanjaInetAddr or hostGetNyName error 0x0
CIpEvent::OnError 0:5:1
It seems that the module isn't able to use the "check ip service" of DYNDNS.
please, can you hel me?
thank you very much
ciao
From a Windows machine connected to the same network as the NetLinx, run a command window and type in ipconfig /all . This will tell you the proper DNS settings for your network, which you can then put into the NetLinx. If all else fails, you can use 204.13.250.51 instead of checkip.dyndns.org, but it's not recommended because they may change the IP. Alternately, you can use any IP check service that outputs "Address: <IP number>," including one locally hosted.
thank you for fast replay.
You are right! I had to set the DNS on my NI-3000.
Unfortunately there is another type of problem:
when I try to force the IP UDATE, this is the reply:
send_command 33020, "'reset=ip'"
>(0001246199) DYNDNS Module COMMAND ECHO --> reset=ip
(0001246201) DYNDNS Module --> Setting IP state to UNKNOWN, forcing IP check
(0001246488) Connected Successfully
(0001246490) CIpEvent::OnLine 0:2:1
(0001246491) DYNDNS Module --> Checking for IP change with service at checkip.dyndns.org
(0001246725) Exiting TCP Read thread - closing this socket for local port 2
(0001246727) CIpEvent::OffLine 0:2:1
(0001246728) DYNDNS Module <-- HTTP/1.0 200 OK
Server: Cherokee/0.4.6
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Conn
Afther this command, I ask for information from the DYNDNS module:
send_command 33020, "'query=status'"
>(0001582550) DYNDNS Module COMMAND ECHO --> query=status
(0001582554) DYNDNS Module --> Version 1.0a
(0001582554) DYNDNS Module --> Current IP =
(0001582555) DYNDNS Module --> IP last checked 10/24/05 at 18:55:57
(0001582555) DYNDNS Module --> Host: ***********
(0001582556) DYNDNS Module --> IP last updated on 10/24/05
(0001582556) DYNDNS Module --> Module Status is: NORMAL
(0001582557) DYNDNS Module --> Connect status = NOT CONNECTED
(0001582557) DYNDNS Module --> Connect mode = IDLE
(0001582558) DYNDNS Module --> IP Status = IP UNKNOWN
(0001582558) DYNDNS Module --> Debug mode is ON
I cannot see my IP (it's blank!) and when I PING the my site www.*******.net I receive the message "host is not on line".
Thank you for your suggestions
ciao
giacomo
>(0000380657) DYNDNS Module COMMAND ECHO --> QUERY=STATUS
(0000380659) DYNDNS Module --> Version 1.0a
(0000380659) DYNDNS Module --> Current IP =
(0000380659) DYNDNS Module --> IP last checked 12/20/07 at 14:40:53
(0000380659) DYNDNS Module --> Host: xxxxxxxxx.xxxxxx.com
(0000380660) DYNDNS Module --> IP last updated on 12/20/07
(0000380660) DYNDNS Module --> Module Status is: NORMAL
(0000380660) DYNDNS Module --> Connect status = NOT CONNECTED
(0000380661) DYNDNS Module --> Connect mode = IDLE
(0000380661) DYNDNS Module --> IP Status = IP UNKNOWN
(0000380662) DYNDNS Module --> Debug mode is ON
so I force the reset of the IP and query again
>SEND_COMMAND 33020, "'RESET=IP'"
>(0000503077) DYNDNS Module COMMAND ECHO --> RESET=IP
(0000503078) DYNDNS Module --> Setting IP state to UNKNOWN, forcing IP check
(0000503163) Connected Successfully
(0000503164) CIpEvent::OnLine 0:15:3
(0000503165) DYNDNS Module --> Checking for IP change with service at checkip.dyndns.org
(0000503207) Exiting TCP Read thread - closing this socket for local port 15
(0000503208) CIpEvent::OffLine 0:15:3
(0000503209) SendString 0:0:0 too long 278 truncated to 274
(0000503209) DYNDNS Module <-- HTTP/1.1 200 OK
Content-Type: text/html
Server: DynDNS-CheckIP/1.0
Connection: close
Cache-Control: no-cache
>SEND_COMMAND 33020, "'QUERY=STATUS'"
>(0000582291) DYNDNS Module COMMAND ECHO --> QUERY=STATUS
(0000582292) DYNDNS Module --> Version 1.0a
(0000582293) DYNDNS Module --> Current IP =
(0000582293) DYNDNS Module --> IP last checked 12/20/07 at 14:47:28
(0000582294) DYNDNS Module --> Host: xxxxxxxx.xxxxxxxxx.com
(0000582294) DYNDNS Module --> IP last updated on 12/20/07
(0000582295) DYNDNS Module --> Module Status is: NORMAL
(0000582295) DYNDNS Module --> Connect status = NOT CONNECTED
(0000582295) DYNDNS Module --> Connect mode = IDLE
(0000582295) DYNDNS Module --> IP Status = IP UNKNOWN
(0000582296) DYNDNS Module --> Debug mode is ON
Can you see where and if something is going wrong?
Thanks,
Chris
There are a few other minor bug fixes, and are detailed in the installation text file.
Someone raised the concern that the login information is stored in plain text in the AXI file, and anyone with access to it could conceivably mess with your DynDNS account. Though I couldn't imagine why someone would do such a thing, it is a valid concern. So, I have removed the login information from the AXI file, and you now have to set it using a send command of the form "'SET LOGIN=username: password'" (no space after the colon, I added that to prevent the forum turnng it into a smiley). This new version will disable itself immediately if this is not done. When you issue the command, it is encrypted and stored in the module memory, and written in its encrypted form to a file on the master so it will survive code updates.
The encryption is not very strong; but it is the same encryption that DynDNS accepts when using the update service. Since anyone so inclined could intercept a packet sent during an update, and conceivably crack that encryption, I didn't figure it was necessary to store it in a stronger form (though I have seen a module using Blowfish for this, it seemed to me like putting five padlocks and a deadbolt on the front door, but leaving just a hook latch on the back ... my way only has two hook latches, but it's still better than leaving it wide open). As far as I can tell, the only better security DynDNS offers is using an SSL connection, but I wasn't about to go that far for such a simple module.
I also made a minor change so that if you issue a "'RESET=IP'" command on an established system, it will check the IP immediately instead of waiting for the next scheduled IP check.
*** WARNING ***
This update **WILL** break any older versions if you are not storing separate copies in every project folder. As soon as the module starts up, if it cannot find the password file on the master, it will disable itself. Setting the login information will reset it, and all should be well after that. I recommend you turn on debugging when doing so to make sure everything goes a s expected. Also, don't forget to update your AXI files so the login data is no longer there, or the encryption addition will be utterly wasted .
When I send the command RESET=IP to manually get the current ip address, it replies:
SEND COMMAND 33030,"'RESET=IP'"
>(0000636362) DYNDNS Module COMMAND ECHO --> RESET=IP
(0000636366) Ref Error ^LIPCHECKTIME Index 0 Line=628
(0000636368) CIpLibrary::Timeline_Set - Error
(0000636369) DYNDNS Module --> Setting IP state to UNKNOWN, forcing IP check
(0000786360) UNKNOWN HOST: checkip.dyndns.org
(0000786362) ClientOpen PanjaInetAddr or hostGetNyName error 0x0
(0000786363) CIpEvent::OnError 0:30:2
SEND_COMMAND 33030,"'QUERY=STATUS'"
>(0000883042) DYNDNS Module COMMAND ECHO --> QUERY=STATUS
(0000883046) DYNDNS Module --> Version 1.03.1
(0000883047) DYNDNS Module --> Current IP = 1.1.1.1
(0000883048) DYNDNS Module --> IP not yet checked with IP service
(0000883049) DYNDNS Module --> Host: wms.dynalias.com
(0000883050) DYNDNS Module --> IP last updated on 02/25/09
(0000883051) DYNDNS Module --> Module Status is: NORMAL
(0000883052) DYNDNS Module --> Connect status = NOT CONNECTED
(0000883054) DYNDNS Module --> Connect mode = IDLE
(0000883055) DYNDNS Module --> IP Status = IP UNKNOWN
(0000883056) DYNDNS Module --> Debug mode is ON
There are two possibilities here:
1) DynDNS.com had a temporary service outage. If that's the case, it will more than likely be resolved within an hour.
2) More likely: your network is not properly set up on the master. Pay particular attention to the DNS server entries. If you are using a static IP in your master (recommended highly), your best bet is to set it up for DHCP first, let it get all the pertinent info from the DHCP server, then go back and set it for static and change only the actual IP number. I've also found it is usually sufficient to set the first DNS server IP to the IP of your router, in case your provider changes DNS locations on you.
Trying to use this module with no much joy. Can you look at the reply from checkip.dyndns.org and, perhaps, spot my mistake.
I agree. I've got about eight projects using this, and although sometimes it may lockup on one project or another, they all still do work. It would be nice if there were a flag one could set to tell the module to do an automatic reset if it is in trouble mode for more than two months.
I am sure the module is fine... It works just fine in onother application. It might be something site specific or just my bad luck.
Hey, I provided the source, go for it . Though actually, I deliberately didn't do it that way to force the account to be corrected rather than annoy DynDNS with repeated bad attempts. What I do is check my account page regularly to see which systems haven't been reporting. Nine times out of ten, it's because something changed at the house and they have no connectivity at all on the NetLinx anymore. I had a customer recently change his router and reconfigure his home network to a different subnet just so he could VPN in from the office. When the entire AV network blew up because all the IP's were static (and now not only on the wrong subnet, but also not having the necessary ports forwarded), he casually calls me up and says I need to "fix the AMX, it doesn't work anymore." People forget it's a network device, and if they change the network, it needs to be updated as well.
Um, well, I thought I provided the source ... guess I didn't. Here's just the source axs.