mysql

Issue #36 resolved
Kevin Roberts created an issue

How do install if running MySQL.

does it work ok with weewx v2.6.3

Comments (29)

  1. Gary Roderick

    Kevin,

    If installing Weewx-WD from scratch then whether you are running SQLite or MySQL should be immaterial, the insatll instructions as they are should work. Of course, $SQLITE_ROOT should then be taken as the location of your MySQL databases. The only issue may occur if upgrading from an earlier version of Weewx-WD to v0.99 or later, where there are some database schema changes required that must be done from the SQL command line and there MAY be an issue. OzGreg might be able to comment further (he runs MySQL, I run SQLite).

    If you do intend to use Weewx-WD with MySQL I very strongly recommend you get a stable Weewx/MySQL install running first before adding Weewx-WD.

    As for 2.6.3 compatibility, I have yet to install and test Weewx-WD on a 2.6.3 system though I plan to do that over the next few days. I currently have Weewx-WD running on 2.6.1 and looking at the changelog for 2.6.2 and 2.6.3 I do not expect there will be any issues with running 2.6.3.

    Gary

  2. Gary Roderick

    I take it you mean WD not MD. There should not be a WD (or MD) folder. Unfortunately that WD folder has been in the bitbucket tree since day 1 and probably should be removed. The install instructions are correct in that in your skins folder ($SKIN_ROOT - in my case /etc/weewx/skins) you should have the /clientraw folder (containing the clientraw family of templates and its skin.conf) and the /testtags folder (containing the testtags.php.tmpl template and its skin.conf).

    Saratoga install and config instructions are under the 'Templates' menu on the Saratoga home page. I would advise you to get the clientraw and testtags files generating properly and reliably under Weewx before really delving into the Saratoga templates. Dealing with Weewx/Weewx-WD issues is best done without (possibly) throwing another variable into the mix.

  3. Gary Roderick

    The keys files for the saratoga templates are testtags.php and clientraw.txt. I can see the clientraw files are being generated and appear to be being updated regularly.

    Testtags.php is there but its timestamp indicates it has not been generated for over 24 hours? Need to solve that issue. Do the weewx logs show anything? You also have an issue with the '°' symbol being shown as '°'. This is related to the degree_C and/or degree_F settings under [[Labels]] in testtags skin.conf. We have not definitively sorted this one out yet, I use °C and °F respectively and I don't have an issue, I know others use ° and don't have an issue. May require a little trial and error.

    You can easily gross error check the clientraw files by using a clientraw parser if your files are accessible via the internet. You can find such a parser here http://www.tnetweather.com/wd-parser.php . You just put the internet address to the folder containing your clientraw files (in your case http://weather.na7kr.us/weewx/WD/) in the Site: text box. Field 100 looks obviously wrong to me but that can be tracked down later, other fields look ballpark to me.

    Apart from sorting out testtags.php the next step is to install the applicable saratoga template and WD plugin. Look under the 'Templates', 'Download and Install instructions' menu at http://saratoga-weather.org . It is probably worth your while looking at a few of the other items under the 'Templates' menu. Key issues when setting up the Saratoga templates are:

    • WD date format setting ($SITE['WDdateMDY']). Does not matter whether you use d/m/y or m/d/y, as long as testtags.php provides the date in the same format. Otherwise your dates will be nonsense.

    • uom settings eg $SITE['uomTemp']. These need to be consistent with the [[Groups]] settings in testtags skin.conf or temps, pressure, rain and speeds will display wrong.

  4. Kevin Roberts reporter

    Does this help?

    Apr 20 00:15:29 NA7KR weewx[17556]: genimages: Generated 12 images for BigReport in 0.99 seconds

    Apr 20 00:16:22 NA7KR weewx[17556]: archive: added record 2014-04-20 00:16:00 PDT (1397978160) to database 'weewx'; table 'archive'

    Apr 20 00:16:23 NA7KR weewx[17556]: restx: Wunderground-PWS: Published record 2014-04-20 00:16:00 PDT (1397978160)

    Apr 20 00:16:23 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.25 seconds

    Apr 20 00:16:23 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 0.56 seconds

    Apr 20 00:16:24 NA7KR weewx[17556]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 0.52 seconds

    Apr 20 00:16:25 NA7KR weewx[17556]: genimages: Generated 12 images for StandardReport in 0.83 seconds

    Apr 20 00:16:25 NA7KR weewx[17556]: cheetahgenerator: generate failed with exception '<type 'exceptions.TypeError'>'

    Apr 20 00:16:25 NA7KR weewx[17556]: cheetahgenerator: **** ignoring template /home/weewx/skins/Clientraw/clientraw.txt.tmpl

    Apr 20 00:16:25 NA7KR weewx[17556]: cheetahgenerator: **** reason: unsupported operand type(s) for /: 'NoneType' and 'int'

    Apr 20 00:16:25 NA7KR weewx[17556]: **** Traceback (most recent call last):

    Apr 20 00:16:25 NA7KR weewx[17556]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 274, in generate

    Apr 20 00:16:25 NA7KR weewx[17556]: **** print >> _file, text

    Apr 20 00:16:25 NA7KR weewx[17556]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in str

    Apr 20 00:16:25 NA7KR weewx[17556]: **** rc = getattr(self, mainMethName)()

    Apr 20 00:16:25 NA7KR weewx[17556]: **** File "_home_weewx_skins_Clientraw_clientraw_txt_tmpl.py", line 576, in respond

    Apr 20 00:16:25 NA7KR weewx[17556]: **** TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: generated 4 'ToDate' files for Clientraw in 2.20 seconds

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: generate failed with exception '<type 'exceptions.TypeError'>'

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: **** ignoring template /home/weewx/skins/Testtags/testtags.php.tmpl

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: *** reason: unsupported operand type(s) for : 'float' and 'NoneType'

    Apr 20 00:16:27 NA7KR weewx[17556]: **** Traceback (most recent call last):

    Apr 20 00:16:27 NA7KR weewx[17556]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 274, in generate

    Apr 20 00:16:27 NA7KR weewx[17556]: **** print >> _file, text

    Apr 20 00:16:27 NA7KR weewx[17556]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in str

    Apr 20 00:16:27 NA7KR weewx[17556]: **** rc = getattr(self, mainMethName)()

    Apr 20 00:16:27 NA7KR weewx[17556]: **** File "_home_weewx_skins_Testtags_testtags_php_tmpl.py", line 464, in respond

    Apr 20 00:16:27 NA7KR weewx[17556]: *** TypeError: unsupported operand type(s) for : 'float' and 'NoneType'

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: generated 0 'ToDate' files for Testtags in 0.16 seconds

    Apr 20 00:16:27 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByMonth' files for BigReport in 0.24 seconds

    Apr 20 00:16:28 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByYear' files for BigReport in 0.56 seconds

    Apr 20 00:16:28 NA7KR weewx[17556]: cheetahgenerator: generated 12 'ToDate' files for BigReport in 0.52 seconds

    Apr 20 00:16:29 NA7KR weewx[17556]: genimages: Generated 12 images for BigReport in 1.00 seconds

  5. Kevin Roberts reporter

    Also this: **** NotFound: cannot find 'windrunUnits'

    Apr 20 00:36:32 NA7KR weewx[17556]: genimages: Generated 12 images for BigReport in 1.01 seconds

    Apr 20 00:37:25 NA7KR weewx[17556]: archive: added record 2014-04-20 00:37:00 PDT (1397979420) to database 'weewx'; table 'archive'

    Apr 20 00:37:25 NA7KR weewx[17556]: restx: Wunderground-PWS: Published record 2014-04-20 00:37:00 PDT (1397979420)

    Apr 20 00:37:25 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.25 seconds

    Apr 20 00:37:26 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 0.57 seconds

    Apr 20 00:37:26 NA7KR weewx[17556]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 0.52 seconds

    Apr 20 00:37:27 NA7KR weewx[17556]: genimages: Generated 12 images for StandardReport in 0.82 seconds

    Apr 20 00:37:29 NA7KR weewx[17556]: cheetahgenerator: generated 5 'ToDate' files for Clientraw in 2.21 seconds

    Apr 20 00:37:29 NA7KR weewx[17556]: cheetahgenerator: generate failed with exception '<class 'NameMapper.NotFound'>'

    Apr 20 00:37:29 NA7KR weewx[17556]: cheetahgenerator: **** ignoring template /home/weewx/skins/Testtags/testtags.php.tmpl

    Apr 20 00:37:29 NA7KR weewx[17556]: cheetahgenerator: **** reason: cannot find 'windrunUnits'

    Apr 20 00:37:29 NA7KR weewx[17556]: **** Traceback (most recent call last):

    Apr 20 00:37:29 NA7KR weewx[17556]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 274, in generate

    Apr 20 00:37:29 NA7KR weewx[17556]: **** print >> _file, text

    Apr 20 00:37:29 NA7KR weewx[17556]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in str

    Apr 20 00:37:29 NA7KR weewx[17556]: **** rc = getattr(self, mainMethName)()

    Apr 20 00:37:29 NA7KR weewx[17556]: **** File "_home_weewx_skins_Testtags_testtags_php_tmpl.py", line 640, in respond

    Apr 20 00:37:29 NA7KR weewx[17556]: **** NotFound: cannot find 'windrunUnits'

    Apr 20 00:37:29 NA7KR weewx[17556]: cheetahgenerator: generated 0 'ToDate' files for Testtags in 0.17 seconds

    Apr 20 00:37:30 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByMonth' files for BigReport in 0.24 seconds

    Apr 20 00:37:30 NA7KR weewx[17556]: cheetahgenerator: generated 1 'SummaryByYear' files for BigReport in 0.57 seconds

    Apr 20 00:37:31 NA7KR weewx[17556]: cheetahgenerator: generated 12 'ToDate' files for BigReport in 0.53 seconds

    Apr 20 00:37:32 NA7KR weewx[17556]: genimages: Generated 12 images for BigReport in 1.04 seconds

  6. Gary Roderick

    Thanks. That was what I am after. The testtags issue appears to be ongoing (given the age of the file) and I expect that each archive period weewx is throwing an error on the template and ignoring it. Clientraw though seems to be intermittent as I have seen clientraw.txt on your site dated 2014-04-20 05:24. Given the errors that are thrown I suspect that we have an issue with an observation or value in a database being 'None' and that is throwing an error in a math calculation. Clientraw will be easy enough to fix but testtags will be more difficult as there are a lot of calculcations in there.

    I have sat here just now for the last 30 odd minutes (05:00 to 05:30 your time) refreshing your Weewx standard page at http://weather.na7kr.us/weewx/ and I have noticed the Current Conditions values frequently display N/A. Similarly, if I look at your temperature plots for the day I can see very small gaps which I suspect are 'None' values being recorded in your archive database (the source of the plot). By default, Weewx displays N/A for a None value on the standard pages it produces. I suspect if you look at your archive database you will find numerous records with no data recorded. I have also noticed that when the N/As are displayed clientraw.txt has not been produced.

    I suspect that what is happening is that Weewx is not receiving/producing readings for some archive periods and consequently the calculations in clientraw throw an error. Testtags has far more complex calculations and is likely that there is a value it is expecting that your station is not/cannot provide and that continuously throws an error. I think to date we have not had anyone with a WS28xx so probably on a bit of new ground here. I can make clientraw more robust fairly easily, but testatgs will be more complex. So I am working on the correct templates can you tell me what you downloaded from Bitbucket - there are several versions there. Unfortunately bitbucket does not easily provide a version number only commit numbers.

    As for the repeated N/As, I note you are using a 1 minute archive period. I am not familiar with the WS28xx stations but I know some stations have had issues with missing data when used on short archive periods such as 1 minute. I think 5 minutes is a fairly standard archive period. I also have seen posts (again not sure if they were applicable to WS28xx) where hardware/software record_generation has had an effect on the stability of the data.

    Sorry it is not a simple fix.

  7. Kevin Roberts reporter

    I have removed all the data to see if it helps

    There are some Null when it starts program it take some time register and send data..

    How do I find version?

  8. Gary Roderick

    Ok. Just looked now and saw N/A across the board on your current conditions for 10:25 and 10:27 and now 10:32. That's not good. No matter, we can make the templates a little more robust. Re versions, no easy way to tell on bitbucket other than the commit number when you download something. Commit numbers are recorded on the site not in the file. Unfortunately bitbucket does not provide an automated means to give each commit a version number as other sites do. Probably easiest if you can pull the clientraw.txt.tmpl and testtags.php.tmpl off your system and email to me. You can email me at gjroderick (at) gmail.com

  9. Kevin Roberts reporter

    It looks be in: #if $unit.unit_type_dict.group_speed == "km_per_hour" #set $windrunUnits = " km" #elif $unit.unit_type_dict.group_speed == "mile_per_hour" #set $windrunUnits = " mi" #elif $unit.unit_type_dict.group_speed == "knot" #set $windrunUnits = " mi" #end if

    Apr 21 16:15:36 NA7KR weewx[27498]: archive: added record 2014-04-21 16:15:00 PDT (1398122100) to database 'weewx'; table 'archive' Apr 21 16:15:36 NA7KR weewx[27498]: restx: Wunderground-PWS: Published record 2014-04-21 16:15:00 PDT (1398122100) Apr 21 16:15:36 NA7KR weewx[27498]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.10 seconds Apr 21 16:15:36 NA7KR weewx[27498]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 0.56 seconds Apr 21 16:15:37 NA7KR weewx[27498]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 0.51 seconds Apr 21 16:15:37 NA7KR weewx[27498]: genimages: Generated 12 images for StandardReport in 0.37 seconds Apr 21 16:15:39 NA7KR weewx[27498]: cheetahgenerator: generated 5 'ToDate' files for Clientraw in 1.36 seconds Apr 21 16:15:39 NA7KR weewx[27498]: cheetahgenerator: generate failed with exception '<class 'NameMapper.NotFound'>' Apr 21 16:15:39 NA7KR weewx[27498]: cheetahgenerator: * ignoring template /home/weewx/skins/Testtags/testtags.php.tmpl Apr 21 16:15:39 NA7KR weewx[27498]: cheetahgenerator: reason: cannot find 'windrunUnits' Apr 21 16:15:39 NA7KR weewx[27498]: Traceback (most recent call last): Apr 21 16:15:39 NA7KR weewx[27498]: File "/home/weewx/bin/weewx/cheetahgenerator.py", line 274, in generate Apr 21 16:15:39 NA7KR weewx[27498]: print >> _file, text Apr 21 16:15:39 NA7KR weewx[27498]: * File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in

  10. Gary Roderick

    Definitely a windrunUnits issue. In your testtags skin.conf under [Units]Groups what setting do you have for group_speed? I suspect it will be something other than km_per_hour, mile_per_hour or knot. Bit of an oversight on my behalf but I seem to have left meter_per_second off the list and also have a small logic error if the if..elif..elif you mentioned above - if group_speed is none of the 3 values I mentioned then it will error and it won't be gracefull. Let me know your group_speed setting and I can recode as requried.

  11. Gary Roderick

    Yep, that will do it. If you are up to editing testtags.php.tmpl you can replace circa line 488

    #if $unit.unit_type_dict.group_speed == "km_per_hour"
        #set $windrunUnits = " km"
    #elif $unit.unit_type_dict.group_speed == "mile_per_hour"
        #set $windrunUnits = " mi"
    #elif $unit.unit_type_dict.group_speed == "knot"
        #set $windrunUnits = " mi"
    #end if
    

    with

    #if $unit.unit_type_dict.group_speed == "km_per_hour" or $unit.unit_type_dict.group_speed == "meter_per_second"
        #set $windrunUnits = " km"
    #elif $unit.unit_type_dict.group_speed == "mile_per_hour"
        #set $windrunUnits = " mi"
    #elif $unit.unit_type_dict.group_speed == "knot"
        #set $windrunUnits = " mi"
    #end if
    

    Save testtags.php.tmpl and on the next archive period it should not throw the windrun error you have been getting. Windrun values will be nonsense but that is another fix.

  12. Gary Roderick

    Good news, I can see testtags.php dated 21 April 20:50 in your /weewx/WD so I guess there were no other errors. I will get a modified clientraw.txt.tmpl (to handle all the N/As) to you via email once I get it modded and tested. Might be in a few hours but you should have it before monring of 22nd your time.

  13. Kevin Roberts reporter

    Do I put them in WD folder?

    But looks like root (public_html)?

    That file do I need view?

  14. Gary Roderick

    You can put them in whatever folder you want as long as your web server can access them. Could put them in WD folder but might be neater from a housekeeping point of view if they are in their own. On my system I have them in /var/www/saratoga, anything Weewx/Weewx-WD generated goes into /var/www/WD and my standard Weewx pages/files (index.html etc) are in /var/www/weather. Horses for courses.

    You will need to edit Settings.php and Settings-weather.php. Key settings are date formats and units of measure. Also locations if you put things in different folders. The page you open is wxindex.php.

  15. Gary Roderick

    That's good. A few things to consider if you want:

    • moon icon is not displaying correctly, this is because the basic Weewx does not have the smarts to calculate moon age in days. Installing the pyephem python package gives weewx (and consequently Weewx-WD) the ability to do a whole lot more in terms of sun/moon/seasons. Without it weewx only provides approx sunrise/set and moon % and phase. With pyephem you get more accuracy, moon rise/set, phase times and age in days, solstice/equinox details. Ultimately it better populates sun/moon details on the dashboard and fills out most of the missing/incorrect date/times on Sun/Moon Almanac page. Up to you, very easy to install and instructions (instructions used to be very visible but with chnages to the manual if you do a .deb install they are easy to miss) are here http://weewx.com/docs/setup.htm.
    # optional for extended almanac information:
    sudo apt-get install python-dev
    sudo apt-get install python-pip
    sudo pip install pyephem
    
    • solar and UV. I gather your station does not have these. If so you can set $SITE['UV'] and $SITE['SOLAR'] to 'false' in Settings-weather.php and it should tidy up that part of your dashboard.

    • I see your dates are in d-m-y format. Was that intentional? Most folks I have seen from the US want m-d-y. Likewise your temps are in celsius. Are the temps realistic or do we have a double conversion like issue where Weewx/Weewx-WD is outputting F but Saratoga is then taking these as C and displaying as same. Similarly windspeed and rainfall. Are they realistic/what you expect. Sometimes rainfall can get confused and be out by a factor of 10. 10 odd inches of rain over 2 days is a lot!

  16. Kevin Roberts reporter

    The moon image is not working still? pyephem is installed now.

    Solar and UV done

    does rain look better now?

  17. Gary Roderick

    Guessing here but did you restart weewx after loading pyephem ? Trust no apparent errors when installing pyephem? Rain looks believable.

  18. Kevin Roberts reporter

    Radar Independence is not in correct location should be by Salem and it move around in sea with IR Sat

    WXSIM ?

    Station graphs images not found?

    Monthly reports ( will that show after full month?)

    Stats not current?

    Thanks Kevin

  19. Gary Roderick

    Long weekend here and unfortunately away from home till Sunday. Off the top of my head there should be a setting in Settings-weather.php for forecasts or wxsim, or it maybe in ajaxdashboard.php (not right name but something like that). Other issues not so easy a fix, will drop you an email over the next few days.

  20. Log in to comment