Server install

This page looks quite big for a quick install guide. But this guide covers the complete installation for your Raspberry Pi. If you already have a Raspberry Pi Up and running you can scroll down untill Install libraries the server uses

We try to include as much dependencies as possible with the server. But some dependencies have to be done manually. This page will guide you through the installation and get the PiDome server up and running. When all goes fine it will be done in a couple of minutes from the moment of having raspbian installed. This install guide makes use of the NOOBS version of the raspbian OS for the raspberry pi. If you choose to download the raw image, i assume you have it done more often, or you are a more advanced user, so i won’t explain that install. The NOOB version requires an attached display, keyboard and/or mouse. Mouse would be handy otherwise you should use the “TAB” key on you’re keyboard to switch to other options. If you already have set up your raspberry pi with, very important, the hard float version of rasbian. Skip to “Update your raspberry pi to latest version” section.

Installation

Get your raspberry pi up and running

Formatting

I Suggest to use the sd card formatter which is mentioned to use at the raspberry pi download page (SDFormatter), and format your SD card. If in windows your SD card is displayed at the wrong size. Go to the tool’s options and set “FORMAT SIZE ADJUSTMENT” to “ON”. To really “destroy” the current data on the SD card, choose for “FORMAT TYPE” -> “FULL ERASE”.

Install Rasbian

Download and install the NOOB network version from the raspberry pi download site. Unzip the contents of the downloaded file, and copy the files in the created folder to your SD card. Put the card in the pi and boot the thingy up. Quite quickly you will get an option screen with what to install. Check the raspbian Wheezy (or Jessie when available) option. Press install. The partition will be created and the raspbian OS will be installed. take a cup of coffee, because it is a network install. Press ok when done and your pi will reboot.

Setting up

After the reboot, your pi will boot into the raspi-config tool. Here you can set some configuration options for your pi. If your pi is already setup you can skip this. The only suggestion, all though not required, is change the boot option to boot to console.

with NOOB your partiotion size is already at max, so you can skip this. The default credentials to login are user “pi” and password “raspberry”. You can change the default password. When choosing your internationalization options -> locale, you can choose anything you want, but you minimal need to have the EN_US.UTF-8 selected. Because there is no internationalization in the server. Your timezone can just be yours. Advanced options – Memory split: There are no 3D graphics and sort of, the default 64MB should be enough for the GPU. If you have chosen not to use the Desktop boot, you can choose 32MB or 16MB to give more memory to the OS instead of the GPU. I personally use 16MB. Finish and reboot.

Update your raspberry pi to latest version.

Login to your pi and type/copy paste the following to go to the latest version

sudo apt-get update && sudo apt-get upgrade

After update is done, reboot and you should be done.

Prepare

Now your raspberry pi has restarted. It’s time to make some preparations, download and install the server.

Preparation

General GPIO

Before the server can be run, there are some user rights missing for the user pi and some libraries not loaded by default. The server can run under the user pi, i even recommend it. If you do not want to alter the users pi’s user rights, you can run the server as root. But i won’t explain how. Because the server uses the I²C Bus and also uses the rx/tx gpio pins, some alterations have to be made to user pi. If you already has this altered, you can skip this part.

Remark: It seems that when using the GPIO pins when Debian Jessie is installed you do not need to become root

Prepare RX/TX GPIO pins

By default on the GPIO RX/TX pins of the raspberry pi, a serial console is available. So, we are going to disable this so the server can use these pins as common COM ports (But running on 3.3 volts and not 12 as default for COM ports!). I suggest to follow the instructions mentioned at http://elinux.org/RPi_Serial_Connection. I believe this is the most up to date version to alter the use of the RX/TX pins. After the modification do not reboot yet, go on.

Prepare the use of the I²C Bus

Please follow the instructions at: http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/

Access rights for i2c for user pi

When you have installed i2c-tools as described earlier run the next command as user pi if you have a rev 2 raspberry (if you have an earlier version replace the 1 with 0):

pi@raspberrypi ~ $ i2cdetect -y 1

if you got a response that looks like this:

pi@pidome-server ~/pidome-server/dist $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

User pi has the correct access rights. If not run the following command:

sudo usermod -a -G i2c pi

Reboot your raspberry, user “pi” can now issue i2cdetect and other i2c commands.

Access rights for using the GPIO RX/TX pins

With command “id” you can check if the user has the group dialout. If not run the following command:

sudo usermod -a -G dialout pi

Now all rights and modifications are done, Reboot your pi for the last time.

Install libraries the server uses

The server uses libudev to monitor real time usb attachements and traversing attached usb devices at startup. So you need to install libudev-dev The nice way to install this tool is to install a package. Run the following command to install this tool:

sudo apt-get install libudev-dev

This is the only dependency you need to install. If you are not planning on using usb, no extra libraries/tools are needed to run the server and you can leave this package uninstalled. The server detects this automatically.

download and install the PiDome Server

Use this download link to download the server and unzip all the files copy the server to to pi with for example winscp.

After download:

If you are planning on using the init script so the server will start and stop automatically follow the steps Install init script at the bottom of this page.

Create a directory on the Raspberry Pi called "/opt/pidome/pidome-server" and copy the extracted files into this directory. Login into your Raspberry Pi from a shell and go to directory pidome-server with “cd /opt/pidome/pidome-server”. There is a shell script which sets variables and starts the server, but needs rights to be executed. run “chmod 755 server.sh”. You are done. The server is installed, and ready to be run for the first time. You can now continue to Server Management on how to start/stop and maintain the server. If you are planning on using an init script the server is started and stopped in a different way, refer to below.

If you are not planning on reading the Server Management page your initial login is username: “admin” with password “admin”. You will see a notification that you will have to change the password. Make sure you connect from an internal network connection. The admin user can not connect from outside an internal network!

Install init script

Before you can install the init script you MUST be 100% sure that the server is copied/installed in the directory /opt/pidome/pidome-server. The reason for this is that the server is not yet being distributed in an installation package which can do all the magic automatically for you. So for now the paths are hard coded.

In the directory /opt/pidome/pidome-server is a file present called pidome-server. This is the init script. To install it follow the next steps (by copy paste them in your console, or type manually):

chmod 755 pidome-server
sudo cp pidome-server /etc/init.d/pidome-server
sudo update-rc.d pidome-server defaults

That’s it, the server now stops when starting to reboot or shutting down, and starts when the pi boots.

You can also start and stop the server manually by executing: “sudo service pidome-server start” to start and “sudo service pidome-server stop” to stop. There are also a “restart” to restart and “status” to see if the server is running options.

To remove the auto boot option run “sudo update-rc.d pidome-server remove”

Latest news/blog

Friends of PiDome

Atlassian
Products for teams, from startup to enterprise
RFXCOM
Affordable 433Mhz RF transceivers
UniPi.technology
Home-automation hardware manufacturer

Latest added technology

  • SMS
  • Z-Wave
  • PushBullet
  • PlugWise
  • MQTT

Some project stats

Open Hub project report for PiDome Platform

Other

Official NLJUG Member