Benutzer-Werkzeuge

Webseiten-Werkzeuge


home_automation_projects

Home automation projects

PiHome installation

WebIOPi is developed and tested on Raspbian. You only need Python, either 2.7 or 3.2. Download, then extract and install WebIOPi. The setup script will automatically download and install required dependencies using apt-get. You may have to manually install GCC and Python development headers if you are not using Raspbian.

Update note: Stop your existing WebIOPi service, then process with the setup. Your configuration will be kept but others files will be override.

See downloads page to get latest package, and adapt x.y.z with the version you download.

$ tar xvzf WebIOPi-x.y.z.tar.gz
$ cd WebIOPi-x.y.z
$ sudo ./setup.sh

Setup may take a moment. Running WebIOPi

Finally, use webiopi command :

$ sudo webiopi [-h] [-c config] [-l log] [-s script] [-d] [port]

    Options:
      -h, --help           Display this help
      -c, --config  file   Load config from file
      -l, --log     file   Log to file
      -s, --script  file   Load script from file
      -d, --debug          Enable DEBUG

    Arguments:
      port                 Port to bind the HTTP Server

For instance, to start with verbose output and the default config file :

$ sudo webiopi -d -c /etc/webiopi/config

You're done, and ready to enjoy WebIOPi ! But the server and GPIO state will be lost when you'll stop the script (CTRL-C) or close the terminal. Running WebIOPi (Daemon)

You can also start/stop the background service, the configuration will be loaded from /etc/webiopi/config.

$ sudo /etc/init.d/webiopi start

$ sudo /etc/init.d/webiopi stop

Auto start at boot

To setup your system to start webiopi at boot :

$ sudo update-rc.d webiopi defaults

To remove webiopi start from boot :

$ sudo update-rc.d webiopi remove

Access WebIOPi over local network

If your Raspberry Pi is connected to your network, you can open a browser to http://raspberrypi:8000/ with any device of your network. Replace raspberrypi by its IP.

Default user is „webiopi“ and password is „raspberry“

By choosing the GPIO Header link on the main page, you will be able to control GPIO using a web UI which looks like the board header.

  Click/Tap the OUT/IN button to change GPIO direction.
  Click/Tap pins to change the GPIO output state. 

Access WebIOPi over Internet

Thanks to Weaved IoT Kit, it's easy to access your Raspberry from anywhere in a secure fashion. Register on the Weaved developper portal

Go to https://developer.weaved.com/portal/ and follow instruction to create an account. Download Weaved for Raspberry Pi

Copy and paste the command line below into a terminal window or SSH client connected to your Raspberry Pi, then hit the Enter key.

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

Install Weaved

Make the installer executable:

chmod +x weaved-nixinstaller_1.2.5.bin

Launch the installer:

./weaved-nixinstaller_1.2.5.bin

Enter the e-mail address and password for your Weaved account.

When asked, choose WebIOPi during the install process. then enter an alias, or nickname for your device.

Note: If you run the installation more than once, you'll get this question.

Support of multiple services is not fully tested in 1.2.5. We recommend that you answer 'y' here to remove the previous installation before proceeding. Test your setup

To test the connection to your Raspberry Pi from your browser, go to the device list, find the line with your Raspberry Pi's alias, and click on “Connect”. Your device's internet address will be shown in the area blurred below.

Change PWD or remove protection

Change Password

The WebIOPi server uses an encrypted file that contains both login and password. To generate this file, simply run the webiopi-passwd command with sudo and follow instructions :

$ sudo webiopi-passwd
WebIOPi passwd file generator
Enter Login: webiopi
Enter Password: 
Confirm password: 

Hash: e70c940a189251e9cd4515b3a1a6c6f02aa05c744a456ce360fe14bf2c5c0353
Saved to /etc/webiopi/passwd

Then restart the default server :

$ sudo /etc/init.d/webiopi restart

Remove Protection

To remove login/password protection, you can ever remove /etc/webiopi/passwd or empty it, then restart the webiopi server. webiopi-passwd syntax

$ webiopi-passwd -h
WebIOPi passwd file generator
Usage: webiopi-passwd [--help|file]
Compute and display hash used by WebIOPi for Authentication
Login and Password are prompted
        --help  Display this help
        -h
        file    Save hash to file

By default, the hash is saved in /etc/webiopi/passwd. Specifying a file allows to save the hash in another file, to use it with custom servers.

Framework

home_automation_projects.txt · Zuletzt geändert: von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki