Chapter 6. Internet of Things

6.0 Introduction

You can easily connect BeagleBone Black to the Internet via a wire (Recipe 5.11), wirelessly (Recipe 5.12), or through the USB to a host and then to the Internet (Recipe 5.13). Either way, it opens up a world of possibilities for the “Internet of Things” (IoT).

Now that you’re online, this chapter offers various things to do with your connection.

6.1 Accessing Your Host Computer’s Files on the Bone

Problem

You want to access a file on a Linux host computer that’s attached to the Bone.

Solution

If you are running Linux on a host computer attached to BeagleBone Black, it’s not hard to mount the Bone’s files on the host or the host’s files on the Bone by using sshfs. Suppose that you want to access files on the host from the Bone. First, install sshfs:

bone# apt-get install sshfs

Now, mount the files to an empty directory (substitute your username on the host computer for username and the IP address of the host for 192.168.7.1):

bone# mkdir host
bone# sshfs username@$192.168.7.1:. host
bone# cd host
bone# ls

The ls command will now list the files in your home directory on your host computer. You can edit them as if they were local to the Bone. You can access all the files by substituting :/ for the :. following the IP address.

You can go the other way, too. Suppose that you are on your Linux host computer and want to access files on your Bone. Install sshfs:

host$ sudo apt-get install sshfs

and then access: ...

Get BeagleBone Cookbook 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.