473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automating date/time input for modem/router

My D-Link DSL-302G modem/router has a real-time clock whose settings
are volatile. To avoid hand keying the date/time via the modem's JS
interface, I wonder if there is a way to copy the JS code to the hard
drive and modify it to automatically retrieve the PC's date/time. I
could then add the hacked JS page to my browser's bookmarks. I've
already successfully modified and adapted other modem menus, but I
don't know how to go about this particular task (I'm not a
programmer).

The router's IP address is 10.1.1.1. AIUI, all relative addresses in
the PopOutPage would need to be changed to reflect this..

The date/time input code is accessed via this URL:
http://10.1.1.1/PopOutPage?id=3&ex_param1=

The source code for the above JS form is here:
http://www.users.on.net/~fzabkar/DSL...PopOutPage.htm

The above form calls these .gsv and .css files:
http://10.1.1.1/hag/js/global.gsv
http://10.1.1.1/hag/css/style.css

The respective source code is here:
http://www.users.on.net/~fzabkar/DSL-302G/global.gsv
http://www.users.on.net/~fzabkar/DSL-302G/style.css

Thanks in advance for any pointers.

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 2 '06 #1
17 3368
On Thu, 02 Feb 2006 14:55:09 +1100, Franc Zabkar
<fz*****@iinter node.on.net> put finger to keyboard and composed:
My D-Link DSL-302G modem/router has a real-time clock whose settings
are volatile. To avoid hand keying the date/time via the modem's JS
interface, I wonder if there is a way to copy the JS code to the hard
drive and modify it to automatically retrieve the PC's date/time. I
could then add the hacked JS page to my browser's bookmarks. I've
already successfully modified and adapted other modem menus, but I
don't know how to go about this particular task (I'm not a
programmer).


OK, I've narrowed down my requirements to the following:

I need a small JS routine that reads the PC date/time and builds a URL
in this format:

http://10.1.1.1/Action?sysm_date_che...dSubmit=Submit

The date in the above example is Sep 3, 2005 and the time is 22:2:22.
Daylight saving is on. The time zone is "EAST +1000 Eastern Australian
Standard".

Thanks in advance for any assistance.

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 2 '06 #2
Franc Zabkar wrote:
I need a small JS routine that reads the PC date/time and builds a URL
in this format:

http://10.1.1.1/Action?sysm_date_che...dSubmit=Submit The date in the above example is Sep 3, 2005 and the time is 22:2:22.
Daylight saving is on. The time zone is "EAST +1000 Eastern Australian
Standard".
One possibility:

var
sBaseURI = "http://10.1.1.1/Action?sysm_dat e_check=",
d = new Date(),
aMonths = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
],
sFullURI = [
baseURI,
"&sys_month =", aMonths[d.getMonth()],
"&sys_date= ", d.getDate(),
"&sys_year= ", d.getFullYear() ,
"&sysm_time_che ck=&sys_hour=", d.getHours(),
"&sys_minut e=", d.getMinutes(),
"&sys_secon d=", d.getSeconds(),
"&timezone_comb o=", whatever_that_i s,
"&dst=", left_as_an_exer cise_to_the_rea der,
"&host_name =DSL-302G&dom_name=H omeLAN&id=1&cmd Submit=Submit"
].join("");
Thanks in advance for any assistance.


RTFM next time.
PointedEars
Feb 2 '06 #3
JRS: In article <qe************ *************** *****@4ax.com>, dated
Fri, 3 Feb 2006 07:04:09 remote, seen in news:comp.lang. javascript,
Franc Zabkar <fz*****@iinter node.on.net> posted :

OK, I've narrowed down my requirements to the following:

I need a small JS routine that reads the PC date/time and builds a URL
in this format:

http://10.1.1.1/Action?sysm_date_che...ys_year=2005&s
ysm_time_check =&sys_hour=22&s ys_minute=2&sys _second=22&time zone_combo=42&d st=1&h
ost_name=DSL-302G&dom_name=H omeLAN&id=1&cmd Submit=Submit

The date in the above example is Sep 3, 2005 and the time is 22:2:22.
Daylight saving is on. The time zone is "EAST +1000 Eastern Australian
Standard".

Thanks in advance for any assistance.


Did you consider reading the newsgroup FAQ before posting? See sig
below.

EAST is in fact not a time zone, AFAICS; a time zone is the set of all
places which have the same winter offset from GMT/UTC/UT. AIUI, the
Eastern third of Australia is in the GMT+10 zone, and remains in that
zone even in Summer when parts of it change their local time to GMT+11.

You appear to be in a part which has Summer Time.

You may need to send the Standard Time even in Summer, or you may need
to send the civil time. Timezone_combo is not to me an obvious concept.

