inflames2k / ps.fritzbox.api Goto Github PK
View Code? Open in Web Editor NEWAPI for accessing the TR-064 interface of AVM Fritz!Box devices.
License: MIT License
API for accessing the TR-064 interface of AVM Fritz!Box devices.
License: MIT License
Hi there!
Thanks for your great work, I noticed, that the GetSpecificHostEntryAsync method in HostsClient.cs is missing the SOAPRequestParameter to retrieve by MACAddress.
Replacing
public async Task<HostEntry> GetSpecificHostEntryAsync(string macAddress)
{
XDocument document = await this.InvokeAsync("GetSpecificHostEntry", null);
return (...)
}
with
public async Task<HostEntry> GetSpecificHostEntryAsync(string macAddress)
{
XDocument document = await this.InvokeAsync("GetSpecificHostEntry", new SOAP.SoapRequestParameter("NewMACAddress", macAddress));
return (...)
}
is fixing it! 👍
Hi,
when calling ForceTermination in WANPPPConnectionClient.cs I get an unhandled error with internal server error somewhere in the details. (As it is an async call there's no more info - though, while writing this I'm realizing I could change it to a synchron call... xD )
So as a simple workaround I put it in a try-catch block:
public void ForceTermination()
{
try
{
this.Invoke("ForceTermination", null);
}
catch (Exception)
{
;
}
}
I also removed the async here - I don't think it's necessary...?
Although there is an error, the connection gets terminated....
Any idea why this gives an internal server error?
Cheers, Stephan
I couldn't find the WANDSLInterfaceConfig service. Any special reason that it is missing, or do you simply not own a box with DSL?
I haven't tried this myself yet, but according to https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg is should be pretty easy - just add the xml snippet to the .csproj and VS will create an .snupkg, which you then can publish to nuget.org
Hi,
I have a FritzBox 7580
and want to connect to my FritzBox
in order to enumerate my WLAN devices.
I have created a user account with some access rights (such as read and modify settings)
and I also have TR-064 enabled as shown below:
But when I try to access either DeviceConfigClient
or DeviceInfoClient
I get an error message upon first calling a method, such as var uuid = await deviceConfigClient.GenerateUUIDAsync();
or var info = await deviceInfoClient.GetDeviceInfoAsync();
.
The error message reads:
Message:
System.Xml.XmlException : 'content-type' is an unexpected token. The expected token is '"' or '''. Line 4, position 18.
Stack Trace:
XmlTextReaderImpl.Throw(Exception e)
XmlTextReaderImpl.Throw(String res, String[] args)
XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
XmlTextReaderImpl.ParseAttributes()
XmlTextReaderImpl.ParseElement()
XmlTextReaderImpl.ParseElementContent()
XContainer.ReadContentFrom(XmlReader r)
XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
XDocument.Load(XmlReader reader, LoadOptions options)
XDocument.Load(TextReader textReader, LoadOptions options)
XDocument.Load(TextReader textReader)
SoapClient.ExecuteAsync(String xmlSOAP, Uri url, SoapRequestParameters parameters)
SoapClient.InvokeAsync(Uri uri, SoapRequestParameters parameters)
FritzTR64Client.InvokeAsync(String action, SoapRequestParameter[] parameter)
DeviceConfigClient.GenerateUUIDAsync()
am I missing something or is my FritzBox
not supported? I am not sure what to do with this error message.
What can I do in order to access my FritzBox
with PS.FritzBox.API
?
I have the following code:
DeviceFactory factory = new DeviceFactory();
FritzDevice device = await factory.CreateDeviceAsync(System.Net.IPAddress.Parse("192.168.178.1"));
ConnectionSettings settings = new ConnectionSettings();
settings.BaseUrl = "192.168.178.1:49000";
settings.UserName = user;
settings.Password = password;
HostsClient client = await device.GetServiceClient<HostsClient>(settings);
var host = await client.GetSpecificHostEntryAsync(mac).ConfigureAwait(false);
The last line throws the following exception:
PS.FritzBox.API.SOAP.SoapFaultException: "s:Client; UPnPError
{urn:dslforum-org:control-1-0}errorCode: 402
{urn:dslforum-org:control-1-0}errorDescription: Invalid Args
"
Is there an issue or am I doing something wrong?
Hallo, wenn man die API gegen eine Box laufen lässt, die schon lange in Betrieb ist, werfen die
GetTotal<Packets|Bytes><Send|Received>Async() Methoden in WANCommonInterfaceConfigClient eine Ausnahme weil das Ergebnis nicht in einen UInt32 passt. Schlage vor, dass du auf UInt64 änderst.
Gruß, Ralf.
Hi,
thanks for the Work . I use this Lib to reboot my Fritz!box each night. After the Update to OS 7.10 on my 7590, I can´t reboot and got the Error "An error occurred while sending the request."
Maybe you have Time an can look on it?
Thanks.
HI,
danke für die Arbeit, die Du Dir gemacht hast. Ich nutze die Bilbliothek um meine 7590 jeden abend neu zu starten. Nach dem Update auf die neue OS Version 7.10 bekomme ich allerdings den Fehler: "An error occurred while sending the request."
Wäre schön, wenn Du Dir die Zeit nehmen könntest da mal nach zusehen.
Danke Dir.
Rein für die Zukunft, ist deutsch oder englisch besser?
Gruß
Frank
Great library in all terms :)
In case i am just blind, is there any way how to access the VOIP api , with GetNumberOfClients and GetClient2 GetClient3 , etc.?
I found everything i need, except VOIP :)
/upnp/control/x_myfritz
/upnp/control/x_voip
The creation of the Fritzbox device differs between CreateDeviceAsync (IPAddress) and LocateDevicesAsync ().
Is it wanted like that ??
Ich bekomme beim Start des Konsolenprojekts mehrere Exceptions und dann stürzt das Programm ab.
Es könnte sich hier um das gleiche Problem handeln, wie in #11 (comment) beschrieben.
Die erste Exception ist:
Exception thrown: 'System.Net.Sockets.SocketException' in System.dll
An invalid argument was supplied
Mit dem Callstack:
System.dll!System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, int optionValue, bool silent) Line 6491 C#
System.dll!System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, int optionValue) Line 2307 C#
PS.FritzBox.API.dll!PS.FritzBox.API.DeviceLocator.BeginSendReceiveAsync(System.Net.IPAddress broadcastAddress = {System.Net.IPAddress}, int index = 0x0000000c, System.Action<PS.FritzBox.API.FritzDevice> callback = {Method = {System.Reflection.RuntimeMethodInfo}}) Line 85 C#
PS.FritzBox.API.dll!PS.FritzBox.API.DeviceLocator.DiscoverBroadcast(System.Action<PS.FritzBox.API.FritzDevice> callback = {Method = {System.Reflection.RuntimeMethodInfo}}) Line 70 C#
PS.FritzBox.API.dll!PS.FritzBox.API.DeviceLocator.FindDevicesAsync() Line 44 C#
PS.FritzBox.API.dll!PS.FritzBox.API.DeviceLocator.DiscoverAsync() Line 26 C#
PS.FritzBox.API.CMD.exe!PS.FritzBox.API.CMD.Program.GetDevices() Line 81 C#
PS.FritzBox.API.CMD.exe!PS.FritzBox.API.CMD.Program.Main(string[] args = {string[0x00000000]}) Line 18 C#
Bei meiner FritzBox ist auch IPv4 und IPv6 aktiv.
The api looks really intresting, thanks for your work.
Sadly i get the Exception System.XML.XMLException "Root Element does not exist".
This is the code
Dim client As New PS.FritzBox.API.WANCommonInterfaceConfigClient("http://192.168.0.1", 10000)
client.UserName = "Name"
client.Password = "Passwort"
Dim mon As OnlineMonitorInfo = Await client.GetOnlineMonitor(0)
Thanks for your help
Hi,
first of all thanx for Your work!
I'm not sure if it's model related, but I had to change the port and the pathnames in order to get it working:
for the connection: ...("http://fritz.box:49000", 10000);
and all paths with /tr064 like string ControlUrl => "/tr064/upnp/control/wanpppconn1";
need to be changed to string ControlUrl => "/upnp/control/wanpppconn1";
Cheers, Stephan
Modell: FRITZ!Box Fon WLAN 7390
FRITZ!OS: 06.83
Hi,
there some typos in WANPPPConnectionClient.cs:
In function public async Task<WANPPPConnectionInfo> GetInfo()
line 41: "NewUpTime" needs to be "NewUptime"
line 48: "UpstreamMaxBitRate" needs to be "NewUpstreamMaxBitRate"
I also had crashes with the Convert.ToBoolean
... dunno - I changed it e.g. to document.Descendants("NewRSIPAvailable").First().Value == "0" ? false:true;
Cheers, Stephan
Eine Möglichkeit wäre noch die Erweiterung der Kontrolle des 5 Ghz und des Gäste WLANs mittels der Befehle:
/upnp/control/wlanconfig2
/upnp/control/wlanconfig3
Hab ich etwas übersehen? Meiner Meinung müsste derzeit nur der Service #1 von der FritzBox steuerbar sein.
Hi,
Is there any way to already retrieve the answering machine/TAM? I would like to check whether a new call was recorded in the last x hours.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.