MagentaTV Binding for Deutsche Telekom MR 4xx

Thanks for your response.
Screen output :

Telekom Entertain Control
:49154 -> 192.168.0.55:49152; local MAC=
nc: Address already in use
Send pairing request (pairingDeviceID='D41D8CD98F00B204E9800998ECF8427E', friendlyName='oh-pi', userID='5903A68E8E31CF7EFC9718C635FC037D')
Result=-2
Pairing request failed: -2
OFFsult>-2</result>

soap_pair.xml

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:X-pairingRequest xmlns:u="urn:schemas-upnp-org:service:X-CTC_RemotePairing:1">
<pairingDeviceID>D41D8CD98F00B204E9800998ECF8427E</pairingDeviceID>
<friendlyName>oh-pi</friendlyName>
<userID>5903A68E8E31CF7EFC9718C635FC037D</userID>
</u:X-pairingRequest>
</s:Body></s:Envelope>

request_pair.log

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:X-pairingRequestResponse xmlns:u="urn:schemas-upnp-org:service:X-CTC_RemotePairing:1">
<result>-2</result>
</u:X-pairingRequestResponse>
</s:Body> </s:Envelope>

log status output

Telekom Entertain Control
:49154 -> 192.168.0.55:49152; local MAC=
Receiver is powered ON
ON

The script is unable to detected the local ip / mac address.
which environment are you using?
Raspbian, macOS…?

Please try

ip link show eth0

and

ifconfig en0

one of them should work.

what does

uname

show?

I am running Ubuntu 16.04 LTS server on an Intel NUC.
This system does not have eth0 but enp3s0 as primary network interface.

we could fiddel around that later

as a work around:

  • open the script and search for “function get_mac”
  • set ip_addr to your local IP address and mac_addr to your local MAC address
    at the end of the function:
    local_ip="192.168.x.x"
    mac_addr=“xx:xx:xx:xx:xx:xx”
  • run “./entertain_control.sh log status”

please also run the commands above and send the output

ip link show eth0

Device "eth0" does not exist

ifconfig en0

en0: Fehler beim Auslesen der Schnittstelleninformation: Gerät nicht gefunden

uname

Linux

Setting IP and MAC manually like you suggested does not change the result.
entertain_control.sh log status

Telekom Entertain Control
192.168.0.112:49154 -> 192.168.0.58:49152; local MAC=B8:AE:ED:70:16:25
Receiver is powered ON
ON

ok, now try

./entertain_control.sh log on
./entertain_control.sh log off

and provide output from

ifconfig enp3s0
ip link show enp3s0

./entertain_control.sh log on

Telekom Entertain Control
192.168.0.112:49154 -> 192.168.0.58:49152; local MAC=B8:AE:ED:70:16:25
nc: Address already in use
Send pairing request (pairingDeviceID='ADA7A411BB1FD7A406F0AACE1C840A7E', friendlyName='oh-pi', userID='5903A68E8E31CF7EFC9718C635FC037D')
Result=-2
Pairing request failed: -2
OFFsult>-2</result>

./entertain_control.sh log off

Telekom Entertain Control
192.168.0.112:49154 -> 192.168.0.58:49152; local MAC=B8:AE:ED:70:16:25
nc: Address already in use
Send pairing request (pairingDeviceID='ADA7A411BB1FD7A406F0AACE1C840A7E', friendlyName='oh-pi', userID='5903A68E8E31CF7EFC9718C635FC037D')
Result=-2
Pairing request failed: -2
Press Power/result>
Send key '0x0100'
Result=
OFF

ifconfig enp3s0

enp3s0    Link encap:Ethernet  Hardware Adresse b8:ae:ed:70:16:25
          inet Adresse:192.168.0.112  Bcast:192.168.0.255  Maske:255.255.255.0
          inet6-Adresse: fe80::baae:edff:fe70:1625/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX-Pakete:40913666 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
          TX-Pakete:28189254 Fehler:0 Verloren:0 Überläufe:0 Träger:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX-Bytes:26962718005 (26.9 GB)  TX-Bytes:3224939340 (3.2 GB)

ip link show enp3s0

2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:ae:ed:70:16:25 brd ff:ff:ff:ff:ff:ff

is curl installed?
please post request_pair.log

