Setup Weaved and the Raspberry Pi

by dexter_industries in Circuits > Raspberry Pi

30428 Views, 53 Favorites, 0 Comments

Setup Weaved and the Raspberry Pi

Weaved_Pi_LOGO copy.png
Weaved IoT Kit for Raspberry Pi

If you’ve ever tried to setup your Raspberry Pi as an Internet of Things device, you’ll know that unless you jump through some massive hoops, you’re stuck serving web pages and data on your local network. Getting information from your Pi on your phone, or while you’re at work or school . . . it’s nearly impossible.

There are a lot of ways to work your way out to the internet. They’re often painful . . . ISP’s block ports, you need to setup port forwarding, you might violate your terms of sevice with your ISP, and you might need to customize your router.

Weaved solves all of these problems.

The easiest way we’ve seen to open up your Raspberry Pi as an Internet of Things device is to use the service Weaved. Weaved provides an IoT (Internet of Things) Kit for the Raspberry Pi. The kit provides really simple tools for connecting your Pi to the cloud, receiving notifications, and turning your Pi into an Internet of Things Kit.

They offer a few services that let you connect from a distance:

  • SSH - You can login to your Pi from anywhere over SSH.
  • Web (http) on port 80 - You can view a web page your Raspberry Pi serves up from anywhere.
  • WebIOPI - Control your Raspberry Pi GPIO pins using their custom software.
  • iOS and Android App - They have a beautiful app you can use with your iPhone or your Android (soon!). Receive push notifications!

Connecting your Raspberry Pi to the internet is super-easy with Weaved!

Get a Free Account.

Weaved_Pi_LOGO copy.png

You can get a free account at Weaved on their website. At the time of our writing, the service is in Beta and everything is free. Just setup a developer account, it takes about 30 seconds.

Fire Up Your Raspberry Pi and Connect to the Internet.

pi.jpg

Fire up your Raspberry Pi!

You will need to connect your Pi to the internet. We assume you've already figured out how to do this.

Download the Weaved Software to Your Pi.

1 - Weaved Install.JPG

In the command line on your Raspbery PI, type the following command:

wget https://github.com/weaved/installer/raw/master/binaries/weaved-nixinstaller_1.2.8.bin

Make the Weaved Software Executable.

2 - Installing Weaved on the Raspberry Pi.JPG

We will make the installation file downloaded in Step 3 executable:

Again, in the command line:

chmod +x weaved-nixinstaller_1.2.8.bin

Launch the Installer.

In the command line, type:

./weaved-nixinstaller_1.2.8.bin

The software will run a few tests, and boom: first question . . . .

Choose a Service.

2 - Installing Weaved on the Raspberry Pi.JPG

When you first start, you’ll be asked to install one of the Weaved services: SSH on port 22, Web (http) on port 80, WebIOPi on port 8000, VNC on port 5091 (tested with tightvncserver), or A custom TCP service on your port of choice.

In this example, we'll choose the second option, http on port 80.

Enter Your Weaved Login Information.

5 - Succsefuly Installing Weaved on the Raspberry Pi.JPG
3 - Installing Weaved on the Raspberry Pi.JPG
4 - Succsefuly Installing Weaved on the Raspberry Pi.JPG

Enter in the information we setup in Step 1

Be sure: not your Raspberry Pi login information, but the information for your weaved account (which you setup in Step 1!).

You’ll be prompted for a device name. Name your pi wisely . . .

For this experiment, we chose “weaved_tutorial_4_pi” . . . and success!

Test It: Install a Webserver.

apache-it-works.png

Everything for weaved should be setup properly at this point. We'll test it out by setting up a server on the Raspberry Pi to serve up web pages.

We won’t go into depth on how to do this. The Raspberry Pi foundation has a great tutorial for installing an Apache server on your Pi.

You can install Apache in two quick command line commands:

sudo apt-get update

sudo apt-get install apache2 -y

Now, Let’s Check That the New Device Is Online.

6 - weaved running devices.JPG

Go to the Weaved developer console here. You may be required to login.

We can see that the device we just setup is usable and can be connected to!

Check Out Your Website.

7 - weaved running devices running apache.JPG

In the weaved developer console, click “Connect” and a new window will be opened up.

It works! If we type in the address you see after https:// in the browser below, you can see it in your mobile phone, or from anywhere on the internet!

Bonus! Modify Your Web Page

Did you know you can rewrite the web page? If you know html, simply type into the command line:

cd /var/www/

sudo nano index.html

Simply edit the text in the html file, save it, and you’re on your way to serving up web pages on the Pi!