Setting up Weewx on Raspberry Pi
=====Readying the Raspberry PI 2=====
Download and Install Rapbian.
1. Download the latest version of Raspbian from [[http://www.raspberrypi.org/downloads/|here]]__ (__[[https://wand/|https://w]]__ww.raspberrypi.org/downloads/)__ You can download it directly or via the torrents. Extract the img file from the zip.
2. Write Raspbian to a FAT32 formatted microSDHC card. Go to the download directory and run the following command to install the boot and system files onto the SD card: This command assumes that you know the right file name and the location of the SD card on your system (use //**blkid**// to findout if neeeded)
//**udo dd bs=4M if=2015-09-24-raspbian-jessie.img of=/dev/sdc**//
----
3. Cleanly remove SD card from desktop and insert into Raspberry. Connect network cable and power up.
4. Assuming you will leave the Raspberry headless, log into the raspberry. If you don't know what the IP address will be, you can go to the network server/router or run //**nmap -sn 192.168.1.0/24. **//After a minute or so it should respond with a list of active Ips. The raspberry pi should be in the list like this: //Nmap scan report for raspberrypi (192.168.1.8)//. At the terminal type "ssh -l pi 192.168.1.8" and log in. The IP address in the command should be the one echoed from the nmap command for your network. The password at this point is "raspberry".
5. At the raspberry pi prompt enter: sudo raspbi-config. Do at least three things.
a. Expand FileSystem (reboot after this)
b. Change User Password
c. Update operating system from adfvanced commands.
d. Change Hostname.
6. Once you are on the desktop, open a terminal and enter the following command to update the firmware of the Pi.
//**sudo rpi-update**//
----
//**sudo shutdown -r now**//
----
7. Install and configure nginx.
sudo apt-get install nginx
sudo mkdir /Work
sudo mkdir /www
8. Iinstall PHP5.
sudo apt-get install php5 php5-fpm php-apc
----
----
9. Install cats and dogs. Installing
sudo apt-get install ufw phpmyadmin
//**sudo shutdown -r now**//
----
ssh-keygen -f "/home/jerry/.ssh/known_hosts" -R
sudo passwd root
sudo apt-get install ufw
sudo apt-get install ntp
sudo sudo apt-get remove libreoffice
sudo dpkg-reconfigure tzdata
sudo apt-get install mysql-server mysql-client
php5-mysql phpmyadmin
It probably means that your MySQL server is only listening the localhost interface.
If you have lines like this :
skip-networking
bind-address = 127.0.0.1
In your my.cnf configuration file, you should comment them //(add a # at the beginning of the lines)//, and restart MySQL.
mysqldump --host 192.168.1.76 -P 3306 -u jerry -p weewx > mydb.sql
mysqldump --host 192.168.1.76 -P 3306 -u jerry -p weewx > mydb.sql
GRANT ALL on weewx.* to 'pi'@'%' identified by 'Fidos64!'
jerry@Gertie006 /Storage/Weewx/Berry02_111615 $ ssh pi@Berry02 "sudo tar czpf - /" | tar xzpf - -C .
pi@berry02's password:
Create a root cronjob to do daily weewx backups to hostpapa web pages(weewx.tgz):
Login as root user (su – root) and do crontab -e as shown below.
root@dev-db# crontab -e
# m h dom mon dow command
#
0 2 * * * tar -czpf /Work/www/weewx/weewx.tgz /etc/weewx /Work/www/weewx /var/lib/mysql/weewx /var/lib/mysql/ibdata1 /etc/nginx/sites-available --exclude=/Work/www/weewx/weewx.tgz