Fritzbox Binding (using TR064 protocol) not working to fetch presence of a specific mac adress

Hi,

I am encountering a not working binding in concern of fetching the presence of a specific mac adress. I am using a raspberry pi 3b+ and a FritzBox 7270.

The FritzBox is in loginmode to request a user (openhab) and pw. The tr064 protocoll is activated and the user has access to this. Port is 49000 or 49443, as far as I know.

Raspian is installed headless and I am using OH Vers. 2.4.0-1 and the binding is on version 1.13.0.

The “fritzboxtr064.cfg” looks like this:

## Binding for accessing FritzBoxes using the TR064 protocol. Uses http(s) requests.

# URL. Either use http://<fbox-ip>:49000 or https://<fbox-ip>:49443 (https preferred!)
url=http://192.168.<ipisset>.1:49000

# Refresh Interval (60000ms default)
refresh=5000

# User Name (only use this value if you configured a user in fbox webui/config!)
# If this parameter is missing, "dslf-config" is used as default username
# It is recommended to to switch to authentication by username in fritzbox config
# and add a separate config user for this binding.
user=openhab

# PW
pass=<pwisset>

The items file looks like this:

Contact Handy "Handy (WiFi) [%s]" <network> { fritzboxtr064="maconline:<macisset>" }

All should work, and it did before, but the presence isn’t changing to present. If l Iog my phone into the WLAN. From the log’s I learn this:

2019-12-15 10:40:19.779 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - Releasing connection to FritzBox because of error.
2019-12-15 10:40:19.818 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - Error retrieving SOAP response from FritzBox

or this:

2019-12-15 10:27:19.389 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - No tr064 service found for service id urn:WLANConfiguration-com:serviceId:WLANConfiguration3
2019-12-15 10:27:19.395 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been started
2019-12-15 10:27:20.686 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been shut down

Any idea of solving this?

When I did implement the TR064 access, it took me some time to get it working as well. Some guesses from my side:

Your MAC address in the items files, format (uses the ‘-’)

{fritzboxtr064="maconline:FF-FF-xx-xx-xx-xx"}

Your FritzBox, there is some settings you have to do to enable the TR064 access - from the documentation:
Enable TR064: In the webui goto “Heimnetz” - “Netzwerkeinstellungen”: enable option “Zugriff für Anwendungen zulassen” (enabled by default)

This error code:

No tr064 service found for service id urn:WLANConfiguration-com:serviceId:WLANConfiguration3

looks a bit suspiscious to me, are you connecting via WLAN from the pi to the fritz box? Maybe that would disallow the TR064 access for security?

Hi,

thanks for your answer and suggestions. The macadress is set as it should be in the items file (FF-xx- etc.), the options in the fritzbox are set, as you mentioned. Yes, I am connecting via WLAN, I will look into this…

EDIT: What I checked so far is as follows:

  • Kommunikation der WLAN_Geräte untereinander erlauben: yes, no positiv result
  • WLAN restriction only for known macadresses switched off, no positiv result
  • checked the O.S.: Version of my Fritzbox, it is 6.06 from 2015, the binding did once work after that date
  • checked AVM’s notes about the tr064, no restriction on WLAN-Connections, it did work over WLAN once, anyway.

EDIT II:

Here ist what I found as well: To test, if the tr 064 protocol and connection is working, try

http://fritz.box:49000/tr64desc.xml

in your browser. It works in my case, even with a WLAN-connection.

in the tr064desc.xml, can you find WLANConfiguration3 ?

I find 1 & 2:

<service>
<serviceType>urn:dslforum-org:service:WLANConfiguration:1</serviceType>
<serviceId>
urn:WLANConfiguration-com:serviceId:WLANConfiguration1
</serviceId>
<controlURL>/upnp/control/wlanconfig1</controlURL>
<eventSubURL>/upnp/control/wlanconfig1</eventSubURL>
<SCPDURL>/wlanconfigSCPD.xml</SCPDURL>
</service>
<service>
<serviceType>urn:dslforum-org:service:WLANConfiguration:2</serviceType>
<serviceId>
urn:WLANConfiguration-com:serviceId:WLANConfiguration2
</serviceId>
<controlURL>/upnp/control/wlanconfig2</controlURL>
<eventSubURL>/upnp/control/wlanconfig2</eventSubURL>
<SCPDURL>/wlanconfigSCPD.xml</SCPDURL>
</service>

But no 3, no.

OK, I think I know where you are aiming at. If there is no 3, but the binding try’s to connect to the 3, it, of course, can’t work. Here is the whole output: tr064.txt (10.8 KB)

I have no idea, I just looked at my tr064desc.xml and did see the wlanconfig1 and wlanconfig2. Don’t have a wlanconfig3 either. I have no clue what this means, it was just the only error message that doesn’t look generic.

Ok, thank you anway.

For the fritzboxtr064.cfg, I use

url=https://fritz.box:49443
refresh=60000

and I remember having troubles with a file that I did edit on my windows, the line breaks where windows style and not unix style. If I remember correctly, one of the editors (nano? vim?) is issuing a warning in this case.

Else, what about the rights you gave to the user openhab on the FritzBox?

I do normaly use Visual Studio Code via Samba. I now did use nano via ssh and got a new error-message via the log-files:

I did put in:

url=https://fritz.box:49443
refresh=60000
2019-12-15 13:22:51.310 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - No tr064 service found for service id urn:LanDeviceHosts-com:serviceId:Hosts1
2019-12-15 13:22:51.315 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - Error constructing request SOAP msg for getting parameter. null
2019-12-15 13:22:51.318 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - Could not determine data to be sent to FritzBox!
2019-12-15 13:22:51.320 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread FritzboxTr064 Refresh Service
java.lang.NullPointerException: null
	at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:219) ~[?:?]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) ~[277:org.openhab.core.compat1x:2.4.0]
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [277:org.openhab.core.compat1x:2.4.0]

The rights are set to the openhab user to use tr064…

EDIT:

ok tried again and I am back to:

2019-12-15 13:28:43.989 [WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - No tr064 service found for service id urn:WLANConfiguration-com:serviceId:WLANConfiguration3
2019-12-15 13:28:44.000 [INFO ] [b.core.service.AbstractActiveService] - FritzboxTr064 Refresh Service has been started

Hi at all. WLANConfiguration:3 comes from Boxes with 2.4 + 5 GHz WiFi and Guest WiFi.
The Fritzbox 7270 has only 2.4GHz WiFi and Guest. Result is only two WLANConfigurations.

Ok, thank you. Maybe this is helpfull too:

  • the box must have an age of 9 to 10 yeras now, maybe I need a new one…
  • do I need to grant special access to the WLAN to the linux user ‘openhab’ on my raspberry pi?
  • I had openhabian running, but the detection stopped just from one day to another… (no special update I can think of in these days)

Hi,

I had another FritzBox here to test. The issue isn’t OH related. It is my old FritzBox. Thanks to you anyway.