Sign up here and you can log into the forum!

ddclient 0.3 - Automatic updater for Dynamic DNS

Here is the place to inquire about app.bins--Only currently available apps for sigma 8655 based wdtv's belong in this forum. requests go in 'Application Questions'

ddclient 0.3 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Wed Sep 01, 2010 1:39 am

***UPDATED***: See "Version 0.3" notes below.

Have you ever wanted to access your WD TV from outside your home network? Now you can. This app will allow you to register your WD TV with dyndns.com so you can access it from anywhere using a URL like http://mywdtvlive.dyndns.org. Note that this allows access to internet functions only, such as the web browser, torrents, etc - if you want access to the screen you see on your TV, buy a Slingbox :)

Version 0.3:
* web frontend integration
* Added proxy connection on port 8081 for users whose ISPs block port 80 (i.e. regular web traffic)

http://www.mediafire.com/file/4poxh40c37qsa4g/ddclient-0.3.zip

Version 0.2:
* Moved cache to the ddclient directory so it persists between reboots
* Changed the ip address provider from checkip to dnspark, as checkip was frequently timing out
* Bug fix: rewrote the init script to check online.delayer; ddclient won't start until the internet interface is ready

http://www.mediafire.com/file/kn3jk06pt73tvt9/ddclient-0.2.zip

Version 0.1:
http://www.mediafire.com/file/a7iaadaa7zdzja2/ddclient-0.1.zip

Additionally, once you do this you can mount the hard drive of your WDTV in Windows Explorer as a regular drive; you can then drag and drop files from your computer to your WDTV hard drive even when you are away from home.

http://forum.wdlxtv.com/viewtopic.php?f=31&t=1632

From the readme:

INSTALLATION:
==================================

There are three steps to installing ddclient:
* sign up for a free dyndns account
* configure ddclient
* network configuration


DynDNS signup
--------------------
If you do not already have an account with Dynamic DNS, sign up here:
http://www.dyndns.com/services/dns/dyndns/


ddclient configuration
---------------------
ddclient can be configured through the web frontend. Click on the config link in the
ddclient icon and enter your dyndns information there.


Network Configuration
---------------------
If you are skiled at setting up statically routed devices on networks, you can
simply forward the necessary ports and configure a static IP for your WD TV. If you
have no idea what I'm talking about, then read on.

In order to make this work you will need to tell your router to forward internet
traffic to your WDTV. Instructions on how to do this are here:

http://wiki.wdlxtv.com/Port_Forwarding

I suggest forwarding at least the following ports:
HTTP: port 80 (so you can get to the web interface
HTTPS: port 443 (for secure web traffic)
FTP: port 21
SSH: port 22

Restart
--------------------
Reboot your WDTV. From a web browser, go to your dyndns domain. If you see the
regular web frontend screen, then everything is set up correctly.
Last edited by chameleon_skin on Sat Sep 11, 2010 11:30 pm, edited 3 times in total.
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby bloodflower » Wed Sep 08, 2010 2:05 pm

Hi,
thanks for this app!
But don't works for me...probably I set something wrong.. :(

Then..

From you instructions:
ok account dyndns (but it is in this format "example.dyndns-web.com" :? )
ok I changed the file ddclient.conf but.. I must change these lines (?):
wildcard:YES
jakereichert.dyndns.org

If your WD TV is behind a router (which is the case in most home networks),
you will also need to do the following. Each router is configured differently,
but most have a web interface you can log into. Check the manual for your
router for further details.
on my router I set a reserved ip address for wdtv: 192.168.0.2 (and ip add of router is 192.168.0.1)
1) Ensure that your WD has a static IP address on your network. You can do this
on your WD TV by going to Settings > Network Settings and manually setting the values
there. You will need to choose "manual" instead of "automatic".
OK
IP Address: You can typically assign your device any IP address you want on your subdomain
as long as it doesn't conflict with any other IP addresses on your network. Your router
probably has a range that it reserves for dynamic IP addresses, which you can find in
your router configuration. Ensure that you do not pick an IP address in this range.
This may be listed under "DHCP range". For example, if your DHCP range is set from
10.0.0.100 to 10.0.0.200, you can safely choose the address 10.0.0.3. Do not use any
address ending in .1, as this is the gateway address (see below).
192.168.0.2
Subnet Mask: In most cases this will be 255.255.255.0. Check your router configuration
if you are unsure.
OK
Gateway: If your IP address is AAA.BBB.CCC.DDD, then your gateway is usually
AAA.BBB.CCC.1. For example, if you assign an IP address of 10.0.0.3 to the WD TV,
the router is usually 10.0.0.1.
192.168.0.1
DNS: You should be able to get this from your internet provider. When in doubt,
I use AT&T's DNS (206.13.28.12), just because it's one of the few IP addresses
I know off the top of my head :)
I can't find DNS from my provider, is there an alternative method to find it? I set 192.168.0.1
2) In your router, forward traffic on all ports that you want your WD TV to handle.
While the method of configuration varies from router to router, you want to indicate that
traffic on the ports of interest are forwarded to the IP address you assigned to the
WD TV in step #1 above.
ok
I suggest forwarding at least the following:
HTTP: port 80 (so you can get to the web interface
HTTPS: port 443 (for secure web traffic)
FTP: port 21
SSH: port 22

So i think that the problem is with DNS setup on WDTV...what do you think?

Thanks a lot..

Roby
bloodflower
DLX'er
 
Posts: 96
Joined: Thu May 20, 2010 10:08 pm

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Wed Sep 08, 2010 10:30 pm

Hi Roby,

Your DNS setting is at least part of the problem - your router isn't a DNS server, so settng the DNS to 192.168.0.1 basically ensures that your WDTV will have problems with name resolution.

Try setting your DNS to 206.13.28.12 - that should work fine, because it's a valid DNS server. You will need to reboot your WDTV after you make those changes. If it still isn't working for you after that, post back and we can try some other things.
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Wed Sep 08, 2010 10:33 pm

also, in case it wasn't clear, you should change these three lines in ddclient.conf (and ONLY these three lines):

login=xxx: change to your real login information
password: yyy change to your real password
last line that says jakereichert.dyndns.org: change to the domain name you registered at dyndns

Leave all the other lines in the file unchanged.
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby bloodflower » Wed Sep 08, 2010 11:00 pm

Thanks for your help!
I try this evening.. ;)
bloodflower
DLX'er
 
