baflo
Posts: 2
Joined: Sat Nov 18, 2017 6:01 pm

Network request to TV works from any device but Raspberry Pi

Sat Nov 18, 2017 6:07 pm

I'm trying to control my Panasonic TV via network. I had all my code (node) running from the laptop when I transferred it to the Raspberry. For some reason, it does not work from there. (A similar project controlling my Denon receiver works very well.)

By "Not Working", I mean, that the TV can be reached, but returns a 403 error. When TV is off, it's unreachable. So the Raspberry calls out to the TV.

I tried many different ways and eventually I'm working with a curl request. It works from everywhere, but not from the Raspberry:

Code: Select all

curl 'http://192.168.178.142:55000/nrc/control_0' \
    -H 'content-type: text/xml; charset="utf-8"' \
    -H 'user-agent: net.thlabs.nodecontrol' \
    -H 'soapaction: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"' \
    --data-binary '<?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:X_SendKey xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"><X_KeyEvent>NRC_MUTE-ONOFF</X_KeyEvent></u:X_SendKey></s:Body></s:Envelope>' \
    --compressed
It does work from the Raspberry, if I proxy through any other device e.g. my laptop. However, it does not work, when I proxy from laptop through the Raspberry.

Trying for two days now, does anybody have a clue?

----
Stack Overflow: https://stackoverflow.com/q/47367993

SurferTim
Posts: 1259
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Network request to TV works from any device but Raspberry Pi

Sat Nov 18, 2017 9:30 pm

Error 403 is "Forbidden". Usually means the page requires some type of authorization to access it, or you are requesting the wrong page.

baflo
Posts: 2
Joined: Sat Nov 18, 2017 6:01 pm

Re: Network request to TV works from any device but Raspberry Pi

Sun Nov 19, 2017 7:45 am

Yes, I agree. But I use exactly the same command on two devices without authentication. The one works, the other doesnt.

Edit: I just tested a third device, that never connected to the TV. The curl command works out of the box.

Edit2: I reduced the curl even more: Without user-agent, content-type and compression this stilll works on any laptop (running windows, also WSL shell), but on my Raspberries (1+3, Rasbian and ArchLinux), I receive 403. When I additionally omit the soapaction I receive error 400 everywhere.

Code: Select all

curl 'http://192.168.178.142:55000/nrc/control_0' \
    -H 'soapaction: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"' \
    --data-binary '<?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:X_SendKey xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"><X_KeyEvent>NRC_MUTE-ONOFF</X_KeyEvent></u:X_SendKey></s:Body></s:Envelope>' \
    -w '%{http_code}'

User avatar
Paul Webster
Posts: 708
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK

Re: Network request to TV works from any device but Raspberry Pi

Mon Nov 20, 2017 10:40 am

Maybe the various quotation marks or other symbols are causing issues.
Try searching for other curl command line examples that people say work on Linux and have various quotation marks throughout.

Return to “Troubleshooting”

Who is online

Users browsing this forum: AndreF53 and 54 guests