Reader small image

You're reading from  BeagleBone Home Automation Blueprints

Product typeBook
Published inFeb 2016
Publisher
ISBN-139781783986026
Edition1st Edition
Right arrow
Author (1)
Rodolfo Giometti
Rodolfo Giometti
author image
Rodolfo Giometti

Rodolfo Giometti is an engineer, IT specialist, GNU/Linux expert and software libre evangelist. He is the author of the books BeagleBone Essentials, BeagleBone Home Automation Blueprints and GNU/Linux Rapid Embedded Programming by Packt Publishing and maintainer of the LinuxPPS projects. He still actively contributes to the Linux source code with several patches and new device drivers for industrial applications devices. During his 20+ years of experience, he has worked on the x86, ARM, MIPS, and PowerPC-based platforms. Now, he is the co-chief at HCE Engineering S.r.l., where he designs new hardware and software systems for the quick prototyping in industry environment, control automation, and remote monitoring.
Read more about Rodolfo Giometti

Right arrow

Chapter 4. Google Docs Weather Station

In this chapter, we're going to take a look at a simple weather station that can also be used as an IoT device. This time, our BeagleBone Black will collect environment data and send them to a remote database in order to be reworked and presented into a shared environment.

Both local and remote data will be available in our preferred browser since, as it's a local system, we're going to use the wfrog tool, and as remote system, we're going to use a Google Docs spreadsheet.

The basics of functioning


In this project, our BeagleBone Black will collect the weather data through two sensors. But this time, instead of writing a dedicated software, we are going to use ready-made weather station software on our BeagleBone Black board to do the job. While on the remote side, we're going to use the well known Google Docs cloud system to store the data and then present them to the user.

In this manner, we can achieve a (quasi) professional result with minor effort!

In this scenario, our job is to connect the sensors, adapt the weather station software to our hardware in order to read the data from the sensors, and then add the proper code to send our data to a Google Docs spreadsheet.

Setting up the hardware


This time, the hardware setting is not very tricky since we just need two I2C chips to get the basic environment data for our weather station, while all the complexity is in the software settings, since we need at least a 3.13 kernel to manage the sensors and a complete software toolchain to talk with the Google Docs system!

Maybe this is not the case with you, but my BeagleBone Black runs a kernel version 3.8 where some drivers are missing. That's why I decided to install a new distribution based on kernel release 3.13 on an external microSD so that I do not have to modify the default on-board eMMC settings.

In any case, just to set up the hardware, I can use the current running kernel where I can enable the I2C bus named I2C1 with the following command:

root@beaglebone:~# echo BB-I2C1 > /sys/devices/bone_capemgr.9/slots

If everything works well, you should see the following kernel activities on your board:

part_number 'BB-I2C1', version 'N/A'
slot #7: generic override...

Setting up the software


Now, it's time to play hard! We have to install a new kernel with specific patches in order to add the needed drivers. Then, we must set up our Google account in order enable the Google Docs API to manage a spreadsheet on the cloud. And, in the end, we must install and properly configure the weather station software we chose to collect the weather data.

Installing a new kernel

To install a new kernel, we must use a host PC where we use the following command to download the sources:

$ git clone git://github.com/RobertCNelson/bb-kernel.git

When finished, we must enter the bb-kernel directory and then check out the kernel, version 3.13:

$ git checkout am33x-v3.13

Now we should configure the compilation suite by generating a proper configuration file named system.sh, starting from the sample file as follows:

$ cp system.sh.sample system.sh

On my system, I modified the newly created system.sh file with the following settings:

CC=/usr/bin/arm-linux-gnueabihf-
MMC=/dev/sdd

The...

Final test


This time, the final test needs more time than other projects since we must collect several data to get suitable graphics. So, we execute the wfrog tasks as shown in the preceding screenshot. Then, we leave them running for two days or more. For my test, the results are shown in the following two screenshots:

Then, we can verify that the preceding weather data has also been stored in the Google Docs spreadsheet by taking a look at our Google account. The following screenshot shows my test results:

Summary


In this chapter, we discovered how to install a ready-to-use weather station software into our BeagleBone Black by adapting it to our hardware sensors and by installing a new kernel release with proper drivers. Then, we took a look at how to store data in a Google Docs spreadsheet for future processing.

In the next chapter, we'll continue to interact with a remote system in order to manage a laundry monitoring system. We're going to use the WhatsApp system to know when our washing machine has finished its duty.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
BeagleBone Home Automation Blueprints
Published in: Feb 2016Publisher: ISBN-13: 9781783986026
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 €14.99/month. Cancel anytime

Author (1)

author image
Rodolfo Giometti

Rodolfo Giometti is an engineer, IT specialist, GNU/Linux expert and software libre evangelist. He is the author of the books BeagleBone Essentials, BeagleBone Home Automation Blueprints and GNU/Linux Rapid Embedded Programming by Packt Publishing and maintainer of the LinuxPPS projects. He still actively contributes to the Linux source code with several patches and new device drivers for industrial applications devices. During his 20+ years of experience, he has worked on the x86, ARM, MIPS, and PowerPC-based platforms. Now, he is the co-chief at HCE Engineering S.r.l., where he designs new hardware and software systems for the quick prototyping in industry environment, control automation, and remote monitoring.
Read more about Rodolfo Giometti