Posts: 96
Joined: Thu May 20, 2010 10:08 pm

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby boudcallens » Thu Sep 09, 2010 2:15 am

Isn't your router a local DNS server? Otherwise you won't be able to locate media servers on your network without ip-adress. I tried your plugin without your DNS and it didn't work. Will try it with your DNS in a minute and report back ...

Edit: Checked again with the given DNS and I can't connect either. My ports are open, because if I set the IP manually in dyndns, I can do everything. But then there's no point in your application. I configured ddclient.conf in the way that you described it: username, password and dyndns domain. Can I view some logs anywhere to watch what's wrong?
boudcallens
DLX'er
 
Posts: 115
Joined: Sun Apr 18, 2010 7:14 am

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Thu Sep 09, 2010 7:47 am

Home routers aren't typically DNS servers - they are DNS *caches*, but that is not the same thing. i.e. it has the ability to retrieve DNS entries from your phone or cable company's DNS servers, but it cannot itself serve DNS information to clients on your home network. You need to get the DNS info from the same place your router does. (Resolution of internal addresses is a different thing altogether).

As for debugging, SSH into your WDTV and type the following commands

killall ddclient
ddclient -daemon=0 -debug -verbose -noquiet

Copy the output of that command into this thread and I'll take a look at it.
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby boudcallens » Fri Sep 10, 2010 12:27 am

Hi,

Thanks for informing me about the DNS servers. After excuting your commands, it actually updates my ip adress to the correct one.

Here's the output. I changed my username to mylogin, my password to mypassword


