Setting up wview on Ubuntu

June 10, 2008 · Filed Under Tech 

I decided, mainly for myself, to document my setup of Ubuntu 8.04 Hardy Heron running with a weather station, the inexpensive WS-2310. I built this computer setup for a buddy who wanted to run a weather station, but didn’t want to buy a Davis Vantage Pro2. The machine is a Pentium 4 2.8GHz, 80G HDD, 1 GB of RAM.

  1. Download ISO for 8.04 Hardy Heron SERVER EDITION.
  2. Use PowerISO (Nero, Roxio, ISORecorder, etc.) to burn CD.
  3. Plug computer into network (needed for below step)
  4. Boot to this CD, in install mode (IF you have Windows or remnants of Windows on the target HDD, be sure to boot CD as a LiveCD, in interactive mode, and run the partition editor GParted to delete the remnants of Windoze, which WILL stop the installer from working).
  5. Select Automatic, Use Entire Disk in the options.
  6. Configure to taste, include Apache, MySQL, etc., then install Server Edition.
  7. Remove CD, boot, type in user name and password. you set above
  8. Type: sudo apt-get install ubuntu-desktop, type password when prompted.
  9. When done, reboot into GUI (sudo shutdown -r now), login.
  10. Apply updates when prompted. Reboot.
  11. Go into Synaptic Package Manager. Install:
    • build-essential
    • libcurl4-openssl-dev
    • libgd2-noxpm-dev
    • libmysqlclient15-dev
  12. Download radlib and wview. Put them in your home directory
  13. Open a terminal window:
  14. tar xvzf radlib-2.7.5.tar.gz
    cd radlib-2.7.5
    ./configure --enable-mysql
    make
    sudo make install
    tar xvzf wview-3.9.0.tar.gz
    cd wview-3.9.0
    ./configure --enable-mysql --enable-station-ws2300 --enable-http
    make
    sudo make install-env
    
    sudo cp examples/Debian/wview /etc/init.d
    sudo chmod +x /etc/init.d/wview
    cd /etc/rc.d/rc2.d
    sudo ln -s /etc/init.d/wview S98view
    
    sudo apt-get install tnftp
    
    sudo /usr/local/bin/wviewconfig
    sudo /usr/local/bin/wviewhtmlconfig
    
    mysql -u root -p
    [password]
    CREATE DATABASE wviewDB;
    GRANT ALL ON wviewDB.* TO wvwuser@localhost IDENTIFIED BY "wvwpasswd";
  15. Reboot. Should be all

Let me know if there’s any errors above, or you’d like me to detail some of the substeps better.

Notes:

  • No development tools (compilers, libraries, etc.) are included with the basic install of Ubuntu desktop or server
  • I installed server and then a GUI above to get the priority mechanism of a server, with the user Interface of desktop, you could do the reverse, but this wasn’t right for me.
  • Ubuntu is a Debian variant.
  • I always use a MySQL database for my weather stations.
  • I enable FTP for uploading the weather files. When you do this, if you want the root of your webserver to be the weather page, you’ll need to change the document root for the default website from “/var/www” to “/usr/local/var/wview/img”. Alternately, if you don’t need the two to be the same, put a soft link to /usr/local/var/wview/img into the /var/www directory. Whatever you do, if you use FTP, do not move the /usr/local/var/wview/img directory.

Comments

