Fritz Box TR064-Binding - Problems at setup

Hi!

At the moment I am trying to migrate my Raspberry3 Setup to my new MacMini-Server.
I have some trouble doing this and one of the points that are unclear to me is that the TR064 Fritz Box Binding is not working at all.
When I launch OH2 via Terminal I get this errors in the Karaf-console after a few minutes:


openhab> java.lang.NullPointerException                                         
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.soapToString(Tr064Comm.java:429)
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.getTr064Values(Tr064Comm.java:249)
	at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:211)
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144)
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166)
java.lang.NullPointerException
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.soapToString(Tr064Comm.java:429)
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.getTr064Values(Tr064Comm.java:249)
	at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:211)
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144)
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166)
java.lang.NullPointerException
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.soapToString(Tr064Comm.java:429)
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.getTr064Values(Tr064Comm.java:249)
	at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:211)
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144)
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166)
java.lang.NullPointerException
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.soapToString(Tr064Comm.java:429)
	at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.getTr064Values(Tr064Comm.java:249)
	at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:211)
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144)
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166)

I did not make any changes at all to my .cfg, .things and .items files so I am pretty sure, everything is set up correctly.
I installed the java alternative Zulu as recommended in the introduction Readme. That and the OS change from Unix to OS X are the only changes I made …

My OH Log:

schemas.xmlsoap.org/soap/encoding/">
2018-05-26 21:24:16.405 [ERROR] [ing.fritzboxtr064.internal.Tr064Comm] - Could not read response from FritzBox. Unauthorized! Check User/PW in config. Create user for tr064 requests
2018-05-26 21:24:16.407 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - Error retrieving SOAP response from FritzBox

I double checked username and password and even tried switching from https to http but it did not have any effect.

Do you have any idea what I could try?

Thank you!

Have you done this settings?

Hi and thanks for your reply!
I configured these settings directly in my .cfg-file and they have been imported successfully into paper ui as well.

I just can’t get it to work.
I implemented the Binding using the addons.cfg. I deleted it from there and reinstalled it manually.
Created a new user at the FB and even tried with admin (Http and https). It just won’t find my fritz box …

Hi Jonas,

openhab finds your fritzbox and is able to connect with https, so no need for http.
But there is a problem with the authentication (which has nothing to do with https).

If the password/user combination is correct as you’ve written, there are two other scenarios possible:

  1. Did you configure the fritz box to allow access by an application account? There is a setting for this:

Click “Home Network” in the FRITZ!Box user interface.
Click “Home Network Overview” in the “Home Network” menu.
Click on the “Network Settings” tab.
Enable the option “Allow access for applications” in the “Access Settings in the Home Network” section. If the section is not displayed, enable the Advanced View first.
Click “Apply” to save the settings.
→ From Fritzbox Knowledge Base

  1. There is a bug in the TR064 Binding Plugin. When you do a lot of connections to the FritzBox, it is likely that two connections opened in parallel. In this case the authentication will fail. I’ve a fix for this and looking for voluntary testers of my patch. But if your failure appear on the first connection, this bug is very unlikely the cause.
    [Fritzboxtr064] Synchronized access to fritzbox. by oprobst · Pull Request #5484 · openhab/openhab1-addons · GitHub
1 Like

Hi Oliver and thanks for you reply!

Access for applications is allowed and i created an openhab user that has access too.
I just can’t get it to work. I even tried with my admin and admin-pw but the only thing i get from the log is:

2018-06-18 09:28:42.238 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been started
2018-06-18 09:29:19.038 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been shut down

It worked on my raspberry but now i can’t get it to work.
I also installed the AVMFritz binding for my DECT Switches and this is working perfectly.

I will take a look at the link to github you provieded.

Thanks!

Hi,

i have the same problem here. Installed the binding, changed the config with uname/pwd but only get the following result

18-11-10 10:39:14.156 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been started

2018-11-10 10:40:02.496 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been shut down

it works wether with https nor with http
any idea?

Thanks!

Hi Andreas,

I have exactly the same problem. I tried everything for hours. First i thought it might be a problem with fritzbox certificate, so i signed in at myfritz.net to get a new certificate by activating Let´s enrypt. It didn´t work either.
Did you fix the Problem in the meantime? Has anybody an idea what i´m doing wrong?

Thanks!

Daniel

Hi!

This is an info point :wink:
I recognized, that it’s working anyway. I expected a thing to be created in Paper UI but that’s not the case. It’s working anyway though. Please check, if you can turn on/off your wifi with the items you created :wink: It’s working great for me!

Hi Jonas!
Thanks so much. It works! I can turn on/off the wifi and the presence item work aswell. Unfortunately all informations that have to do with dsl are not shown. But I think this has something to do with the cable-Fritbox…

I solved it, but not sure which steps are needed.

What I’ve done:
Create a user in fritzbox which has rights:

  • FRITZ!Box Einstellungen
  • Sprachnachrichten, Faxnachrichten, FRITZ!App Fon und Anrufliste
  • Smart Home

In homenetworksettings (near user settings)

  • enable: Anmeldung mit FRITZ!Box-Benutzernamen und Kennwort

Now fritzbox is prepared.

In services\fritzboxtr064.cfg enter the right values for:

url=
user=
password=

I’m not sure if I had done some aditional configs in:
paperUI / Configuration-Things-Edit-FRITZ!Box xxx
or if this was just there.

Try to enter password/ip and username here too.
Now fritzbox should go online

Create some items

Switch  fboxRinging                     "Phone ringing [%s]"                               {fritzboxtr064="callmonitor_ringing" }
Switch  fboxRinging_Out                 "Phone ringing [%s]"                             {fritzboxtr064="callmonitor_outgoing" }
Call    fboxIncomingCall                "Incoming call: [%1$s to %2$s]"                     {fritzboxtr064="callmonitor_ringing" } 
Call    fboxOutgoingCall                "Outgoing call: [%1$s to %2$s]"                     {fritzboxtr064="callmonitor_outgoing" }

Now you should see in the log the item status.

So do i see that right: There is no thing descovered or created in the paper UI ti use the binding? and how do i access more than one Fritzbox?

No, because it’s a OH 1 binding.

That’s not possible.

1 Like

OK, now i moved a big step head. Thanks for your answers.

Hi!

It’s me again.
I do have some problems with the binding for some time now and cannot find a way to fix it.
The Log plots this every few minutes:

2020-04-04 22:35:26.791 [WARN ] [itzboxtr064.internal.SoapValueParser] - Fault received from FritzBox for item wifi24Switch in SOAP response <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">