You may want to consider the possibility of moving your system or giving
your code to a colleague elsewhere, in which case be sure not to hard-
code the local Time Rules.

Your PC is liable to indicate Winter Time from 2006-03-26, though AIUI
the change will be a week later.

A sensibly-designed router would want to be sent the time in ISO 8601
UTC format, i.e. as 2005-09-03 22:02:22Z ; presumably yours is imported
from a chronologically-inept location.

There's no difficulty in generating such a string from the information
in the Date Object D resulting from D = new Date() but your example
is not adequate to indicate the full requirement.

For example, does DST=1 mean that it *is* summer, or that the location
changes offset for summer. If the latter, how does it know when to
change offset - maybe DST rules are built in ... !!

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Feb 3 '06 #4
On Fri, 3 Feb 2006 13:20:32 +0000, Dr John Stockton
<jr*@merlyn.dem on.co.uk> put finger to keyboard and composed:
JRS: In article <qe************ *************** *****@4ax.com>, dated
Fri, 3 Feb 2006 07:04:09 remote, seen in news:comp.lang. javascript,
Franc Zabkar <fz*****@iinter node.on.net> posted :

OK, I've narrowed down my requirements to the following:

I need a small JS routine that reads the PC date/time and builds a URL
in this format:

http://10.1.1.1/Action?sysm_date_che...ys_year=2005&s
ysm_time_chec k=&sys_hour=22& sys_minute=2&sy s_second=22&tim ezone_combo=42& dst=1&h
ost_name=DS L-302G&dom_name=H omeLAN&id=1&cmd Submit=Submit

The date in the above example is Sep 3, 2005 and the time is 22:2:22.
Daylight saving is on. The time zone is "EAST +1000 Eastern Australian
Standard".

Thanks in advance for any assistance.
Did you consider reading the newsgroup FAQ before posting? See sig
below.


Sorry, I did not. The reason is that I have absolutely *no*
prerequisite knowledge of HTML, JS, or C, and I don't foresee any
pressing need for same. In any case, I have two books on JS, but they
both assume a working knowledge of HTML.

Anyway I thought the answer would be simple enough, and indeed it was.
While it isn't pretty, here is my solution (using input from this NG):

http://www.users.on.net/~fzabkar/DSL-302G/TimeSync.htm
EAST is in fact not a time zone, AFAICS; a time zone is the set of all
places which have the same winter offset from GMT/UTC/UT. AIUI, the
Eastern third of Australia is in the GMT+10 zone, and remains in that
zone even in Summer when parts of it change their local time to GMT+11.

You appear to be in a part which has Summer Time.

You may need to send the Standard Time even in Summer, or you may need
to send the civil time. Timezone_combo is not to me an obvious concept.
I have no control over this because it is built into the modem's
firmware. In any case I don't consider timezone_combo as a true
variable because this setting can be saved in the modem's nonvolatile
memory. The user can preset his own choice in the abovementioned JS
script. Indeed, it would be impossible to programmaticall y select the
preferred timezone_combo given that some system time zones can map to
several timezone_combo options, eg:

20 CET +0100 Central European
21 FWT +0100 French Winter
22 MET +0100 Middle European
23 MEWT +0100 Middle European Winter
24 SWT +0100 Swedish Winter
You may want to consider the possibility of moving your system or giving
your code to a colleague elsewhere, in which case be sure not to hard-
code the local Time Rules.
This code is purely for my own convenience. The *only* reason that I
wish to synchronise the modem's date and time is so that I can make
sense of the modem's event log. I really don't care too much about the
time zone, or whether daylight is being saved. Therefore I am quite
happy to hard-code the TZ and DST parameters. In any case these
parameters can be retained by the modem's nonvolatile memory and need
not be updated.

Perhaps this log of PPP events will illustrate the problem:

http://www.users.on.net/~fzabkar/DSL-302G/Alarms.htm

Notice that when the modem first powers up and connects to the DSLAM,
the date and time are those which are retrieved from the modem's
nonvolatile memory:

=============== =============== =============== =============== ==========
Sat Sep 03 20:09:11 2005 : STATUS ALARM : ATM Interface Up : Interface
- atm-0
Sat Sep 03 20:09:11 2005 : STATUS ALARM : DSL Interface Up
Sat Sep 03 20:09:01 2005 : STATUS ALARM : System Up
=============== =============== =============== =============== ==========

I believe that "Sat Sep 03" was the date when I last saved the modem's
configuration settings, ie PPP, Bridging, LAN, WAN, Admin.

After synchronising the date/time, the log looks like this:

=============== =============== =============== =============== ==========
Sat Feb 04 19:02:42 2006 : STATUS ALARM : PPP Interface Up : Interface
- ppp-0
Sat Feb 04 19:02:42 2006 : STATUS ALARM: PPP Event: NCP Got secondary
DNS address: 192.231.203.3
Sat Feb 04 19:02:42 2006 : STATUS ALARM: PPP Event: NCP Got primary
DNS address: 192.231.203.132
=============== =============== =============== =============== ==========
Your PC is liable to indicate Winter Time from 2006-03-26, though AIUI
the change will be a week later.

A sensibly-designed router would want to be sent the time in ISO 8601
UTC format, i.e. as 2005-09-03 22:02:22Z ; presumably yours is imported
from a chronologically-inept location.

There's no difficulty in generating such a string from the information
in the Date Object D resulting from D = new Date() but your example
is not adequate to indicate the full requirement.

For example, does DST=1 mean that it *is* summer, or that the location
changes offset for summer. If the latter, how does it know when to
change offset - maybe DST rules are built in ... !!


Again, this is a function of the modem's firmware. It is of no real
interest to me as I don't work past midnight and I switch off the
modem when I'm done. I may experiment with this parameter, though,
just out of curiosity. When I find out how it works I'll add an
appropriate comment to the TimeSync routine.

Thanks for your input.

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 5 '06 #5
On Thu, 02 Feb 2006 21:24:41 +0100, Thomas 'PointedEars' Lahn
<Po*********@we b.de> put finger to keyboard and composed:
Franc Zabkar wrote:
I need a small JS routine that reads the PC date/time and builds a URL
in this format:

http://10.1.1.1/Action?sysm_date_che...dSubmit=Submit
The date in the above example is Sep 3, 2005 and the time is 22:2:22.
Daylight saving is on. The time zone is "EAST +1000 Eastern Australian
Standard".


One possibility:

var
sBaseURI = "http://10.1.1.1/Action?sysm_dat e_check=",
d = new Date(),
aMonths = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
],
sFullURI = [
baseURI,
"&sys_month =", aMonths[d.getMonth()],
"&sys_date= ", d.getDate(),
"&sys_year= ", d.getFullYear() ,
"&sysm_time_che ck=&sys_hour=", d.getHours(),
"&sys_minut e=", d.getMinutes(),
"&sys_secon d=", d.getSeconds(),
"&timezone_comb o=", whatever_that_i s,
"&dst=", left_as_an_exer cise_to_the_rea der,
"&host_name =DSL-302G&dom_name=H omeLAN&id=1&cmd Submit=Submit"
].join("");
Thanks in advance for any assistance.


RTFM next time.


Thanks very much for your help ... I think. As I confessed elsewhere,
I have absolutely no knowledge of HTML, JS, or C, so RTFM would be a
big ask. I'd liken it to asking someone at comp.lang.swahi li to
translate a couple of sentences of English and being told to consult a
dictionary.

Anyway, after a considerable struggle, I came up with this:

http://www.users.on.net/~fzabkar/DSL-302G/TimeSync.htm
PointedEars


- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 5 '06 #6
Franc Zabkar wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote: [Full quote]


Read the FAQ and the FAQ Notes before you post here again.
RTFM next time.


Thanks very much for your help ... I think. As I confessed elsewhere,
I have absolutely no knowledge of HTML, JS, or C, so RTFM would be a
big ask. I'd liken it to asking someone at comp.lang.swahi li to
translate a couple of sentences of English and being told to consult
a dictionary.


The logical course of action would be to attend Swahili classes or just
let it be. For the purpose of this newsgroup is not to compensate your
lack of basic knowledge _and_ your unwillingness to acquire it.
PointedEars
Feb 5 '06 #7
Franc Zabkar wrote:
[...] Anyway, after a considerable struggle, I came up with this:
Considerable struggle? Your code is essentially mine, without even
mentioning it!
http://www.users.on.net/~fzabkar/DSL-302G/TimeSync.htm


Hopefully you aware that you will probably set the wrong time half
of the year.
PointedEars
Feb 5 '06 #8
On Sun, 05 Feb 2006 17:48:44 +0100, Thomas 'PointedEars' Lahn
<Po*********@we b.de> put finger to keyboard and composed:
Franc Zabkar wrote:
[...] Anyway, after a considerable struggle, I came up with this:
Considerable struggle?


My difficulty was not so much in creating a variable, although I would
have done it in a much less elegant way (by using a long concatenation
statement). The main problem was in breaking down several pages of
completely unfamiliar code into a basic requirement, and then finding
a way to direct my browser to a variable URL. Neither of my JS texts
addressed the latter, most important need.
Your code is essentially mine, without even mentioning it!


