Getting the DSL linespeed from the Fritz!Box 7360 / 2014-11-26

2014-11-26 Getting the DSL linespeed from the Fritz!Box 7360
The fact I couldn't get the DSL linespeed from the Fritz!Box 7360 annoyed me a lot, especially since there is a new telephone wiring cabinet which should raise VDSL2 speeds. I went through a number of websites about getting data out of the Fritz!Box with upnp, and finally I made it work and I get the results I want:
<NewLayer1UpstreamMaxBitRate>1480000</NewLayer1UpstreamMaxBitRate>
<NewLayer1DownstreamMaxBitRate>23144000</NewLayer1DownstreamMaxBitRate>
The hint that worked for me was at MRTG en Fritz!Box 7360 (firmware 124.06.05) - tweakers (in Dutch) where it mentiones the changeover to TR-064 protocol which should be reachable over the http://192.168.178.1/tr064/tr64desc.xml url which will ask for authentication with the root username and the Fritz!Box password. More about the Fritz!Box TR-064 implementation at Schnittstellen für Entwickler | AVM Deutschland (in German) which has more documentation at AVM TR-064 – First Steps (pdf, English). This made me end up at doing a SOAP request (post) to http://192.168.178.1/tr064/upnp/control/wancommonifconfig1 which failed. All SOAP requests fail with an HTTP error code 500, but there is a separate SOAP error set in the HTTP status 500 body. I used tcpdump to look at the SOAP error body and found:
<errorCode>504</errorCode> <errorDescription>SSL needed</errorDescription></UPnPError>
The SSL port is (according to the TR-064 first steps document above) 49443 and the URL is over SSL: https://192.168.179.1:49443/upnp/control/wancommonifconfig1 and this works, giving the answers I want.

The full script that fetches data:
#!/bin/sh

FRITZUSER=root
FRITZPASS=VerySecretPassword

wget --user=$FRITZUSER --password=$FRITZPASS --post-file=linkstatusrequest.xml \
--header="Content-Type: text/xml" \
--header="SOAPAction: \"urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetCommonLinkProperties\"" --no-check-certificate \
https://192.168.179.1:49443/upnp/control/wancommonifconfig1 -O linkstatusanswer.xml
This does need the linkstatusrequest.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:GetCommonLinkProperties xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
      </u:GetCommonLinkProperties>
   </s:Body>
</s:Envelope>
And gives me the right answer:
<?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:GetCommonLinkPropertiesResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
<NewWANAccessType>DSL</NewWANAccessType>
<NewLayer1UpstreamMaxBitRate>1504000</NewLayer1UpstreamMaxBitRate>
<NewLayer1DownstreamMaxBitRate>23129000</NewLayer1DownstreamMaxBitRate>
<NewPhysicalLinkStatus>Down</NewPhysicalLinkStatus>
</u:GetCommonLinkPropertiesResponse>
</s:Body>
</s:Envelope>
Which I can import into my rrdtool scripts and make into pretty graphs. VDSL downstream graph

Which directly shows me something interesting: the DSL linespeed is varying constantly.

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.010202 seconds.