Back to Top

Preparing the Pi to handle the weather updates.

Date and time

Set the correct timezone
sudo dpkg-reconfigure tzdata
Set it to your local timezone

To synchronize the clock:
 sudo apt-get -y install ntp ntpdate

In config.txt make sure the i2ci is set to on and add the line “dtoverlay=w1-gpio” at the end of the file.


Reboot the Pi to make sure the modules are loading correct;

Check the I2C loading with:

sudo lsmod | grep i2c_
 i2c_bcm2708           4834  0
 i2c_dev               5859  0
Web and script folders
 mkdir -p /home/pi/project/WeatherStation
 sudo mkdir -p /var/www/WeatherStation
 sudo chown pi:1000 /var/www/WeatherStation -R

Download the scripts and webfiles

To make life it bit more simple download the file.
 cd /home/pi
 sudo apt-get install mc

Copy (F5) the files from WeerStation\scripts to “/home/pi/project/WeatherStation”
Copy the files from WeerStation\web to “/var/www/WeatherStation”

Now we will change the default directory for Nginx to /var/www/WeatherStation

cd /etc/nginx
 sudo nano sites-enabled/default

Find the line “root /var/www/html;”
Change it to

#root /var/www/html;
 root /var/www/WeatherStation;
Close the file and reload nginx configuration; 
 sudo /etc/init.d/nginx reload

Reload the page in your browser and you will see the WeatherStation information.
Later we will see how the personalize the webpage.

DHT11/DHT22 humidity and temparture sensor at the Raspberry Pi B+ with Rasbian Jessie

sudo apt-get install git build-essential python-dev python-smbus
 cd /home/pi/project/WeatherStation
 git clone
 cd Adafruit\_Python\_DHT && sudo python install

To make the graphs we will use rrdtool, so lets install this as well;

sudo apt-get install rrdtool

At this moment, we did all the preparations and now we can continue with connecting the sensors and test them.