Re: Using Socket to read wireless LAN router info page [message #52217 is a reply to message #52071] |
Thu, 11 January 2007 08:20  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
Andrew,
It will be port 80 if your browser can see it unless you're giving an
explicit port number in the URL in your browser.
Something like this will just about work but is a bit sloppy:
socket,lun,'198.168.1.1',80,/get_lun
printf,lun,'GET /'
a=''
while not eof(lun) do begin
readf,lun,a
print,a
end
However, most standard routers use 192.168.1.1 rather than 198.168.1.1,
maybe worth checking. This could be your problem.
Note the key line "printf,lun,'GET /'" is what selects the webpage,
please see RFC2616 for really boring details:
http://www.w3.org/Protocols/rfc2616/rfc2616.html
A more properly formed command might be something like:
GET http://198.168.1.1/directory/file.html HTTP/1.0
but most things will tell you what you want to know via simply "GET /"
or "GET /page.html". HTTP/1.1 seems to be more complicated and I've
never really bothered with it.
Thanks,
Allan
andrew.cool@dsto.defence.gov.au wrote:
> Hi Folks,
>
> Happy New Year!! ;-)
>
>
> Santa was good to me and put in wireless broadband link at home, which
> beats
> the old 31kb dialup line by the proverbial country mile.
>
> But I'm only getting 40% of the 2Mb bandwidth plan that I signed up
> for, so I'm trying to gather the Signal, Noise and SNR values from the
> router every minute, and plot some graphs to wave under the noses of
> the Techs at my ISP. It would just be much nicer to do the reading and
> plotting in IDL.)
>
> I'm using a Linksysy Wireless-G 2.4GHz Broadband router that provides
> info on
> signal strength and noise on an IP address of 198.168.1.1
>
> Now my Firefox browser can download & display that page of XHTML info,
> as can a program that I wrote in Basic that uses Windows API calls to
> download a URL page direct to a file.
>
>
> But, I can't get IDL's Socket command to access that IP :-(
>
> Perhaps it just can't??
>
> I've tried a loop like:-
>
> for port = 1,8080 do begin
> socket,lun,'198.168.1.1',port,/get
> end
>
> but just can't make contact.
>
> Is there some special syntax or port number that should be used to
> contact such a beastie?
>
> Many Thanks,
>
> Andrew Cool
> Adelaide, Australia
>
>
> PS : To anyone who knows about such things, the Signal strength is
> consistently about 20-22 dB
> above the Noise. Is that good/bad/indifferent for 2.4GHz
> wireless broadband?
>
|
|
|