Reader small image

You're reading from  Home Automation with Intel Galileo

Product typeBook
Published inMar 2015
Publisher
ISBN-139781785285776
Edition1st Edition
Tools
Right arrow
Author (1)
Onur Dundar
Onur Dundar
author image
Onur Dundar

Onur Dundar is a software engineer who graduated from the Computer Engineering Department of Boazii University. He started working on embedded systems while he was at the university, and in his senior year project, he worked with wireless sensor networks for security and health monitoring. Onur started his career at JPMorgan Chase & Co. Then, he worked at Intel Corporation for 4 years as a software application engineer. He has specialized in embedded Linux and mostly worked on IPTV platforms, Android, as well as IoT platforms, such as Intel Galileo and Edison, and has developed applications for them. He has also helped software developers enhance their applications on these platforms. He has attended many conferences and developer events to introduce Intel Galileo and Edison. He developed the first application and wrote the public collaterals of Intel Edison when he worked at Intel Corporation. Onur is continuing his career at Invent Analytics, implementing algorithms for data analytics.
Read more about Onur Dundar

Right arrow

Chapter 7. Building Applications and Customizing Linux for Home Automation

In the previous chapters, you learned how to develop applications that work on Intel Galileo. You learned how to deploy applications to Intel Galileo with the help of Eclipse IDE or by using the SCP command-line tool to transfer application binary files. During the course of this chapter, we will work on how we can make our application or applications start at boot time and run as a background process or service on Intel Galileo Yocto Linux operating system.

While we arrived around the end of the development process, we would like to run our application in Intel Galileo when the board boots up with no user command to start it. We want the Smart Home application to run automatically because managing a home from just a command line terminal interface is not so user friendly. Therefore, for this, we will also need to define some features for the Smart Home application to send commands to and receive data from.

Let's start...

Customizing Linux with the Yocto Project


Customizing Linux means changing the default system configurations and adding or removing applications and kernel modules to the default Linux build for Intel Galileo. While following the steps described in the Chapter 1, Getting Started with Intel Galileo, we didn't make any changes, and so we only built the default full image defined for Intel Galileo.

In the previous chapters, we briefly mentioned adding the OpenCV library and added the cp210x kernel module to our default Linux image. The OpenCV library is an open source package and it was already delivered with the Intel Galileo board support package. In this section, we will make the required configurations and changes to build a structure to add our own application to the Linux image.

Adding a new application to Yocto Project

To add a new application, we need to add a Yocto Project recipe to the Intel Galileo Yocto Project. If you have developed a whole software stack with a number of applications...

Adding new features to the application


We have gone through the steps to add an application to the Linux image running on Intel Galileo. If you have a service process running in the background, you should work out the ways in which you communicate with the process, to send commands to the application.

There are many methodologies that you can apply or implement for your application to receive commands and send outputs to the requested client. We will investigate two methodologies to send and receive messages to and from the application. We will use named pipes and network sockets. Named pipes help you deliver messages locally to the home automation service. Network sockets give you the ability to deliver messages through the network connection.

Using named pipes

A named pipe is usually used to create an inter-process communication structure between processes. The idea is to create a special Linux device file to read and write data and bytes to the named file. Named pipes use the first in first...

Summary


In this chapter, we reviewed how we can customize the Intel Galileo Yocto Linux image by adding the home automation application. We also reviewed how we created the required files to build the application with the Yocto Project build system and install the application into the system image.

Then, we looked into the details of implementing methods to communicate with our application in Intel Galileo. We reviewed the named pipes for inter-process communication on Intel Galileo. Then we had a brief on network sockets and sample code to receive commands from defined network sockets.

In the last chapter, you try to connect to your home automation application with other platforms to manage the home automation application with remote applications. In order to do that, we will introduce you to Node.js for a basic web server to serve files from Intel Galileo and a basic web interface for remote users. Then you will follow up with a simple Android application to manage Intel Galileo applications...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Home Automation with Intel Galileo
Published in: Mar 2015Publisher: ISBN-13: 9781785285776
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Onur Dundar

Onur Dundar is a software engineer who graduated from the Computer Engineering Department of Boazii University. He started working on embedded systems while he was at the university, and in his senior year project, he worked with wireless sensor networks for security and health monitoring. Onur started his career at JPMorgan Chase & Co. Then, he worked at Intel Corporation for 4 years as a software application engineer. He has specialized in embedded Linux and mostly worked on IPTV platforms, Android, as well as IoT platforms, such as Intel Galileo and Edison, and has developed applications for them. He has also helped software developers enhance their applications on these platforms. He has attended many conferences and developer events to introduce Intel Galileo and Edison. He developed the first application and wrote the public collaterals of Intel Edison when he worked at Intel Corporation. Onur is continuing his career at Invent Analytics, implementing algorithms for data analytics.
Read more about Onur Dundar