I had considered acknowledging your var statement by way of a comment
within the body of the code, but wasn't sure whether this would be
deemed too trivial. No disrespect intended.
http://www.users.on.net/~fzabkar/DSL-302G/TimeSync.htm


Hopefully you aware that you will probably set the wrong time half
of the year.


Actually, the modem appears to ignore the DST setting. If I set the
date/time to just before the transition date/time, no time is lost or
gained when the clock passes through midnight. Perhaps it would be
safer to specify "&dst=0", though, just in case the modem firmware
hard codes some other transition date.

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 6 '06 #9
On Sun, 05 Feb 2006 16:17:03 +0100, Thomas 'PointedEars' Lahn
<Po*********@we b.de> put finger to keyboard and composed:
Franc Zabkar wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:

[Full quote]


Read the FAQ and the FAQ Notes before you post here again.
RTFM next time.


Thanks very much for your help ... I think. As I confessed elsewhere,
I have absolutely no knowledge of HTML, JS, or C, so RTFM would be a
big ask. I'd liken it to asking someone at comp.lang.swahi li to
translate a couple of sentences of English and being told to consult
a dictionary.


The logical course of action would be to attend Swahili classes or just
let it be. For the purpose of this newsgroup is not to compensate your
lack of basic knowledge _and_ your unwillingness to acquire it.


OK, your criticisms are acknowledged and accepted. I'm at page 70 of
chapter 6 of "Javascript by Example" and still reading ...

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
Feb 6 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1946
by: jmev7 | last post by:
I have heard of security issues with IIS while on a T1 line or on a cable modem, etc. I learned of a "break in" at a state office, and it was traced to an "open door" while using IIS. Due to that break in, research was done which resulted in the consensus that MSDE applications were also vulnerable. Any thoughts one this? Does anyone know if running if at home could cause an open door to exist through which others might "make themselves at...
6
4302
by: John J. Hughes II | last post by:
My code starts a TCP/IP socket listener and waits for incoming connections. This works fine on my system and my test system but I have a customer who say it does not work on their system. As far as I can tell the problem is they are using a DSL modem with a router internal to it. So basically my software is listening to IP address 10.0.0.3 but the external connection is trying to connect to xx.xx.xx.xx on the internet which in concept...
2
1320
by: DvsStyle | last post by:
Firstly i should mention that Im relativey New to VB, and programming in general - Only starting in the last 12 months or so for school, So plz dont take anything for granted and act like i know nothing :) Im making a program at the moment which should be able to create (or load) a database, then edit it from the users input - sort of like an order form type of thing. I Used excel for my database - against the advice of my teacher who...
6
3367
by: ConsoleElosnoc | last post by:
Hi everyone =), Okay, this is not my problem.. this is my friend's problem (He lives in NY and I live in Vancouver) so I couldn't be physically there to see what's wrong... By chance (or a miracle) I searched on google and ended up here =D! Here's the problem: My friend has a pretty decent computer/ High Speed Internet/ Cable Modem.. He used to be able to host CS(it's a game) Servers up until 2 nights ago when it suddenly crashed......
1
2043
by: romeorion | last post by:
Is it possible to connect with a Linksys cable modem through a zwire dsl modem/wireless router to a pc?
2
1828
by: chutney | last post by:
Dear all, please excuse the fact that this is not an explicit problem I have, but more of a general query. I have an Access database (2003) with a load of contact details in it. Including various fields for each contact, such as services they offer, where they are, main contact name etc. Some of these contact details will be out of date and I want to make sure that all the contact details are up-to-date. I am in the process of setting...
0
1285
by: totomalas | last post by:
I have developed a report in Access 2007 that runs on three queries, each promting an input from the user...this report is used for a meeting and it should be printed nine times...what I do now is open the report nine times, with each print i enter the same inputs for the first two queries and a different input for the third one...so this is becoming a hassle for me.. :( Query1 takes the meeting date Query2 takes the budget date Query3...
5
2915
by: totomalas | last post by:
I have developed a report in Access 2007 that runs on three queries, each promting an input from the user...this report is used for a meeting and it should be printed nine times...what I do now is open the report nine times, with each print i enter the same inputs for the first two queries and a different input for the third one...so this is becoming a hassle for me.. :( Query1 takes the meeting date Query2 takes the budget date Query3...
3
3576
by: apg018 | last post by:
Hi - I just bought an Asus laptop with wireless capabilities. I have a desktop that I've used for years that is hooked up to Cox cable for high speed internet through a Motorola SG5120 cable modem. The modem is ethernet / USB compatible, but it currently hooks to my desktop with a USB cable. I bought a Linksys wireless router last night and tried to install. The first problem was that I couldn't hook the USB cable from the desktop...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.