Build your own Google TV Using RaspberryPi, NodeJS and Socket.io

Image By http://korben.info/

Image By http://korben.info/



If you’d like to support this project please flattr this!

Please note that this project is not intended to replicate an actual GoogleTV, but it’s simply a proof of concept using modern web technologies.
Watch the full workshop here hosted by Menaversity
This workshop was given at Lamba Labs Beirut First Hackerspace 
after a series of lightning talks check out the presentation here
If you'd like to bypass the tutorial and jump into the fun stuff, you can always  fork the code on Github

Google-tv-logo3-l

What’s Google TV ?

Turned out that Google is also doing its own thing for the 10-foot screen. Google announced 2 versions of their famous new TV, the first is called the Buddy Box which is currently an expensive box manufactured by Sony and the second is an Integrated TV built right into the TV set that will be announced soon.

The Google TV looks something like that:

google_tv_preview

Google TV preview

Developers: you can start building your own Web Apps for the Google TV or renovate any android app to fit the 10′ experience, all the resources can be found at Google’s Developers Site

Build your own Google TV

In this tutorial you’re going to build your own version of the Google TV using the following open source technologies:

Hardware:

Software Stack:

  • Raspbian OS – a Debian distro specially made for the rPi
  • NodeJs
    • Socket.io – to handle the connection between our remote and our TV via websockets
    • Express – to handle some basic http requests
    • Omxcontrol – a simple module to control the OMXPlayer which is the best video player on the rPi
  • Chromium Browser
  • OMXPlayer
  • Youtube-dl – a script that let you download youtube videos
  • QuoJS – to handle swipe gestures on the mobile web app
  • HTML5, CSS3 transitions, Javascript, and Moustache as a template engine
  • Youtube API

The end result

raspberrypi_tv_google_tv

Raspberry Pi TV with its special remote controller

 

Walkthrough

The project is divided into 4 main categories:

  1. Installing the software stack
  2. Basic shell commands & scripts
  3. Building the back-end: NodeJS + Express + Socket.io
  4. Building the front-end: Dashboard and Remote App

1.Installing the software stack:

Install Raspbian & NodeJS

Follow this tutorial to install Raspbian and Node Js on your Raspberry Pi

Install Chromium & Youtube-dl

Install Chromium Browser for the Raspberry Pi Source

sudo apt-get install chromium-browser

In order to have a better display you can also install MC core fonts using

sudo apt-get install ttf-mscorefonts-installer

Install and Update Youtube Downloader

sudo apt-get install youtube-dl 

sudo youtube-dl -U
Note-1: There’s a problem when you want to stream videos on the RaspberryPi from youtube in Chromium, they’re extremely slow because the videos are not being rendered on the GPU. Youtube-dl comes as a quick alternative, the video is downloaded instead then played by the OMXPlayer which will render our videos on the GPU giving us a good quality of HD videos.
Note-2: The OMXPlayer is installed by default on the Raspbian.

2.Basic shell commands & scripts

If you’re using SSH to connect to your RaspberryPi you should first add “DISPLAY=:0.0″ to your env variables, by simply executing

export DISPLAY=:0.0

To check all your environment variables

env

Test Chromium in Kiosk Mode:

chromium --kiosk http://www.google.com

Test Youtube-dl

youtube-dl youtube_video_url

I’ve added few arguments to the youtube-dl command to change the name of the downloaded file to be just the “-o youtube ID [dot] the extension” and with the “-f /22/18 ” I can force this script to download for me a 720p version of the video. Check out the full list of supported youtube formats here

youtube-dl  -o "%(id)s.%(ext)s" -f /22/18 youtube_video_url

After downloading the video, try playing it using OMXPLayer

omxplayer youtube_video_file

Have fun trying the keyboard shortcuts to pause/resume your video and a lot more

Fancy! Let’s automate this process using Node JS

Building the backend: NodeJS + Express + Socket.io

The source code is intended to be simple for the sake of the workshop. Here’s the project’s hierarchy:

  • public
    • js
    • css
    • images
    • fonts
    • index.html
    • remote.html
  • app.js
  • package.json

