Display Message on Samsung TVs in Python (Samsung MessageBox Service Exploitation)


This script is the result of a weekend’s hacking to get my TV to display incoming calls/texts which I miss invariably because the phone is buried under a sofa or in a different room. Earlier I had done this using my Odroid U2 and Tasker/AutoRemote but this was limiting as this meant that I could see the notifications only when I was watching something through the Odroid. Samsung TVs, which are DLNA enabled, also include a hidden service called “Message Box” which can display different information on the TV natively irrespective of which display mode/input mode you are in.

I had come across this while reverse engineering the DLNA protocol extensions that Samsung had built in their TVs to get subtitles working over DLNA but didn’t put much thought into it. Fueled by the new Raspberry Pi I recently acquired (more on this later below), I set out to find out the details of this service and exploit it for my need and a few hours later, samsung-messagebox was born :)

You can get it from here: https://github.com/shantanugoel/samsung-messagebox

Usage:

     usage: samsung-msgbox.py -i IP -m MSG [-p PORT] [-t TIME] [-r RECEIVER]
                              [-x RECEIVER_NO] [-s SENDER] [-y SENDER_NO] [-h]
     
     Send an arbitrary text message to Samsung TVs which is displayed onscreen.
     Developed by Shantanu Goel (http://tech.shantanugoel.com/) version 1.0
     
     Arguments:
       -i IP, --ip IP        Required. IP Address of the TV
       -m MSG, --msg MSG     Required. Message body text to be sent to TV
       -p PORT, --port PORT  Optional. Port on which message should be sent
       -t TIME, --time TIME  Optional. Receive date and time in epoch/unix format
       -r RECEIVER, --receiver RECEIVER
                             Optional. Receiver Name
       -x RECEIVER_NO, --receiverno RECEIVER_NO
                             Optional. Receiver Number
       -s SENDER, --sender SENDER
                             Optional. Sender Name
       -y SENDER_NO, --senderno SENDER_NO
                             Optional. Sender Number
       -h, --help

I’ve tested it currently with my 2010 C Series TV. Hopefully, it should work with any TV that has this service. If you face any problems then let me know and I can try to add support for your TV.

Raspberry PI: So, where does raspberry pi figure in all this? Well, I wanted to display my incoming call/text alerts on my TV. So, I made a small webserver in python that I run on my raspberry pi, listening for some special parameters. Whenever I get a call or SMS, I created a tasker profile to call this server with the call/sms parameters and the server in turn calls the above samsung-messagebox.py script to display the alerts. I’m also planning to integrate it with a dropbox based service to put it to more uses. Let me know if you have any ideas in mind.

Some pics of this working:

/img/2013/07/samsung-messagebox-demo-1-300x225.jpg

Samsung MessageBox Demo 1

/img/2013/07/samsung-messagebox-demo-2-300x225.jpg

Samsung MessageBox Demo 2


See also