Hi Markus,
yes, curl is installed and working
request_pair.log

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:X-pairingRequestResponse xmlns:u="urn:schemas-upnp-org:service:X-CTC_RemotePairing:1">
<result>-2</result>
</u:X-pairingRequestResponse>
</s:Body> </s:Envelope>

Thanks for your support

as far as I can see the response is returned from the receiver. It’s a valid soap response with result -2 (which then gets correctly parsed and displayed).

make sure that the receiver is powered on (to simplify the test case)

search for “# Subscribe to Pairing events”
and insert the line

printf "SUBSCRIBE /upnp/service/X-CTC_RemotePairing/Event HTTP/1.1\r\nHOST: $remote_ip:$remote_port\r\nCALLBACK: <http://$local_ip:$local_port/>\r\nNT: upnp:event\r\nTIMEOUT: Second-300\r\nCONNECTION: close\r\n\r\n" > $tmp/soap_subscribe.xml

please run the test and post soap_subscribe.xml and soap_pair.xml

ok, next try, receiver is powered on (was on in all test scenarios)
soap_subscribe.xml

SUBSCRIBE /upnp/service/X-CTC_RemotePairing/Event HTTP/1.1
HOST: 192.168.0.58:49152
CALLBACK: <http://192.168.0.112:49154/>
NT: upnp:event
TIMEOUT: Second-300
CONNECTION: close

soap_pair.xml

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:X-pairingRequest xmlns:u="urn:schemas-upnp-org:service:X-CTC_RemotePairing:1">
<pairingDeviceID>ADA7A411BB1FD7A406F0AACE1C840A7E</pairingDeviceID>
<friendlyName>oh-pi</friendlyName>
<userID>5903A68E8E31CF7EFC9718C635FC037D</userID>
</u:X-pairingRequest>
</s:Body></s:Envelope>

Now I also had the time to run some first tests. The behaviour in my environment is exactly the same.

I am using a Raspberry Pi with Raspian and a wifi connection. Therefore I changed the script in order to retrieve the mac address of the WLAN adapter.

I also had to change the log output to /dev/stdout because the configured log path does not exist in my environment.

My receiver ist powered on and I tried at first the command statusand this is the result:

root@raspi3:~# ./entertain_control.sh log status
Telekom Entertain Control
TMP-Dir=/root/tmp
:49154 -> 192.168.2.104:49152; local MAC=B8:27:EB:BD:3F:9B
/dev/stdout
terminalID='AE0ED9A19F15D65C4C3022EEB9AA0C48'
Receiver is powered ON
ON

Then I tried to power it off with the off command.And this is the result:

root@raspi3:~# ./entertain_control.sh log off
Telekom Entertain Control
TMP-Dir=/root/tmp
:49154 -> 192.168.2.104:49152; local MAC=B8:27:EB:BD:3F:9B
/dev/stdout
terminalID='AE0ED9A19F15D65C4C3022EEB9AA0C48'
Listening on [0.0.0.0] (family 0, port 49154)
Send pairing request (pairingDeviceID='AE0ED9A19F15D65C4C3022EEB9AA0C48', friendlyName='oh-pi', userID='5903A68E8E31CF7EFC9718C635FC037D')
Result=-2
Pairing request failed: -2
Press Power/result>
Send key '0x0100'
Result=
OFF

Sending the “on” command has the same result.

If you need more information please tell me.

It is the same behaviour as in my environment. Status request is working.

Oops, sorry,seems I overlooked one of your posts :slight_smile:

No worries Martin, just wanted to make this clear, not o lead Markus into wrong direction.

hmm, the only thing which is static is the user id. I need to play here.
maybe also a setting of the receiver could have an effect? (are there any security related settings). It’s hard to guess what -2 means without any documentation.

thought about the user id topic. So far as I know the receiver has no concepts of users, but is in some way related to your Telekom line, so maybe this is a hash of your Telekom user id?
I can’t remember if I need to enter user credentials while configuring the receiver, the App defiantly requires to login when started first time.

Any thoughts?

No, the receiver does not need any credentials
Do you remember how you created your user ID?

On the „Telekom Kundencenter“ (I have T-DSL with Entertain). Maybe the App uses it, even not bound to the receiver.

Do you have the App and could provide a Wireshark dump? Then we could compare with my App dump.