Package.json – A JSON file needed by npm to auto-install dependencies and save some basic info about your project

{
    "name": "RasPi.TV",
    "version": "0.0.1",
    "private": false,
    "scripts": {
        "start": "node app.js"
    },
    "dependencies": {
    "express": "3.1.1",
    "socket.io":"0.9.14",
    "omxcontrol":"*"
    }
}

after creating this file, go to your app directory and run the following to install the dependencies.

npm install
Note-3: Notice that a folder called node_modules will be created prior to this action, if you like to use git, don’t forget to create a .gitignore file and simply write into it “node_modules” this will ignore the folder node_modules from being added to your git project

Create the app.js file and lets start by creating our basic HTTP Express Server

var express = require('express')
  , app = express()  
  , server = require('http').createServer(app)
  , path = require('path')

// all environments
app.set('port', process.env.TEST_PORT || 8080);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(path.join(__dirname, 'public')));

//Routes
app.get('/', function (req, res) {
  res.sendfile(__dirname + '/public/index.html');
});

app.get('/remote', function (req, res) {
  res.sendfile(__dirname + '/public/remote.html');
});

server.listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

This is our basic Express HTTP server configuration with our routes. To test what’ve done so far, you should first create the index.html and remote.html files inside the public/ directory, write your favorite “Hello, World” messages into them, then go back to your terminal and execute

node app.js

or

npm start
Note-4: That will only work if you have added the following piece of code to your package.json
...
"scripts": {
        "start": "node app.js"
    },
...

Once your server starts it will output that Express server listening on port 8080
To test your “Hello, World” pages you should run this application in the background by simply doing

node app.js &

Now this is the most primitive way to launch a Node application in the background, while learning node you might bump into some modules that automates this simple task, just like Forever.js

Now we have our Node Application up and running in the background, let’s open chromium in kiosk mode and test our Hello, World pages.

chromium --kiosk http://localhost:8080

Adding the Socket.io Magic

I strongly believe that WebSockets are the foundation of the modern web, I always like to point out the following analogy that helped me understand Socket.io

When AJAX first popped out, old skool developers felt its magic, but they’ve encountered many problems due to how different browsers handle Asynchronous JavaScript and XML requests. jQuery came with the solution by providing a nice and minimal set of functions to deal with the browsers nightmare. Socket.io did the same but for WebSockets and even more!

In order to provide realtime connectivity on every browser, Socket.IO selects the most capable transport at runtime, without it affecting the API.

  1. WebSocket
  2. Adobe® Flash® Socket
  3. AJAX long polling
  4. AJAX multipart streaming
  5. Forever Iframe
  6. JSONP Polling

In order to integrate Socket.io we should add the following to our app.js file:

var express = require('express')
  , app = express()  
  , server = require('http').createServer(app)
  , path = require('path')
  , io = require('socket.io').listen(server)
  , spawn = require('child_process').spawn

and to minify the logs add this:

//Socket.io Config
io.set('log level', 1);

When developing with Socket.io always think like you’re creating a Hello, World Chat Application. I’ve added a simple Chat Application done with Node & Socket.io on a github repo for the sake of this tutorial!

Our Socket.io Server is ready, but it doesn’t do anything, we should implement how we process messages and events sent from the client to the server.

Here’s how you implement this on the server’s side, note that you should also implement how you handle messages on the client’s side, we will see that as we progress throughout this tutorial.

io.sockets.on('connection', function (socket) {
    socket.emit('message', { message: 'welcome to the chat' });
    socket.on('send', function (data) {
        //Emit to all
        io.sockets.emit('message', data);
    });
});

Now our server Emits the message “message” whenever a new client is connected, and waits for an event name “send” to process the data and emit it back to all connected clients

In our case We have two types of clients: The RaspberryPi Display (Screen) and the Mobile Web Application (Remote)