Code: Select all
# killall ddclient
# ddclient -daemon=0 -debug -verbose -noquiet
=== opt ====
opt{cache}                           : <undefined>
opt{cmd}                             : <undefined>
opt{cmd-skip}                        : <undefined>
opt{daemon}                          : 0
opt{debug}                           : 1
opt{exec}                            : <undefined>
opt{facility}                        : <undefined>
opt{file}                            : <undefined>
opt{force}                           : <undefined>
opt{fw}                              : <undefined>
opt{fw-login}                        : <undefined>
opt{fw-password}                     : <undefined>
opt{fw-skip}                         : <undefined>
opt{geturl}                          : <undefined>
opt{help}                            : <undefined>
opt{host}                            : <undefined>
opt{if}                              : <undefined>
opt{if-skip}                         : <undefined>
opt{ip}                              : <undefined>
opt{login}                           : <undefined>
opt{mail}                            : <undefined>
opt{mail-failure}                    : <undefined>
opt{max-interval}                    : 2160000
opt{min-error-interval}              : 300
opt{min-interval}                    : 30
opt{options}                         : <undefined>
opt{password}                        : <undefined>
opt{pid}                             : <undefined>
opt{priority}                        : <undefined>
opt{protocol}                        : <undefined>
opt{proxy}                           : <undefined>
opt{query}                           : <undefined>
opt{quiet}                           : 0
opt{retry}                           : <undefined>
opt{server}                          : <undefined>
opt{ssl}                             : <undefined>
opt{syslog}                          : <undefined>
opt{test}                            : <undefined>
opt{timeout}                         : <undefined>
opt{use}                             : <undefined>
opt{verbose}                         : 1
opt{web}                             : <undefined>
opt{web-skip}                        : <undefined>
=== globals ====
globals{cache}                       : /tmp/ddclient.cache
globals{daemon}                      : 60
globals{debug}                       : 1
globals{login}                       : mylogindetails
globals{password}                    : mypassworddetails
globals{pid}                         : /tmp/ddclient.pid
globals{protocol}                    : dyndns2
globals{quiet}                       : 0
globals{server}                      : members.dyndns.org
globals{use}                         : web
globals{verbose}                     : 1
globals{web}                         : checkip.dyndns.com/
globals{web-skip}                    : IP Address
globals{wildcard}                    : 1
=== config ====
config{mylogin.dyndns.org}{atime} : 0
config{mylogin.dyndns.org}{backupmx} : 0
config{mylogin.dyndns.org}{cacheable} : ARRAY(0x68d798)
config{mylogin.dyndns.org}{custom} : 0
config{mylogin.dyndns.org}{host} : mylogin.dyndns.org
config{mylogin.dyndns.org}{ip}   : <undefined>
config{mylogin.dyndns.org}{login} : mylog
config{mylogin.dyndns.org}{max-interval} : 2160000
config{mylogin.dyndns.org}{min-error-interval} : 300
config{mylogin.dyndns.org}{min-interval} : 30
config{mylogin.dyndns.org}{mtime} : 0
config{mylogin.dyndns.org}{mx}   :
config{mylogin.dyndns.org}{password} : mypass
config{mylogin.dyndns.org}{protocol} : dyndns2
config{mylogin.dyndns.org}{server} : members.dyndns.org
config{mylogin.dyndns.org}{static} : 0
config{mylogin.dyndns.org}{status} :
config{mylogin.dyndns.org}{warned-min-error-interval} : 0
config{mylogin.dyndns.org}{warned-min-interval} : 0
config{mylogin.dyndns.org}{wildcard} : 1
config{mylogin.dyndns.org}{wtime} : 30
=== cache ====
DEBUG:    proxy  =
DEBUG:    url    = checkip.dyndns.com/
DEBUG:    server = checkip.dyndns.com
CONNECT:  checkip.dyndns.com
CONNECTED:  using HTTP
SENDING:  GET / HTTP/1.0
SENDING:   Host: checkip.dyndns.com
SENDING:   User-Agent: ddclient/3.7.3
SENDING:   Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Content-Type: text/html
RECEIVE:  Server: DynDNS-CheckIP/1.0
RECEIVE:  Connection: close
RECEIVE:  Cache-Control: no-cache
RECEIVE:  Pragma: no-cache
RECEIVE:  Content-Length: 106
RECEIVE:
RECEIVE:  <html><head><title>Current IP Check</title></head><body>Current IP Add                                                                                                                     ress: 94.109.218.203</body></html>
DEBUG:    get_ip: using web, checkip.dyndns.com/ reports 94.109.218.203
INFO:     forcing updating mylogin.dyndns.org because no cached entry exists                                                                                                                     .
DEBUG:
DEBUG:     nic_dyndns2_update -------------------
INFO:     setting IP address to 94.109.218.203 for mylogin.dyndns.org
UPDATE:   updating mylogin.dyndns.org
DEBUG:    proxy  =
DEBUG:    url    = http://members.dyndns.org/nic/update?system=dyndns&hostname=m                                                                                                                    ylogin.dyndns.org&myip=94.109.218.203&wildcard=ON
DEBUG:    server = members.dyndns.org
CONNECT:  members.dyndns.org
CONNECTED:  using HTTP
SENDING:  GET /nic/update?system=dyndns&hostname=mylogin.dyndns.org&myip=94.                                                                                                                     109.218.203&wildcard=ON HTTP/1.0
SENDING:   Host: members.dyndns.org
SENDING:   Authorization: Basic Ym91ZGNhbGxlbnM6Ym91ZDExMTY=
SENDING:   User-Agent: ddclient/3.7.3
SENDING:   Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Date: Fri, 10 Sep 2010 08:00:09 GMT
RECEIVE:  Server: Apache
RECEIVE:  Content-Type: text/plain
RECEIVE:  Connection: close
RECEIVE:
RECEIVE:  good 94.109.218.203
SUCCESS:  updating mylogin.dyndns.org: good: IP address set to 94.109.218.20         