10 Responses to “Setting up wview on Ubuntu”

  1. SuperCurro on August 1st, 2008 2:04 pm

    Great tutorial!… but the software doesnt find my serial port

    Do you have any idea?

    ————————————————————-
    Valid Station Types: VantagePro, Simulator, WXT510, WS-2300, WMR918
    What weather station do you have (one of VantagePro, Simulator, WXT510, WS-2300, WMR918):
    (VantagePro): WXT510
    ################################################################################
    –> wviewd Configuration (/usr/local/etc/wview/wview.conf):

    ————————————————————-
    –Note– USB is considered serial (/dev/ttyUSBx, /dev/tty.SLAB_USBtoUART, etc.)
    Physical Interface the weather station is connected to (one of serial or ethernet)
    (serial): /dev/ttyS0
    /dev/ttyS0 is not a valid physical interface - must be one of serial or ethernet!
    root@SERVER:/# su hijosdelinfierno
    hijosdelinfierno@SERVER:/$ dmesg | grep tty
    [ 16.202963] console [tty0] enabled
    [ 18.110227] serial8250: ttyS0 at I/O 0×3f8 (irq = 4) is a 16550A
    [ 18.110395] serial8250: ttyS1 at I/O 0×2f8 (irq = 3) is a 16550A
    [ 18.111113] 00:07: ttyS0 at I/O 0×3f8 (irq = 4) is a 16550A
    [ 40.027474] audit(1217444930.515:2): type=1503 operation=”inode_permission” requested_mask=”a::” denied_mask=”a::” name=”/dev/tty” pid=4844 profile=”/usr/sbin/cupsd” namespace=”default”

  2. Dave on August 2nd, 2008 8:37 am

    Yes, it’s expecting either “enter/return” or the word “serial”, where you entered “/dev/ttyS0″.

  3. Yousef Hanoun on August 10th, 2008 11:38 pm

    thanks very much for you tutorial on how setup wview.

    i had one problem no html created!!!

    1- db created add data is inserting.
    2- archive / NOAA created.
    3- img/ folder only jpg/gif/png files ((no html)).
    4- ftp uploading the files to my isp webserver.

    please help !

    #################################################

    Aug 11 09:22:15 yayh-desktop radmrouted[9602]: : radlib: radmrouted started as a daemon …
    Aug 11 09:22:15 yayh-desktop radmrouted[9602]: : started on radlib system 1, workdir /usr/local/var/wview
    Aug 11 09:22:15 yayh-desktop radmrouted[9602]: : running…
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : radlib: wviewd started as a daemon …
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : wview 3.9.0 starting …
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : station interface: serial …
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : Rain Season Start Month set to 11
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : Rain Storm Start Trigger set to 0.01 in/hr
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : Rain Storm Stop Time set to 1 hours
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : Rain YTD preset set to 0.00 inches
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : ET YTD preset set to 0.000 inches
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : bad rain/ET YTD Year given, disabling…
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : station polling interval set to 15 seconds
    Aug 11 09:22:16 yayh-desktop wviewd[9607]: : — Station Init Start –
    Aug 11 09:22:17 yayh-desktop wviewsqld[9611]: : radlib: wviewsqld started as a daemon …
    Aug 11 09:22:17 yayh-desktop wviewsqld[9611]: : SQLDB: basic metric archiving enabled -
    Aug 11 09:22:17 yayh-desktop wviewsqld[9611]: : SQLDB: to 74.52.69.67 table wviewDB.archive
    Aug 11 09:22:17 yayh-desktop htmlgend[9614]: : radlib: htmlgend started as a daemon …
    Aug 11 09:22:17 yayh-desktop htmlgend[9614]: : !! configured for metric units/conversion !!
    Aug 11 09:22:17 yayh-desktop htmlgend[9614]: : !! Rain units will be mm !!
    Aug 11 09:22:17 yayh-desktop htmlgend[9614]: : generating to /usr/local/var/wview/img
    Aug 11 09:22:17 yayh-desktop wviewftpd[9620]: : radlib: wviewftpd started as a daemon …
    Aug 11 09:22:17 yayh-desktop wviewftpd[9620]: : FTP: INIT: 6 rules added
    Aug 11 09:22:17 yayh-desktop wvpmond[9624]: : radlib: wvpmond started as a daemon …
    Aug 11 09:22:17 yayh-desktop wviewd[9607]: : Vantage Pro on /dev/ttyS0 opened …
    Aug 11 09:22:17 yayh-desktop wviewd[9607]: : station archive interval: 1 minutes
    Aug 11 09:22:17 yayh-desktop wviewd[9607]: : running…
    Aug 11 09:22:18 yayh-desktop htmlgend[9614]: : running…
    Aug 11 09:22:18 yayh-desktop wviewd[9607]: : station location: elevation: 69 feet
    Aug 11 09:22:18 yayh-desktop wviewd[9607]: : station location: latitude: 25.6 N longitude: 55.5 E
    Aug 11 09:22:18 yayh-desktop wviewd[9607]: : initializing computed data values…
    Aug 11 09:22:18 yayh-desktop wviewd[9607]: : — Station Init Complete –
    Aug 11 09:22:18 yayh-desktop wviewd[9607]: : newest archive record: 2008-08-11 09:22
    Aug 11 09:22:19 yayh-desktop wviewsqld[9611]: : SQLDB: beginning initial database sync (this may take some time)…
    Aug 11 09:22:19 yayh-desktop wviewsqld[9611]: : running…
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : received archive path /usr/local/var/wview/archive from wviewd: 20080811 09:22:18
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : htmlmgrInit: 51 built-in image definitions added
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: wviewd: 0
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : htmlmgrInit: 0 user image definitions added
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: htmlgend: 0
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: wvalarmd: 120
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: pid file /usr/local/var/wview/wvalarmd.pid not present, disable monitoring…
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: wvcwopd: 120
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: pid file /usr/local/var/wview/wvcwopd.pid not present, disable monitoring…
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: wvhttpd: 120
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: pid file /usr/local/var/wview/wvhttpd.pid not present, disable monitoring…
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : PMON: wviewsqld: 600
    Aug 11 09:22:19 yayh-desktop wvpmond[9624]: : running…
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : htmlmgrInit: 13 templates added
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : htmlmgrInit: forecast html tags are disabled - /usr/local/etc/wview/forecast.conf not found…
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : NOAA Generate: creating monthly NOAA reports starting 8-2008
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : NOAA Generate: creating yearly NOAA reports starting 2008
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : ARCREC: using header file /usr/local/etc/wview/arcrec-header.conf …
    Aug 11 09:22:19 yayh-desktop htmlgend[9614]: : ARCREC: saving 365 daily archive reports …
    Aug 11 09:22:20 yayh-desktop htmlgend[9614]: : ARCREC: 3 daily archive reports available
    Aug 11 09:22:21 yayh-desktop htmlgend[9614]: : starting html generation in 2 mins 49 secs
    Aug 11 09:22:21 yayh-desktop htmlgend[9614]: : doing initial html generation now…
    Aug 11 09:22:45 yayh-desktop wviewd[9607]: : station time synchronized to: 08-11-2008 09:22:45
    Aug 11 09:22:45 yayh-desktop wviewd[9607]: : station GMT offset synchronized to: 4 hours, 0 minutes
    Aug 11 09:23:05 yayh-desktop wviewd[9607]: : storing record for 2008-08-11 09:23
    Aug 11 09:24:04 yayh-desktop wviewd[9607]: : storing record for 2008-08-11 09:24
    Aug 11 09:25:04 yayh-desktop wviewd[9607]: : storing record for 2008-08-11 09:25
    Aug 11 09:26:05 yayh-desktop wviewd[9607]: : storing record for 2008-08-11 09:26
    Aug 11 09:26:15 yayh-desktop wviewftpd[9620]: : FTP: 6 rules processed
    Aug 11 09:27:05 yayh-desktop wviewd[9607]: : storing record for 2008-08-11 09:27

  4. Dave on August 11th, 2008 10:03 am

    Sounds like you did not configure the template file to make it generate the HTMLs you desire.

    Cheers,
    Dave

  5. Yousef Hanoun on August 11th, 2008 1:14 pm

    thanks again for helping me
    i have checked html-templates.conf
    in /usr/local/etc/wview/html

    the following html template are enabled

    index-day.htx
    index-night.htx

    but still there is no html!!!

    do i need to change another conf file
    ####################################################
    #
    # html-templates-classic.conf - define the HTML template files to use for HTML
    # and generic generation
    #
    # Note: Template expansion is performed in the order the files are listed
    # in this file. Thus, files to be included in other templates should
    # be listed before the templates that include them.

    # File Format
    #
    # 1) lines beginning with ‘#’ or are ignored
    #

    # Column Format
    #
    # 1) template file name (must be in /etc/wview/html)
    #

    ###############################################################################
    ### Standard Include Macros (should be generated first)
    ###############################################################################

    header.incx
    header-big.incx
    nav-buttons.incx
    readings.incx

    ###############################################################################
    ### RSS Feed XML Template
    ###############################################################################

    ### Standard Weather RSS feed template - file generated is wxrss.xml and can
    ### be added to any html template to add an RSS feed to that page
    wxrss.xtx

    ###############################################################################
    ### Home Page Templates
    ###############################################################################

    ### Standard Home Page template
    #index.htx

    ### Day/Night Home Pages - if you want a different homepage template based on
    ### day or night, uncomment these and copy your templates to
    ### /etc/wview/html/index-day.htx and /etc/wview/html/index-night.htx
    ### respectively
    index-day.htx
    index-night.htx

    ###############################################################################
    ### Historical Data Templates
    ###############################################################################

    ### Standard (no extra sensors) Weather Data
    almanac.htx
    Current.htx
    Daily.htx
    Weekly.htx
    Monthly.htx
    Yearly.htx

    ###############################################################################
    ### Current Conditions (Table Only) Template
    ###############################################################################

    #Current_Conditions.htx

    ###############################################################################
    ### AWEKAS Data Submission Template
    ###############################################################################

    #awekas_wl.htx

  6. Yousef Hanoun on August 12th, 2008 12:42 am

    hi..,

    i have enable index.htx in html-templates.conf

    and now i received this msg:
    htmlmgrInit: 14 templates added

    but still the same no html at all :(

  7. Yousef Hanoun on August 12th, 2008 12:11 pm

    hi…,

    today i did a clean install on ubuntu server 8.04
    and follow exact steps.

    but still same problem no html ! :(

    my Davis vrpo is already configured and running do i need to run vpinstall.
    could be this the reason why there is no html created.

    thanks.

  8. Django on August 12th, 2008 1:20 pm

    Take a look into /usr/local/etc/wview/htmlgen.conf
    Where did you store the generated html-files?

    i.e.

    ##################### htmlgend Configuration #####################

    # Where to store generated html and graphics files:
    #IMAGE_PATH=/var/www/html/vp2
    IMAGE_PATH=/usr/share/wview

  9. Yousef Hanoun on August 12th, 2008 11:27 pm

    thanks for replay i have submit a post in the following link
    http://groups.google.com/group/wview/browse_thread/thread/446e472d6415795a/bc64854155bb2e1f#bc64854155bb2e1fg

    you can see also that img PATH from the log
    Aug 13 09:15:50 ubuntuserver htmlgend[5817]: :
    generating to /usr/local/var/wview/img

    :(

  10. Yousef Hanoun on August 13th, 2008 1:38 am

    thanks to David and to all,

    i fixed it :) , i found the problem in my Davis vpro
    i run vpinstall and erase all archive data and now it is working html created.

    thanks.

Leave a Reply