Te recordamos que esta Wiki está abierta a que, todos los usuarios, puedan editar artículos
Para ello debes estar registrado como usuario de Codex-Meteoclimatic
Solo tienes que enviar un email a meteoclimatic@meteoclimatic.com
indicando el nombre de usuario que quieres usar
Para ello debes estar registrado como usuario de Codex-Meteoclimatic
indicando el nombre de usuario que quieres usar
Diferencia entre revisiones de «Instalación de Wview»
(→Método corto o sin compilación) |
(→Pasos finales) |
||
Línea 479: | Línea 479: | ||
− | Y añadimos dos lineas....las que están en negrita: | + | '''Y añadimos dos lineas....las que están en negrita:''' |
case "$1" in | case "$1" in |
Última revisión de 16:36 10 nov 2014
Todas las instrucciones para la instalación de Wview se refieren a la versión 5.21.7
La instalación de WView es sencilla. No te asustes si ves estas instrucciones muy largas, es que están muy detalladas.
Los comandos o instrucciones que hay que introducir son los que puedes ver a continuación del punto:
- instruccion parametros
Todo el texto que aparece en los recuadros son los mensajes que devolverá tu ordenador, salvo en los casos que haya que editar ficheros.
Se hace la advertencia de que puede haber diferencias entre unas versiones u otras. Diferencias que pueden ocasionar el mal funcionamiento del programa.
Estas instrucciones son válidas para la mayoría de los sistemas Linux. En los ejemplos se ha utilizado un sistema basado en Debian. Es posible que para sistemas Ubuntu u otros sistemas pueda haber diferencias en el proceso.
Contenido
Método corto o sin compilación
Este método es válido para cualquier ordenador con Debian o Ubuntu.
Editamos /etc/apt/sources.list
- sudo nano /etc/apt/sources.list
Y añadimos estas dos líneas:
deb http://www.wviewweather.com/apt/wheezy wheezy main deb-src http://www.wviewweather.com/apt/wheezy wheezy main
Grabamos y salimos con CTRL-X
Actualizamos nuestro Linux
- sudo apt-get update
sudo apt-get update Get:1 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B] Get:2 http://raspberrypi.collabora.com wheezy Release.gpg [836 B] Get:3 http://mirrordirector.raspbian.org wheezy Release [14.4 kB] … … ... Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en Fetched 6,992 kB in 40s (174 kB/s) Reading package lists... Done
- sudo apt-get upgrade
sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: apt apt-utils base-files cups-bsd cups-client cups-common dbus dbus-x11 dpkg dpkg-dev gnupg gpgv krb5-locales libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libc-bin libc-dev-bin libc6 libc6-dev libcups2 libcupsimage2 libdbus-1-3 libdpkg-perl libgssapi-krb5-2 libjpeg8 libk5crypto3 libkrb5-3 libkrb5support0 libsmbclient libssl1.0.0 libwbclient0 libxml2 locales multiarch-support openssh-client openssh-server openssl python-picamera python-rpi.gpio python3-picamera python3-rpi.gpio rpi-update samba-common smbclient ssh tzdata wolfram-engine 48 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 272 MB of archives. After this operation, 9,448 kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.raspberrypi.org/debian/ wheezy/main wolfram-engine armhf 10.0.0+2014080602 [233 MB] … … … Get:48 http://archive.raspberrypi.org/debian/ wheezy/main rpi-update all 20140705 [4,408 B] Fetched 272 MB in 12min 47s (354 kB/s) Extracting templates from packages: 100% Preconfiguring packages ... (Reading database ... 69052 files and directories currently installed.) Preparing to replace base-files 7.1wheezy5+rpi1 (using .../base-files_7.1wheezy6+rpi1_armhf.deb) ... Unpacking replacement base-files ... Processing triggers for man-db ... Processing triggers for install-info ... Setting up base-files (7.1wheezy6+rpi1) ... Installing new version of config file /etc/debian_version ... (Reading database ... 69052 files and directories currently installed.) Preparing to replace dpkg 1.16.14+rpi1 (using .../dpkg_1.16.15+rpi1_armhf.deb) ... Unpacking replacement dpkg ... Processing triggers for man-db ... … … … Setting up python3-picamera (1.7-1) ... Setting up rpi-update (20140705) ... Setting up ssh (1:6.0p1-4+deb7u2) ...
Instalamos TODO lo que nos va a hacer falta, incluido Wview
- sudo apt-get install --force-yes --yes build-essential zlib1g-dev libpng12-dev libreadline-dev gawk libsqlite3-dev sqlite3 libgd2-xpm libgd2-xpm-dev libssl-dev libcurl4-openssl-dev libusb-1.0-0 libusb-1.0-0-dev apache2 php5 php5-sqlite libapache2-mod-php5 ntp tnftp wget libudev-dev wview
sudo apt-get install --force-yes --yes build-essential zlib1g-dev libpng12-dev libreadline-dev gawk libsqlite3-dev sqlite3 libgd2-xpm libgd2-xpm-dev libssl-dev libcurl4- openssl-dev libusb-1.0-0 libusb-1.0-0-dev apache2 php5 php5-sqlite libapache2-mod-php5 ntp tnftp wget libudev-dev wview Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version. libgd2-xpm is already the newest version. libgd2-xpm set to manually installed. ... ... ... To start/stop wview: "#> sudo /etc/init.d/wview start|stop" /etc/rsyslog.conf: @root:adm@ [ ok ] Stopping enhanced syslogd: rsyslogd. [ ok ] Starting enhanced syslogd: rsyslogd. wview logs will be found at: /var/log/wview.log You may want to restart logrotate so wview rotate settings will take effect. Starting wview daemons: Processing triggers for libapache2-mod-php5 ... [....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName . ok
Voila!!!!!!
Nuestra ordenador ya debe estar ejecutando Wview en modo Demo.
Rapido, ¿verdad?
Bueno, tiene el inconveniente que no podremos recompilar algún módulo. En su día yo tuve que recompilar varios módulos, por ejemplo, para cambiar la gráfica de la presión atmosférica, pues siempre sale casi plana.
Método largo. Compilando los fuentes
Instalando paquetes necesarios
Actualizamos nuestro Linux e instalamos los paquetes de software que serán necesarios para Wview
Ejecutamos:
- sudo apt-get update
sudo apt-get update Get:1 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B] Get:2 http://raspberrypi.collabora.com wheezy Release.gpg [836 B] Get:3 http://mirrordirector.raspbian.org wheezy Release [14.4 kB] … … ... Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en Fetched 6,992 kB in 40s (174 kB/s) Reading package lists... Done
- sudo apt-get upgrade
sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: apt apt-utils base-files cups-bsd cups-client cups-common dbus dbus-x11 dpkg dpkg-dev gnupg gpgv krb5-locales libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libc-bin libc-dev-bin libc6 libc6-dev libcups2 libcupsimage2 libdbus-1-3 libdpkg-perl libgssapi-krb5-2 libjpeg8 libk5crypto3 libkrb5-3 libkrb5support0 libsmbclient libssl1.0.0 libwbclient0 libxml2 locales multiarch-support openssh-client openssh-server openssl python-picamera python-rpi.gpio python3-picamera python3-rpi.gpio rpi-update samba-common smbclient ssh tzdata wolfram-engine 48 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 272 MB of archives. After this operation, 9,448 kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.raspberrypi.org/debian/ wheezy/main wolfram-engine armhf 10.0.0+2014080602 [233 MB] … … … Get:48 http://archive.raspberrypi.org/debian/ wheezy/main rpi-update all 20140705 [4,408 B] Fetched 272 MB in 12min 47s (354 kB/s) Extracting templates from packages: 100% Preconfiguring packages ... (Reading database ... 69052 files and directories currently installed.) Preparing to replace base-files 7.1wheezy5+rpi1 (using .../base-files_7.1wheezy6+rpi1_armhf.deb) ... Unpacking replacement base-files ... Processing triggers for man-db ... Processing triggers for install-info ... Setting up base-files (7.1wheezy6+rpi1) ... Installing new version of config file /etc/debian_version ... (Reading database ... 69052 files and directories currently installed.) Preparing to replace dpkg 1.16.14+rpi1 (using .../dpkg_1.16.15+rpi1_armhf.deb) ... Unpacking replacement dpkg ... Processing triggers for man-db ... … … … Setting up python3-picamera (1.7-1) ... Setting up rpi-update (20140705) ... Setting up ssh (1:6.0p1-4+deb7u2) ...
- sudo apt-get install --yes build-essential zlib1g-dev libpng12-dev libreadline-dev gawk libsqlite3-dev sqlite3 libgd2-xpm libgd2-xpm-dev libssl-dev libcurl4-openssl-dev libusb-1.0-0 libusb-1.0-0-dev apache2 php5 php5-sqlite libapache2-mod-php5 ntp tnftp wget libudev-dev
pi@raspberrypi ~ $ sudo apt-get install --yes build-essential zlib1g-dev libpng12-dev libreadline-dev gawk libsqlite3-dev sqlite3 libgd2-xpm libgd2-xpm-dev libssl-dev libcurl4-openssl-dev libusb-1.0-0 libusb-1.0-0-dev apache2 php5 php5-sqlite libapache2-mod-php5 ntp tnftp wget libudev-dev … … … Setting up tnftp (20100108-3) ... update-alternatives: using /usr/bin/tnftp to provide /usr/bin/ftp (ftp) in auto mode Processing triggers for libapache2-mod-php5 ... [....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName . ok pi@raspberrypi ~ $
Instalando Radlib
Descarga de Radlib
Descargamos radlib
pi@raspberrypi ~ $ wget http://downloads.sourceforge.net/radlib/radlib-2.12.0.tar.gz --2014-08-24 11:46:01-- http://downloads.sourceforge.net/radlib/radlib-2.12.0.tar.gz Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59 Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://downloads.sourceforge.net/project/radlib/radlib/radlib-2.12.0/radlib-2.12.0.tar.gz [following] --2014-08-24 11:46:02-- http://downloads.sourceforge.net/project/radlib/radlib/radlib-2.12.0/radlib-2.12.0.tar.gz Reusing existing connection to downloads.sourceforge.net:80. HTTP request sent, awaiting response... 302 Found Location: http://kent.dl.sourceforge.net/project/radlib/radlib/radlib-2.12.0/radlib-2.12.0.tar.gz [following] --2014-08-24 11:46:02-- http://kent.dl.sourceforge.net/project/radlib/radlib/radlib-2.12.0/radlib-2.12.0.tar.gz Resolving kent.dl.sourceforge.net (kent.dl.sourceforge.net)... 212.219.56.185 Connecting to kent.dl.sourceforge.net (kent.dl.sourceforge.net)|212.219.56.185|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 521798 (510K) [application/x-gzip] Saving to: `radlib-2.12.0.tar.gz' 100%[============================================================================>] 521,798 472K/s in 1.1s 2014-08-24 11:46:03 (472 KB/s) - `radlib-2.12.0.tar.gz' saved [521798/521798] pi@raspberrypi ~ $
Descomprimimos radlib
- tar zxvf radlib-2.12.0.tar.gz
pi@raspberrypi ~ $ tar zxvf radlib-2.12.0.tar.gz radlib-2.12.0/ radlib-2.12.0/src/ radlib-2.12.0/src/radlist.c radlib-2.12.0/src/radsysutils.c … … … radlib-2.12.0/database/postgresql/_pg-types.h radlib-2.12.0/database/postgresql/pg_database.c radlib-2.12.0/install-sh pi@raspberrypi ~ $
Compilando Radlib
Entramos en el directorio de los fuents de radlib
- cd radlib-2.12.0
pi@raspberrypi ~ $ cd radlib-2.12.0 pi@raspberrypi ~/radlib-2.12.0 $
Configuramos radlib para su posterior compilación
- ./configure --enable-sqlite --prefix=/ --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib
pi@raspberrypi ~/radlib-2.12.0 $ ./configure --enable-sqlite --prefix=/ --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p … … … config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands pi@raspberrypi ~/radlib-2.12.0 $
Compilamos radlib
- sudo make install
pi@raspberrypi ~/radlib-2.12.0 $ sudo make install Making install in src make[1]: Entering directory `/home/pi/radlib-2.12.0/src' make[2]: Entering directory `/home/pi/radlib-2.12.0/src' … … … libtool: install: /usr/bin/install -c .libs/raddebug /usr/bin/raddebug make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/pi/radlib-2.12.0/debug' make[1]: Leaving directory `/home/pi/radlib-2.12.0/debug' make[1]: Entering directory `/home/pi/radlib-2.12.0' make[2]: Entering directory `/home/pi/radlib-2.12.0' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/pi/radlib-2.12.0' make[1]: Leaving directory `/home/pi/radlib-2.12.0' pi@raspberrypi ~/radlib-2.12.0 $
Volvemos al directorio inicial
- cd ..
pi@raspberrypi ~/radlib-2.12.0 $ cd ..
Descarga y compilación de Wview
Descarga de Wview
Descargamos Wview 5.21.7
pi@raspberrypi ~ $ wget http://downloads.sourceforge.net/wview/wview-5.21.7.tar.gz --2014-08-24 15:15:21-- http://downloads.sourceforge.net/wview/wview-5.21.7.tar.gz Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59 Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://downloads.sourceforge.net/project/wview/wview/wview-5.21.7/wview-5.21.7.tar.gz [following] --2014-08-24 15:15:21-- http://downloads.sourceforge.net/project/wview/wview/wview-5.21.7/wview-5.21.7.tar.gz Reusing existing connection to downloads.sourceforge.net:80. HTTP request sent, awaiting response... 302 Found Location: http://softlayer-ams.dl.sourceforge.net/project/wview/wview/wview-5.21.7/wview-5.21.7.tar.gz [following] --2014-08-24 15:15:22-- http://softlayer-ams.dl.sourceforge.net/project/wview/wview/wview-5.21.7/wview-5.21.7.tar.gz Resolving softlayer-ams.dl.sourceforge.net (softlayer-ams.dl.sourceforge.net)... 37.58.69.140 Connecting to softlayer-ams.dl.sourceforge.net (softlayer-ams.dl.sourceforge.net)|37.58.69.140|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1438975 (1.4M) [application/x-gzip] Saving to: `wview-5.21.7.tar.gz' 100%[============================================================================>] 1,438,975 93.2K/s in 14s 2014-08-24 15:15:36 (99.0 KB/s) - `wview-5.21.7.tar.gz' saved [1438975/1438975] pi@raspberrypi ~ $
Compilación de Wview
Descomprimimos Wview 5.21.7
- tar zxvf wview-5.21.7.tar.gz
pi@raspberrypi ~ $ tar zxvf wview-5.21.7.tar.gz wview-5.21.7/ wview-5.21.7/config.sub wview-5.21.7/wview-User-Manual.html wview-5.21.7/wview-Quick-Start-MacOSX.html … … … wview-5.21.7/http/Makefile.am wview-5.21.7/http/Makefile.in wview-5.21.7/http/http.c pi@raspberrypi ~ $
Entramos en el directorio de wview
- cd wview-5.21.7
pi@raspberrypi ~ $ cd wview-5.21.7 pi@raspberrypi ~/wview-5.21.7 $
Configuramos Wview para su compilación
- ./configure --prefix=/ --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib
pi@raspberrypi ~/wview-5.21.7 $ ./configure --prefix=/ --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p … … … config.status: creating utilities/hilowcreate/Makefile config.status: creating config.h config.status: executing depfiles commands pi@raspberrypi ~/wview-5.21.7 $
Compilamos Wview 5.21.7
- sudo make install
pi@raspberrypi ~/wview-5.21.7 $ sudo make install Making install in stations make[1]: Entering directory `/home/pi/wview-5.21.7/stations' Making install in Simulator … … … Y mucho tiempo después … … … make[3]: Entering directory `/home/pi/wview-5.21.7' ==> /var/lib/wview has been created with distro examples ==> /etc/wview has been created with distro examples This is a first time install so the station type will be set to "simulator". To change the station type, run "wviewconfig" or use the wviewmgmt web interface to change it. You will need to stop wview and clear the databases of simulator data after you have changed the station type: #> wviewcleardata This is a first time install so the generation templates will be set to "chrome-standard-US units". To change this run "wviewhtmlconfig" to configure the template directory after you have configured wview for metric units and/or extended data. If you want start/stop control of wview from the Management Web Site (and you are comfortable giving the http server user account sudo privileges): Add the http user to the sudo group: #> sudo adduser www-data sudo Set the sudo group to no password required privileges in /etc/sudoers: #> sudo visudo (Make sure the line [%sudo ALL=NOPASSWD: ALL] is at the bottom of the /etc/sudoers file) To start/stop wview: #> sudo /etc/init.d/wview start|stop make[3]: Leaving directory `/home/pi/wview-5.21.7' make[2]: Leaving directory `/home/pi/wview-5.21.7' make[1]: Leaving directory `/home/pi/wview-5.21.7' pi@raspberrypi ~/wview-5.21.7 $
Pasos finales
Ya hemos terminado de Wview, terminamos haciendo unos retoques para facilitarnos la vida.
Volvemos al directorio /home/pi
- cd ..
pi@raspberrypi ~/wview-5.21.7 $ cd .. pi@raspberrypi ~ $
Descargamos el "arrancador" del servidor
- sudo wget https://dl.dropbox.com/u/2427470/raspberry/wview/wview.sh -O /etc/init.d/wview
pi@raspberrypi ~ $ sudo wget https://dl.dropbox.com/u/2427470/raspberry/wview/wview.sh -O /etc/init.d/wview ... ... ... Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 23.21.53.200, 23.23.154.114, 23.21.212.69, ... Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|23.21.53.200|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 5106 (5.0K) [text/x-sh] Saving to: `/etc/init.d/wview' 100%[============================================================================>] 5,106 --.-K/s in 0.001s 2014-08-24 15:47:44 (7.10 MB/s) - `/etc/init.d/wview' saved [5106/5106] pi@raspberrypi ~ $
Damos permiso de ejecución, modificamos para que se arranque cuando iniciemos la raspi, creamos los enlaces simbólicos de las páginas web para poder verlos en el navegador
- sudo chmod +x /etc/init.d/wview
- sudo update-rc.d wview defaults 99
- sudo ln -s /var/lib/wview/img/ /var/www/weather
- sudo ln -s /var/lib/wviewmgmt/ /var/www/wviewmgmt
pi@raspberrypi ~ $ sudo chmod +x /etc/init.d/wview pi@raspberrypi ~ $ sudo update-rc.d wview defaults 99 update-rc.d: using dependency based boot sequencing pi@raspberrypi ~ $ sudo ln -s /var/lib/wview/img/ /var/www/weather pi@raspberrypi ~ $ sudo ln -s /var/lib/wviewmgmt/ /var/www/wviewmgmt
Antes de seguir, modificamos /etc/init.d/wview:
- sudo nano /etc/init.d/wview
pi@raspberrypi ~ $ sudo nano /etc/init.d/wview
Buscar este texto:
case "$1" in start) wait_for_time_set echo "Starting wview daemons:" if [ -x $RADROUTER_BIN ]; then start-stop-daemon --start --oknodo --pidfile $RADROUTER_PID \ --chuid $WVIEW_USER --exec $RADROUTER_BIN 1 $RUN_DIRECTORY
Y añadimos dos lineas....las que están en negrita:
case "$1" in start) wait_for_time_set echo "Borrando los ficheros .pid antiguos" rm -f /var/lib/wview/*.pid echo "Starting wview daemons:" if [ -x $RADROUTER_BIN ]; then start-stop-daemon --start --oknodo --pidfile $RADROUTER_PID \ --chuid $WVIEW_USER --exec $RADROUTER_BIN 1 $RUN_DIRECTORY
Salimos grabando los cambios. Para ello, pulsamos CTRL-X y cuando nos pregunte si queremos grabar le decimos que si, y posteriormente ratificamos el nombre del fichero a grabar, pulsando enter.
Con un navegador abrimos la siguiente dirección: http://192.168.0.210/wviewmgmt/login.php
Por supuesto que cambiamos 192.168.0.210 por la dirección que tenga vuestra Raspberry Pi.
La password es “wview”
Una vez en el sistema nos vamos a la pestaña “File Generation” y modificamos los directorios:
Generation Target Path: /var/lib/wview/img
Template Source Path: /etc/wview/html
Vemos que el color rojo desaparece, por lo que se reconocen los directorios. Grabar los cambios desde el propio navegador.
Recomendado el ejecutar el siguiente comando para borrar todo posible rastro de los ficheros PID de Wview.
- sudo /etc/init.d/wview start
pi@raspberrypi ~ $ sudo /etc/init.d/wview start Borrando los ficheros .pid antiguos Starting wview daemons: pi@raspberrypi ~ $ sudo /etc/init.d/wview stop No /usr/bin/wvhttpd found running; none killed. No /usr/bin/wvcwopd found running; none killed. No /usr/bin/wvalarmd found running; none killed. No /usr/bin/wviewsshd found running; none killed. No /usr/bin/wviewftpd found running; none killed. pi@raspberrypi ~ $
Reiniciamos el ordenador. Posteriormente viene la tarea más dura, la configuración.
- sudo reboot
pi@raspberrypi ~ $ sudo reboot