Getting the DSL linespeed with both current and attainable speed from the Fritz!Box 7360/7590 / 2020-11-28

2020-11-28 Getting the DSL linespeed with both current and attainable speed from the Fritz!Box 7360/7590
I noticed I documented my original script to fetch the upstream and downstream DSL speed from the Fritz!Box 7360 but never documented the additional steps I took later to add the attainable upstream and downstream speeds to the current upstream and downstream speeds.

After switching to the Fritz!Box 7590 I missed my VDSL statistics so I dug up the scripts I had for the 7360 and tested whether they still work. And yes they do, so no changes there. The complete script:
#!/usr/bin/perl -w

use strict;

my ($fritzuser,$fritzpass);

$fritzuser="root";
$fritzpass="VerySecretPassword";

system("wget --user=$fritzuser --password=$fritzpass --post-file=wanifcfgrequest.xml --header=\"Content-Type: text/xml\" --header=\"SOAPAction: \\\"urn:dslforum-org:service:WANDSLInterfaceConfig:1#GetInfo\\\"\" --no-check-certificate http://fritz.koos.koffie.dot:49000/upnp/control/wandslifconfig1 -O wanifcfganswer.xml -o getfritz.log");

open(STATUSFILE,"){
        if (/(\d+)<\/NewUpstreamMaxRate>/){
                $upstream = $1;
        }
        if (/(\d+)<\/NewDownstreamMaxRate>/){
                $downstream = $1;
        }
        if (/(\d+)<\/NewUpstreamCurrRate>/){
                $upstreamcur = $1;
        }
        if (/(\d+)<\/NewDownstreamCurrRate>/){
                $downstreamcur = $1;
        }
}

if (defined $upstream and defined $downstream){
        my $line=sprintf("N:%d:%d:%d:%d",$downstream*1000,$upstream*1000,$downstreamcur*1000,$upstreamcur*1000);
        print $line."\n";
}
This does need the wanifcfgrequest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope
   xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
   s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <s:Body>
      <u:GetInfo xmlns:u="urn:dslforum-org:service:WANDSLInterfaceConfig1">
      </u:GetInfo>
   </s:Body>
</s:Envelope>
And I get a usable wanifcfganswer.xml:
<?xml version="1.0"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetInfoResponse xmlns:u="urn:dslforum-org:service:WANDSLInterfaceConfig:1">
<NewEnable>1</NewEnable>
<NewStatus>Initializing</NewStatus>
<NewDataPath>Fast</NewDataPath>
<NewUpstreamCurrRate>33032</NewUpstreamCurrRate>
<NewDownstreamCurrRate>111049</NewDownstreamCurrRate>
<NewUpstreamMaxRate>35725</NewUpstreamMaxRate>
<NewDownstreamMaxRate>117129</NewDownstreamMaxRate>
<NewUpstreamNoiseMargin>50</NewUpstreamNoiseMargin>
<NewDownstreamNoiseMargin>60</NewDownstreamNoiseMargin>
<NewUpstreamAttenuation>80</NewUpstreamAttenuation>
<NewDownstreamAttenuation>110</NewDownstreamAttenuation>
<NewATURVendor>41564d00</NewATURVendor>
<NewATURCountry>0400</NewATURCountry>
<NewUpstreamPower>498</NewUpstreamPower>
<NewDownstreamPower>513</NewDownstreamPower>
</u:GetInfoResponse>
</s:Body>
</s:Envelope>
This works without any change both on the Fritz!Box 7360 and the Fritz!Box 7590.

Tags: , ,

IPv6 check

Running test...
, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred. PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers

RSS
Meningen zijn die van mezelf, wat ik schrijf is beschermd door auteursrecht. Sommige publicaties bevatten een expliciete vermelding dat ze ongevraagd gedeeld mogen worden.
My opinions are my own, what I write is protected by copyrights. Some publications contain an explicit license statement which allows sharing without asking permission.
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated by $Id: newsitem.cgi,v 1.58 2022/12/12 15:34:31 koos Exp $ in 0.010174 seconds.