var ss;
//Socket.io Server
io.sockets.on('connection', function (socket) {

 socket.on("screen", function(data){
   socket.type = "screen";
   //Save the screen socket
   ss = socket;
   console.log("Screen ready...");
 });

 socket.on("remote", function(data){
   socket.type = "remote";
   console.log("Remote ready...");
   if(ss != undefined){
      console.log("Synced...");
   }
 });
)};

Client Side Sockets Handeling

inside remote.html we should have the following:


	<script src="/socket.io/socket.io.js"> </script>
	<script>
	  //use http://raspberryPi.local if your using Avahi Service 
          //or use your RasperryPi IP instead
          var socket = io.connect('http://raspberrypi.local:8080');
	  socket.on('connect', function(data){
		socket.emit('screen');
	  });
	</script>

On our index.html


	<script src="/socket.io/socket.io.js"> </script>
	<script>
	  //use http://raspberryPi.local if your using Avahi Service 
          //or use your RasperryPi IP instead
          var socket = io.connect('http://raspberrypi.local:8080');
	  socket.on('connect', function(data){
		socket.emit('screen');
	  });
	</script>

Execute Shell Commands from Node Server

Node enables us to run a system command within a new child process, and listen in on its input/output. This includes being able to pass arguments to the command, and even pipe the results of one command to another. 

The basic way of executing shell commands from NodeJS is very simple

spawn('echo',['foobar']);

But if you want to pipe in the output, you should add the following function to your app.js file:

//Run and pipe shell script output 
function run_shell(cmd, args, cb, end) {
    var spawn = require('child_process').spawn,
        child = spawn(cmd, args),
        me = this;
    child.stdout.on('data', function (buffer) { cb(me, buffer) });
    child.stdout.on('end', end);
}

Adding OMXControl – the OMXPlayer controller Node Module

Luckily I found a node module on npmjs.org that let you control your OMXPlayer using Express!
just add the following to your app.js file to use it.

var omx = require('omxcontrol');

//use it with express
app.use(omx());

This will create for us the following routes, that we can use to control and play our videos:

http://localhost:8080/omx/start/:filename

http://localhost:8080/omx/pause


http://localhost:8080/omx/quit

Pretty Awesome!

Putting it all together

Our evolved app.js file


/**
 * Module dependencies.
 */

var express = require('express')
  , app = express()  
  , server = require('http').createServer(app)
  , path = require('path')
  , io = require('socket.io').listen(server)
  , spawn = require('child_process').spawn
  , omx = require('omxcontrol');

// all environments
app.set('port', process.env.TEST_PORT || 8080);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(path.join(__dirname, 'public')));
app.use(omx());

//Routes
app.get('/', function (req, res) {
  res.sendfile(__dirname + '/public/index.html');
});

app.get('/remote', function (req, res) {
  res.sendfile(__dirname + '/public/remote.html');
});

//Socket.io Congfig
io.set('log level', 1);

server.listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

//Run and pipe shell script output 
function run_shell(cmd, args, cb, end) {
    var spawn = require('child_process').spawn,
        child = spawn(cmd, args),
        me = this;
    child.stdout.on('data', function (buffer) { cb(me, buffer) });
    child.stdout.on('end', end);
}

//Save the Screen Socket in this variable
var ss;
//Socket.io Server
io.sockets.on('connection', function (socket) {

 socket.on("screen", function(data){
   socket.type = "screen";
   ss = socket;
   console.log("Screen ready...");
 });
 socket.on("remote", function(data){
   socket.type = "remote";
   console.log("Remote ready...");
 });

 socket.on("controll", function(data){
	console.log(data);
   if(socket.type === "remote"){

     if(data.action === "tap"){
         if(ss != undefined){
            ss.emit("controlling", {action:"enter"}); 
            }
     }
     else if(data.action === "swipeLeft"){
      if(ss != undefined){
          ss.emit("controlling", {action:"goLeft"}); 
          }
     }
     else if(data.action === "swipeRight"){
       if(ss != undefined){
           ss.emit("controlling", {action:"goRight"}); 
           }
     }
   }
 });

 socket.on("video", function(data){

    if( data.action === "play"){
    var id = data.video_id,
         url = "http://www.youtube.com/watch?v="+id;

    var runShell = new run_shell('youtube-dl',['-o','%(id)s.%(ext)s','-f','/18/22',url],
        function (me, buffer) { 
            me.stdout += buffer.toString();
            socket.emit("loading",{output: me.stdout});
            console.log(me.stdout)
         },
        function () { 
            //child = spawn('omxplayer',[id+'.mp4']);
            omx.start(id+'.mp4');
        });
    }    

 });
});

Building the front-end

Raspberry Pi TV Screen Front-end

Raspberry Pi TV Screen Front-end

Describing in details how I built the front-end is outside the scope of this tutorial, however I would like to point out few tips that I discovered while doing this project over the weekend.

When designing for the 10′ Screen there’s some design considerations that you should follow, Google assembled a nice set of these standards on their Developers Site

Raspberry Pi TV Remote

Raspberry Pi TV Remote

Instead of creating a typical remote, full of fake buttons, I decided to give QuoJS a try, it’s really fantastic and easy to use!

$$(".r-container").swipeLeft(function(){
socket.emit('control',{action:"swipeLeft"}); 
});

Here’s an example of how I send the message “Control” back to the server with the data action:”swipeLeft”
the server will handle that message by sending it to the screen, the screen client will handle this message by moving the selected square to the next app (Watch, Listen, Play)

I’ve also stumbled upon few trick that will let your iPhone mobile web app look like a native one with a nice icon and a splash screen.
Just add the following to your HTML <head></head> blocks

<link rel="apple-touch-icon" href="images/custom_icon.png"/>
<link rel="apple-touch-startup-image" href="images/startup.png">
<meta name="viewport" content="width=device-width initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-title" content="Remote">
<meta name="apple-mobile-web-app-capable" content="yes">

Wrap-up

This project is still a work in progress, updates coming soon. If you liked this tutorial please don’t forget to check the source code on Github and show some love by starring it .

logo_ll

Special Thanks to everyone who attended the workshop at Lamba Labs Beirut Hackerspace we hack and make pretty cool things there, come and join us if you can!

gdg_beirut

This workshop is also powered by GDG Beirut and the idea was baked during my lightning talk at the Google IO Extend Beirut 2013

t3_log_en

This tutorial is sponsored by T3 Middle East

logo_mena

And it was fully recorded by Menaveristy, the video is out! Watch it here.

