Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

DYNDNS Updater on MEGA Webserver

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP
View previous topic :: View next topic  
Author Message
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Thu Nov 20, 2014 1:40 am    Post subject: DYNDNS Updater on MEGA Webserver Reply with quote

I've followed with interest the postings by SIX1, PaulVK and MMarlette with their work on creating a WebServer.

I have a simple version up and working OK.

DynDNS.com is used to point to the WebServer IP address. On the webserver network, there is a computer running at all times with DynDNS Updater to change the dynamically-assigned IP address from the Internet Service Provider (ISP).

Has anyone been able to create the DynDNS Updater function and embedded it in the Mega/Xmega webserver?

If so, can you please describe the process?

(I will create my own code once I understand the process.)

Thanks.
Ennio
Back to top
View user's profile
mmarlette

Bascom Member



Joined: 30 Nov 2007
Posts: 311
Location: Delano, MN

usa.gif
PostPosted: Thu Nov 20, 2014 3:56 pm    Post subject: Reply with quote

I have NO-IP updater working under BASCOM.

The update process is usually documented on their site, pretty simple once the process is defined, no guess work.

Regards,

Mark
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Fri Nov 21, 2014 2:41 pm    Post subject: Reply with quote

Thanks Mark for your help.

Was able to find this method from the DynDNS website:
Quote:
$ nsupdate -d
> server update.dyndns.com
> zone $ZONE
> key $KEY_NAME $KEY_HMAC
> update add $HOST.$ZONE 60 A 10.0.0.1
> send
> quit


I have set up the TSIG variable names for my webserver (so the values for $VARS are all known).

What I don't understand is how to invoke these commands from within BASCOM in the WebServer code.

Any hints?
Back to top
View user's profile
mmarlette

Bascom Member



Joined: 30 Nov 2007
Posts: 311
Location: Delano, MN

usa.gif
PostPosted: Fri Nov 21, 2014 4:34 pm    Post subject: Reply with quote

I was a user of NO-IP that is why I went to their service when I wrote the BASCOM updater service for my apps.

I am sure there is such a page for DYNDNS but don't know ATM. Lots of projects to do today and have to clean office and workbench areas... Sad

I hope I can post a link here in reference to your issue. Mark I apologize in advance if it is not acceptable. Rather than posting the whole page content thought the link would be better.

http://www.noip.com/integrate/request

From your information you posted, you are a level or two to high in the commands as I see it. You need to talk GET/POST server commands/reponses directly to/from the dynamic name server.

Here is the comment section of my app. Sorry don't want to post the code due to this is just a small part of several huge projects. There is also link info in the comments. I did use FireFox's plugin and some visual basic to get it all working properly first. I was going to do a DYNDNS update client as well but got stuck in some other routines and zapped my free time.

hopefully this helps...this is fun stuff!!! Now off to clean.... Sad

Code:

Sub Server_WhatsMyIPpublic()
  '
  ' This routine will connect to the IP as defined in the strMyIPpublicserver
  ' (checkip.dyndns.org) from the server's configuration file and return the current
  ' Public address of the current connection.
  '
  ' The MyIPpublic refresh rate is determined by lngMyIPpublicRefreshInterval as defined
  ' in the Server's configuration file. This request must be spaced
  ' at least 10 minutes apart to reduce server load.
  '
  ' The server's response is limited to a string with a length of 16. Error checking
  ' of this response is done to ensure that a string boundary overwrite doesn't occur.
  ' Once the string is then obtained, the validity of the format of the IP returned is
  ' verified to make sure it contains three .'s. If the format is not valid, the response is
  ' blank or nothing and is returned to the caller and the error code of 254 is set.
  '
  ' The timer ISR in Main.bas sets the flag bytMyIPpublicUpdate to trigger this event.
  ' In the event that the update from the server did not occur, the routine will reschedule
  ' the event based upon the value wrdMyIPpublicRetryInterval read from the server's
  ' configuration file. Only the events with an error code will be logged. Valid server responses
  ' are not written to the logfile.
  '
  ' The following vars are read by the Server_CFGread routine :
  ' strMyIPpublicserver , lngMyIPpublicRefreshInterval , wrdMyIPpublicRetryInterval, booMyIPpublicenable
  '
  ' Error codes logged to SD as follows:
  ' --------------------------------------------------------
  ' 255 = No connection obtained to server.
  ' 254 = Server's response failed validation
  ' 253 = No server response or timeout
  '
  ' Reference Links:
  '===========================
  'MyIPpublic protocol is from : http://dyn.com/support/developers/checkip-tool/
  ' http://www.whatsmyip.us/imgcode.php  which will give a reference to
  ' http://www.whatsmyip.us/showipsimple.php  when sent server will respond :
  '     document.write("66.87.115.168");
  '
  ' Use FireBug to determine GET header for above.
  '
  'HTTP Header information obtained from : http://net.tutsplus.com/tutorials/other/http-headers-for-dummies/
  'and http://www.jmarshall.com/easy/http/
  '
  ' Send a request to the server :
  '  GET / HTTP/1.1
  '  Host: checkip.dyndns.org
  '  User-Agent: ATmega 2560 Ardunio/EthernetShield via BASCOM/v1.0
  '                       optional header request
  '  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  '  Accept-Language: en-US,en;q=0.5
  '  Accept-Encoding: none
  '  Connection: keep-alive
  '  Cache-Control: max-age=0
  '  terminate request header with empty line
  '
  ' Server will respond :
  '  HTTP/1.1 200 OK
  '  Content-Length: 105
  '  Content-Type: text/html
  '  Server: DynDNS-CheckIP/1.0
  '  Cache-Control: no-cache
  '  Pragma: no-cache
  '  Connection: keep-alive
  '
  '<html><head><title>Current IP Check</title></head><body>Current IP Address: 74.37.51.195</body></html><CRLF>
  '
  'Install FireBug in to FireFox. This allows you to see the header requests(NET TAB), etc......
  ' Mark L. Marlette  12/27/2013
 
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Fri Nov 21, 2014 4:42 pm    Post subject: Reply with quote

Thanks Mark, the No-IP method does seem much simpler.

I'll try to set my Dynamic DNS on No-IP and test it.

And, thanks for taking the time to help.
Ennio
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum