Raspberry Pi – Developing with piJS

Some use their Raspberry Pi for a media center, other electronics for. Today you will be able to develop in Javascript from your browser with piJS.

If you dream of controlling the GPIO port from your browser then you are in the right place. And in addition it is easy to do !

  1. To be able to back up your files to reuse elsewhere, You must create an account at pijs.io
  2. If your distribution does not have user “pi” (as on Moebius for example), you need to add a.
  3. As any Cloud service, It takes a client to synchronize your files :
    curl http://pijs.io/install-pijs.sh |bash

    It will also install the NodeJS libraries so that your system is ready.

  4. If you have an error in execution :
    1._sshThe problem of the rights on the log directory. You can correct the error :

    chmod 777 /var/log/pijs.

    Then restart pi-steroid

  5. You can now go to your account pijs.IO and click on “Add new device”. In the popup window you will find your Raspberry who managed to connect to their server. You then your ready to encode remote Raspberry Pi :
  6. Now click “Edit Code” and you can start to send your instructions to your machine. The classic : Hello World !
    In your browser :
    PI_JSIf you look now on your Raspberry Pi, You'll see the same thing in the console :

OK everything is good but and now ? Well you can do all that node.js can do. You can control the GPIO ports, the serial port, etc.

You have examples here : http://pijs.io/learn/. Send SMS, control a LED, install packages NPM, etc.

Je pense me servir de cette solution lorsque mes sondes de température seront opérationnelles 😉

Sources : http://www.tbideas.com/blog/2013/04/NodeJS-Raspberry-Pi-The-easy-way/

You may also like...