Turning on/off the lamp from a smartphone

Our home automation project is nearly finished, but one important thing remains: we need to ensure that it's possible to control the light using a remote device, such as a smartphone. First of all, we need to check on the board whether the web server is present:

$ ps | grep server
295 root 2732 server.init

If the server for some reason hasn't auto-started, we can try to manually start it using this command:

$ /etc/init.d/server-packt-init start
starting Nodejs app: server.init... done.
root@raspberrypi2:~#    info  - socket.io started
listening on *:3344

If we manually perform some changes to the web server directly on the Raspberry Pi, we can restart the web server by using this command:

$ /etc/init.d/packt-server ...

Get Yocto for Raspberry Pi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.