So your script is working just fine. Then I changed the IP adress in DynDNS and rebooted my WDTV-live so it should automatically update. But it didn't do that. If I killed ddclient and restarted it, it did it without a problem. Is it perhaps possible to set a delay or something for updating the ip adress, because it doesn't do it automatically. Another thing I noticed while rebooting is that it doesn't create a ddclient.cache, which it does after running your cmd's. Is this perherps something to do with time, because after brad changes the NTP, I can't update my time anymore?

Thanks

BoBo
boudcallens
DLX'er
 
Posts: 115
Joined: Sun Apr 18, 2010 7:14 am

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Fri Sep 10, 2010 2:20 pm

Thanks for the feedback on this - since I've only been able to test this on my own WD TV it's useful to hear about issues that others are encountering.

What do you mean when you say "Then I changed the IP adress in DynDNS". Do you mean you logged into the DynDNS web interface and entered the IP address for your WD TV? If so, what was the address you entered, and where did you get it from? You shouldn't actually need to do that at all with ddclient installed - they both essentially do the same thing (that is, inform DynDNS of your current IP address).

I'm not quite sure what you mean about adding a delay to ddclient - when you reboot the WD TV it starts up in Daemon mode, meaning that it keeps running in the background and sends your current IP address to DynDNS every 600 seconds. So even if it is possible to delay the launch of ddclient, it seems unnecessary; if for some reason it fails to update your IP address the first time, then 600 seconds later it certainly should.

As for the issue regarding ddclient.cache, I wasn't aware of that. To be honest I'm not sure what the cache is used for. I'll look into it though. Good catch on that one.

Maybe let's try to turn on debugging in the init.d script, so that we can see what is happening the first time it runs after your WD TV reboots. Open up the file /apps/ddclient/etc/init.d/S42ddclient and do the following:

1) Comment out line 15, "/apps/ddclient/bin/ddclient"
2) Right below it, add a new line:
/apps/ddclient/bin/ddclient -debug -verbose -noquiet >> /apps/ddclient/ddclient.log
3) Save the file.
4) From the command line, do "touch /apps/ddclient/ddclient.log"
5) Then do "chmod 777 /apps/ddclient/ddclient.log"

Now reboot your WD TV. ddclient.log should fill up with the output of ddclient. Take a look at that and see if you get anything different than when you ran it manually. If so, let me know.
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Re: ddclient 0.1 - Automatic updater for Dynamic DNS   

Postby chameleon_skin » Fri Sep 10, 2010 2:59 pm

Update: just tried it myself and I see what you mean about the cache not being created unless you run the program manually. I've changed that now so that it writes the cache to the ddclient directory instead of /tmp, just in case there are any problems with that.

However, I also found something interesting in the logs when I turned on verbose mode at boot time:

DEBUG: url = checkip.dyndns.com/
DEBUG: server = checkip.dyndns.com
CONNECT: checkip.dyndns.com
WARNING: cannot connect to checkip.dyndns.com:80 socket: IO::Socket::INET: Bad hostname 'checkip.dyndns.com'
DEBUG: get_ip: using web, checkip.dyndns.com/ reports <undefined>
WARNING: unable to determine IP address

When I tried to ping checkip.dyndns.com from the WD TV, at first it couldn't find the host; then, after about a minute or two, it started to find the server. I'm still unable to ping that domain from my dev machine. I also tried pinging it from here:

http://just-ping.com/i

Which pings it from multiple locations around the world. It looks like about 2/3 of the requests failed. So I'm wondering if this is a problem on dyndns's end.

I'll try this later today and see if the problem resolves; if not, I'll move on to trying the next thing (maybe see if there is an alternate address I can use instead of checkip).
User avatar
chameleon_skin
Developer
 
Posts: 148
Joined: Fri Aug 20, 2010 10:21 am
Location: Bay Area, California

Next

Return to WDLXTV-G2 & WDLXTV-Live/Plus app.bins

Who is online

Users browsing this forum: No registered users and 1 guest