98 thoughts on “Build your own Google TV Using RaspberryPi, NodeJS and Socket.io

    1. Donald Derek Post author

      Will refactor the code, make it more decent, I really hacked this in 4 days for the sake of giving a workshop at the hackerspace! Would love to see someone forking this :D

      Reply
  1. Fady Doumit

    It’s amazing to see how software can turn this small computer into a fully functioning GTV, I will definitely work on this as soon as I receive my Pi.
    Thanks Derek!

    Reply
      1. Umang Desai

        hey man, i plan to get myelf a PI soon. If i use this then lemme know if there is any way to donate if you are open to it. :)

        Support and get supported!

        Reply
  2. Pingback: Build your own Google TV Using RaspberryPi, NodeJS and Socket.io | Donalds Blog | minusetotheipi

  3. Ross

    The code for remote.html should emit “remote” instead of “screen”, right?

    //use http://raspberryPi.local if your using Avahi Service
    //or use your RasperryPi IP instead
    var socket = io.connect(‘http://raspberrypi.local:8080′);
    socket.on(‘connect’, function(data){
    socket.emit(‘screen’);
    });

    Reply
  4. mcm 長財布

    Hi all, just converted into aware of your website through Bing, and located that it must be actually educational. I am going to be careful with regard to belgium’s capital. Let me appreciate for those who continue the following later on. Lots of people could be taken advantage of the creating. Regards!

    Reply
  5. R. Pamely

    I’ve been thinking of getting a Raspberry PI to plug into the TV, basically to make an Apple TV clone. The thing holding me back is knowing whether it is actually powerful enough to play back HD video. Can you tell me how your software performs?

    Reply
  6. Tharshan

    I saw this on HN and said it was awesome on there. Not enough, so I say it again. Really inspiring use of web technologies to create a media center like application. If you get time maybe you can write a little guide on how to go about hacking it. Either way I am going to look into how I can integrate this with put.io!

    Reply
    1. Donald Derek Post author

      WoW I love Put.io! I really should do a complete refactor of the code, hacked this over the weekend, and as you said, the modern web is just crazy!

      Reply
      1. Tharshan

        Well my schedule is going to be opening up in a week, il give you a shout on google+ – see if we can collaborate somehow.

        Reply
  7. Cory Gross

    So it is not possible to stream video using this. You must download the entire video before playback starts?

    Reply
  8. buy essay

    It’s awesome to go to see this web page and reading the views of all mates regarding this piece of writing, while I am also keen of getting experience.

    Reply
  9. Steven hickson

    You can actually use the youtube-dl -g flag to grab the video url and stream it directly to omxplayer so you don’t have to download it.
    So in bash you can do:
    file=`youtube-dl -i -g –cookies /dev/shm/youtube_cookie.txt “$var”`
    omxplayer -r -o hdmi “$file”

    Reply
  10. Pingback: Build Your Own Google TV | MikeFrancois.net

  11. Paul

    This is a cool idea. I love my GoogleTV and was wanting to set something up for my girlfriend on the cheap. The streaming problem makes it a no-go for her though. Watching HBOGO and other online based TV is really why she wants it. I’m guessing the Netflix app has the streaming problem as well?

    Reply
  12. Lucas

    Awesome project man! I was kind in doubt if i should get a RaspPI or not, now you made me go one step further on buying it.

    Reply
  13. Nick

    The code that is posted on gitHub does not work for me… Any advice? I wanted to see how the project was intended then take it further. but I can not use the one posted on GitHub, it simply won’t work. Suggestions?

    Reply
  14. Kevin Quinn

    I just got your code running on my pi on a spare flash. Really cool. I wonder, Donald, what’s the easiest way for me to test the app without a remote (phone) to swipe left and right?

    I’m looking into it now / playing, I wonder if you could point me in the right direction. I’m a JS novice, let alone server-side JS…

    Thanks!

    Reply
  15. RevengeOfShadow

    Hi.

    Great work ! Is it possible to add a feature to read videos from NTFS External-HDD (I’ve some MKV 1080p with subtitles and multi audio tracks that I can’t read with my XBOX360…) ?

    Thanks.

    Reply
  16. David Seres

    Hi!

    I am having issues with npm install (I have the Package.json file in the app directory). This is the error message I get when running npm install:

    0 info it worked if it ends with ok
    1 verbose cli [ '/opt/node/bin/node', '/opt/node/bin/npm', 'install' ]
    2 info using npm@1.2.15
    3 info using node@v0.10.2
    4 verbose read json /home/pi/app/package.json
    5 error install Couldn’t read dependencies
    6 error Error: ENOENT, open ‘/home/pi/app/package.json’
    7 error If you need help, you may report this log at:
    7 error
    7 error or email it to:
    7 error
    8 error System Linux 3.6.11+
    9 error command “/opt/node/bin/node” “/opt/node/bin/npm” “install”
    10 error cwd /home/pi/app
    11 error node -v v0.10.2
    12 error npm -v 1.2.15
    13 error path /home/pi/app/package.json
    14 error code ENOENT
    15 error errno 34
    16 verbose exit [ 34, true ]

    There seems to be a problem with the dependencies. Can you take a look at it?

    Greets,
    David

    Reply
      1. Donald Derek Post author

        Sorry guys took me a while to see this, export DISPLAY=:0.0 should do the trick, did you check your env variables after doing the export DISPLAY ?

        Reply
      2. Michael

        I discovered the problem. I named my “package.JSON” instead of “package.json”

        Case matters. The more you know, I guess.

        Reply
  17. Jean-Guillaume

    Wow, it’s a realy good job! I’m a beginner in the raspeberry Pi world and i’m just lost after ” Building the backend: NodeJS + Express + Socket.io “, not enough detail for me, but i think it’s a project for people who have a little knowledge.

    Reply
  18. misterblix

    Hi there, I’m a UX/UI designer based in London (currently working for BBC) and very keen to contribute to this project from a design perspective. TV platforms available on the market are clunky and awful to use – GTV is probably the best attempt I’ve seen but it doesn’t quite hit the spot.

    I’m inspired by this stripped-down version of the hardware, would love to try and help you guys retain some of that elegance in the UI too (whilst putting a unique identity on the product by breaking the mould a little).

    Is this something straightforward enough for someone who knows only front-end code to set up? I’m totally new to RaspPi but would love to get involved and devote some time to this. Please give me a shout if you can help out!

    Reply
  19. Radhakrishna Sanka

    Great Project !

    Right now I’m content with Xbian but now I think I can find a lot more uses for the Pi with the TV.

    I’ve forked it and started making additions to it. I’m new to Node JS but it seems pretty simple. I’m gonna see what all functionality I can fit in into this project.

    Reply
  20. Geries

    I had problems running chromium as you specify in the tutorial. Did the whole export DISPLAY=:0.0 thingy however never manage to do it that way, always got

    (chromium:3977) Gtk-WARNING **: cannot open display: :0.0

    Googling the error didn’t help. Finally after some days I ended up searching how to chromium kiosk mode in linux and found this little gem:

    http://nexxylove.tumblr.com/post/22690398464/ubuntu-web-kiosk-in-10-easy-steps

    So, in the post she uses no display manager (nodm) to run chormium without the desktop.
    Followed steps 1 to 5 and that worked for me.
    Was wondering what window manager did you use ?

    Reply
  21. Hiro Imamura

    It is a very wonderful project.
    I would like to translate these contents into Japanese.
    And I would like to write these contents to my blog.
    I want your permission.

    Reply
  22. Zach Russell

    Just curious, Hows the streaming progress coming?

    Starting this project soon. Thanks for all your work thus far.

    Reply
  23. Hussein Nasser

    Great work guys

    if you could tune this into a full bundle that can be installed easily this would really pick up

    how do i connect my rasberrypi to my existing TV via HDMI? Is there a hardware adapter for the pi

    Cheers

    Reply
  24. SG

    You mentioned that how you designed the UI is out of scope of this post. I wonder if you would be willing to write a quick blog post about it? I would love to learn!

    Thanks!

    Reply
  25. lilp

    Hello, first of all thank you for your work and sharing it.
    Sorry if my English is bad but I’m French.
    I have a little problem when making your tutorial.
    I create a Package.json file in / home / pi / app in which I put the script describes: {“name”: “GoggleTV-RPI”
    “version”: “0.0.1″
    “private”: false,
    “scripts”: {
    “start” node app.js ”
    };
    “dependencies”: {
    “express”: “3.1.1″
    “socket.io”: “0.9.14″
    “omxcontrol” “*”
    }
    }

    But once I run “npm install”, I got the following errors:
    npm ERR! install Could not read dependencies
    npm ERR! Error: ENOENT, open ‘: home / pi / package.json’

    System Linux 3.6.11 +
    command “/ opt / node / bin / node” “/ opt / node / bin / npm” “install”
    cwd / home / ft
    v-node v0.11.3
    npm-v 1.2.25
    path / home / pi / package.json
    ENOENT code
    errno 34

    Additional logging details can be found in:
    / home / pi / npm.debug.log
    not ok code 0

    Thank you for your time and your help.

    Regards

    Reply
    1. Kromak

      “npm install” look for the package.json in the current path of you terminal. I remember getting that kind of message when I was running “npm install” in ~/ instead of ~/app where my package.json file is located.

      (maybe I’m wrong :p)

      Reply
  26. Kromak

    Hello there,

    I love your project ! I’m trying to build it on my new Pi, but I got an issue when doing the ‘npm install’ part… It seems that it do not find some the packages, like the most important one : GoogleTv-rpi. I’ve take a look on npmjs.org and couldn’t find these packages listed on the website.

    Here is the list of the warning :
    pi@raspberrypi ~/app $ npm install
    npm WARN package.json GoogleTV-rPi@0.0.1 No repository field.
    npm WARN package.json GoogleTV-rPi@0.0.1 No readme data.
    npm WARN package.json cookie-signature@0.0.1 No repository field.
    npm WARN package.json fresh@0.1.0 No repository field.
    npm WARN package.json methods@0.0.1 No repository field.
    npm WARN package.json range-parser@0.0.4 No repository field.
    npm WARN package.json send@0.1.0 No repository field.
    npm WARN package.json policyfile@0.0.4 ‘repositories’ (plural) Not supported.
    npm WARN package.json Please pick one as the ‘repository’ field
    npm WARN package.json bytes@0.2.0 No repository field.
    npm WARN package.json formidable@1.0.11 No repository field.
    npm WARN package.json pause@0.0.1 No repository field.

    What am i missing ?

    Reply
  27. Kromak

    well, I’ve tried with an older version (0.10.2 instead of 0.10.12) of node.Js, and it works better, since I do have now only 1 warning, because GoogeTv-rpi do not have any Readme file…

    so, the latest version of nodejs (0.10.12) seems to not work properly yet for this project… I will try with 0.10.10 or something like that, we will see :)

    can I update my node.Js to 0.10.12 now that I’ve installed the dependencies and GoogleTV packages, without blow up all the thing ?!

    Reply
  28. miko

    I continue to get “unable to open display” error.
    on raspbian (May release) i can only start chromium using xinit

    used export to environment variable for DISPLAY without success :(
    anyone can advice me a solution?

    Reply
  29. DrakaSAN

    Hi, I am currently using your git code to try to use it on my raspberry, then see if I can optimize it somehow.
    Installation and watching video work fine, but there is no audio, and omxplayer shortcut don t work when a video is launched.
    I obviously made something wrong, and reading comment didn t helped me on this problem.
    Can anybody tell me where in the code does omxplayer command like pause are sent, or a way to sent them (http://_rasp_ip_:8080/remote only allow me to search and play video from another computer).

    Great job on it still, really impressive to see a HD vid on a such small thing with so little code.

    Reply
    1. DrakaSAN

      Found where it com from, omxplayer was launched with -o hdmi flag, and my hdmi output didn t had audio, removing the flag and it worked

      Reply
    2. Donald Derek Post author

      Hello thanks for your comment, the OMXPlayer Route can be found inside your node_modules file in a folder called omxcontrol. And for the audio part it seems that you figured it out ;)

      Reply
  30. Sahith

    When I open chromium using the kiosk everything loads perfectly, but it gets stuck on the fonts. It never says screen ready or remote ready like it did in your video. Help?

    Reply
  31. John Jacobs

    “Hackers & makers like to re-invent the wheel”

    I don’t. If someone else has built it already to a reasonable level of quality, then I use that and build on top of it. Great people are great because they stand on the shoulders of others who, in turn, stood on the shoulders of their predecessors. Thus, you won’t ever amount to much if you keep reinventing the wheel.

    For example, it annoys me when so-called programmers, glaring at you Google engineers, throw out millions of lines of hardened code from decades of work and reinvent the wheel and label it Android. Stupid crap like that is the reason we keep going nowhere fast. Real developers don’t reinvent the wheel.

    Reply
    1. Donald Derek Post author

      Take a chill pill dude, was trying to do things differently, don’t take the “Re-invent the wheel” so literally think about the metaphor behind it :p

      Reply
  32. Pingback: Build your own Google TV Using RaspberryPi, NodeJS and Socket.io : The Unwritten Words

  33. Josh

    I am getting errors on uglify not being able to be installed when I am installing the packages with npm install

    Reply
  34. Sadie

    I enjoy what you guys tend to be up too. This type of clever
    work and coverage! Keep up the wonderful works guys I’ve included
    you guys to blogroll.

    Reply
  35. acemoebius

    Hi great jobs !

    So, i’ve got a problem at the step npm start. See my error:
    npm start

    > GoogleTV-rPi@0.0.1 start /home/pi/app
    > node app.js

    module.js:340
    throw err;
    ^
    Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object. (/home/pi/app/app.js:5:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    npm ERR! GoogleTV-rPi@0.0.1 start: `node app.js`
    npm ERR! `sh "-c" "node app.js"` failed with 8
    npm ERR!
    npm ERR! Failed at the GoogleTV-rPi@0.0.1 start script.
    npm ERR! This is most likely a problem with the GoogleTV-rPi package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! node app.js
    npm ERR! You can get their info via:
    npm ERR! npm owner ls GoogleTV-rPi
    npm ERR! There is likely additional logging output above.

    npm ERR! System Linux 3.6.11+
    npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "start"
    npm ERR! cwd /home/pi/app
    npm ERR! node -v v0.10.2
    npm ERR! npm -v 1.2.15
    npm ERR! code ELIFECYCLE
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR! /home/pi/app/npm-debug.log
    npm ERR! not ok code 0

    So what's going wrong ?

    thanks

    Reply
  36. Pingback: Fabriquez votre propre clone de Google TV avec un Raspberry Pi | Sergio's blog

  37. TheSkyHighPolishGuy

    As soon as I read the headline I knew I was going to fork it! :P

    I might even think about writing a few Python apps for RasPiTV…

    Reply
  38. TheSkyHighPolishGuy

    I’m wondering if XBMC could be turned into an app that could be run inside RasPiTV, along with being controlled by the phone remote.

    Reply
  39. Tim

    Is there a download of the img or iso would like google tv on my pi instead of the crap xbmc font-end and the crap back-end that keeps breaking :/

    Reply
  40. iherb coupons www.youtube.com

    hello there and thank you for your information – I’ve certainly picked up anything new from right here.
    I did however expertise a few technical points using
    this site, as I experienced to reload the website a lot of times previous to I could get it to load correctly.
    I had been wondering if your web hosting is OK?
    Not that I am complaining, but sluggish loading
    instances times will sometimes affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords.

    Anyway I am adding this RSS to my e-mail and can look out for much more of your
    respective exciting content. Ensure that you update this again very soon.

    Reply
  41. dynamite media

    have you thought about adding livestreamer support?

    https://github.com/chrippa/livestreamer

    it should work exact same way as youtube-dl

    if you send the url from address bar, which i am assuming is same with youtube-dl it will play all the sites like ustream, justin.tv, veetle, filmon, youtube live, daily motion

    it will play youtube videos like this :
    livestreamer youtube.com/watch?v=oFIIPn0xO9U best -np ‘xterm – fullscreen -fg black -bg black -e omxplayer -o hdmi’

    filmon.com channel :
    livestreamer filmon.com/tv/wgn-91-chicago high -np ‘xterm – fullscreen -fg black -bg black -e omxplayer -o hdmi’

    Justin Tv:
    livestreamer justin.tv/arconai236 best -np ‘xterm – fullscreen -fg black -bg black -e omxplayer -o hdmi’

    so it is possible to use in conjunction or replace youtube-dl only tested on youtube not sure of all youtube-dl sites…but adds a LOT of live streaming sites that i know i enjoy expecially veetle and filmon for HQ streams

    Reply
  42. coolhandluke

    Sweet!
    After reading your post, I went ahead and setup omxplayer on my pi, I wasn’t really sure if I could play hidef stuff on it. But boy was I wrong!

    Now I mount my movie collection with nfs and play them via ssh. But your node app is the next thing when I find time.

    And yes socket.io is just awesome :D

    Reply
  43. Kairos

    Hi.
    I get the following error after execute : node app.js

    events.js:72
    throw er; // Unhandled ‘error’ event
    ^
    Error: listen EADDRINUSE
    at errnoException (net.js:878:11)
    at Server._listen2 (net.js:1016:14)
    at listen (net.js:1038:10)
    at Server.listen (net.js:1104:5)
    at Object. (/home/pi/app/app.js:23:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>