Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Forked from Documentation / docs.beagleboard.io
1522 commits behind the upstream repository.
iot.rst 33.69 KiB

Internet of Things

You can easily connect BeagleBone Black to the Internet via a wire (:ref:`networking_wired`), wirelessly (:ref:`networking_wireless`), or through the USB to a host and then to the Internet (:ref:`networking_usb`). 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.

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$ sudo apt 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 install sshfs

and then access:

host$ mkdir /mnt/bone
host$ sshfs debian@$192.168.7.2:/ /mnt/bone
host$ cd /mnt/bone
host$ ls

Here, we are accessing the files on the Bone as debian. We’ve mounted the entire file system, starting with /, so you can access any file. Of course, with great power comes great responsibility, so be careful.