Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
wetter:ws500:wetter.cgi_konfiguration [04.01.2011 15:16. ] – Formatierung angepasst michi | wetter:ws500:wetter.cgi_konfiguration [31.10.2023 18:28. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Konfiguration von wetter.cgi ====== | ||
+ | |||
+ | Zur Darstellung der Messdaten verwendete ich das wetter.cgi aus dem Paket WS **2500** von Rainer Krinke. | ||
+ | |||
+ | Speziell für die Darstellung der Sonnenscheinwerte (sofern man bei dieser Station davon sprechen kann :-/ ) hat Rainer eine spezielle Version des wetter.cgi Scriptes geschrieben. Bei Bedarf einfach bei ihm Anfragen. | ||
+ | |||
+ | Der Konfigurationsteil aus dem Script für meine Station war: | ||
+ | < | ||
+ | # | ||
+ | |||
+ | $driver=" | ||
+ | $sysDbName=" | ||
+ | $dbServer=" | ||
+ | $dbUser=" | ||
+ | $dbPassword=" | ||
+ | $database=" | ||
+ | $defaultPort=" | ||
+ | |||
+ | # This variable controls if the *output* is in GMT or in Local time | ||
+ | # Internally very date and time value is in GMT. User input is converted to GMT. | ||
+ | $timeIsGMT=0; | ||
+ | # input as well as output is in | ||
+ | # GMT or in Local time. Internally every date and | ||
+ | # time value is in GMT. User input is converted | ||
+ | # to GMT if needed. | ||
+ | $colGrfxTable=2; | ||
+ | $initialDisplayDays=7; | ||
+ | $doAutoBaseData=185; | ||
+ | # this number of days we automatically use average | ||
+ | # values on hourly basis for display. If you don't | ||
+ | # want this, set this variable to 0 | ||
+ | $navPanelPos=" | ||
+ | # displayed. May be " | ||
+ | |||
+ | # If you assign a URL to this variable the target (should be a .css text file) | ||
+ | # is used to get all the css definitions instead of the internal definitions | ||
+ | # made below (search for variable $docCss). If you leave $externalCssUrl | ||
+ | # empty the internal definitions are used. | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Unit of Windspeed to be displayed | ||
+ | # 0: km/h, 1: Knots, 10: Knots and Km/h | ||
+ | $latestWindSpeedType=" | ||
+ | # TH=Temp/ | ||
+ | # Which sensor to display in Latest data section of display | ||
+ | # Only add Sensors you really have!!! | ||
+ | # eg: $latestSens=" | ||
+ | # By default for each sensor the sensor with its default Id is used | ||
+ | # usually " | ||
+ | # sensor (except for the type TH) with a | ||
+ | # different sensorId, then set the Variable %latestSensId like: | ||
+ | # | ||
+ | # meaning, that the rain sensor with the sensorId 2 will be displayed | ||
+ | # instead of the rain sensor with id 1. For a TH-sensor see $latest_th below. | ||
+ | # | ||
+ | $latestSens=" | ||
+ | $latest_th=[1]; | ||
+ | $latestSensId{" | ||
+ | $latestSensId{" | ||
+ | $latestSensId{" | ||
+ | $latestSensId{" | ||
+ | |||
+ | |||
+ | # If you secifies sensor type TH above, you can say here which T/H sensors | ||
+ | # should be displayed inlatest sensor display | ||
+ | $latest_th=[10, | ||
+ | # | ||
+ | # You may list more ids here like | ||
+ | # $latest_th=[1, | ||
+ | # *** You HAVE TO specify sens ids that *** | ||
+ | # *** really exist *** | ||
+ | |||
+ | # Some options that can be used to display data that is calculated from the | ||
+ | # original data values. The value on the right side is a list of logical names | ||
+ | # that can be calculated like WindChill and Dewpoint. | ||
+ | # The latest_do variable defines for the sensor type and sensor id that is noted on | ||
+ | # the left side, what shall be calculated with which another additional sensor id | ||
+ | # noted on the right side. . | ||
+ | # So $latest_do-> | ||
+ | # windchill temperature for the windsensor with id 1, based on the temperature | ||
+ | # sensor (right side) with sensor id 1 | ||
+ | # $latest_do-> | ||
+ | # dewpoint and the abolute humidity based on data of temp/hum sensor 1. | ||
+ | undef %latest_do; | ||
+ | # | ||
+ | # | ||
+ | $latest_do{" | ||
+ | $latest_do{" | ||
+ | |||
+ | # This variable lets you omit some values from the latest data display of one sensor | ||
+ | # If you want eg not to display the Humidity value of a TH sensor but only the | ||
+ | # temperature in the latest data section of this sensor | ||
+ | # the following will do the job for a sensor with sensor id 1 | ||
+ | # The value (" | ||
+ | # | ||
+ | $latest_omit{" | ||
+ | |||
+ | # For rain and pressure sensors you can activate the trendData display. Doing this | ||
+ | # shows at *most* 3 older values from these sensors (as well as the current value anyway) | ||
+ | # in the latest display. Note: Only *3* values are allowed since there is no more room for more | ||
+ | # values. You have to specify the number of hours for each of the three values of each sensor. | ||
+ | # If you e.g. say: 1h,6h,12h this means that for this sensor the value one/six/12 hour(s) ago will be | ||
+ | # displayed. Please keep the format: eg " | ||
+ | # values to be displayed say eg: $latest_trendRain=[ ]; | ||
+ | $latest_trendRain=[ " | ||
+ | $latest_trendPressure=[ " | ||
+ | $latest_trendLight=[ " | ||
+ | |||
+ | # | ||
+ | # Watch out this is for a trend sign (up or downarrow) for temperature/ | ||
+ | # sensors. The left value is the sensorid, the right value the time in *MINUTES* | ||
+ | # to look back in order to compare this value with the current one. | ||
+ | # So " | ||
+ | # is 10 minutes old. For each sensor only one value is allowed here. | ||
+ | # Be sure to choose a time that is long enough. If eg your station collects data at an | ||
+ | # interval of 15 minutes it does not make sense to use eg 10 minutes below. | ||
+ | # You can define it here for all sensors it will be used only for those you | ||
+ | # add below using addSensor() | ||
+ | $latest_trendTemp=[ " | ||
+ | |||
+ | # The threshold values for sensors which show trends by an arrow sign. If the difference | ||
+ | # of the current value of such a sensor and an older value is larger than the first value | ||
+ | # given below an arrow (up or down) will be displayed. | ||
+ | # The values given below define ranges for the value difference. For example the | ||
+ | # values 0.1, 0.2, 0.4 define three ranges: | ||
+ | # Differencevalues smaller than the first value (here:0.1) will not be decorated | ||
+ | # with a trend sign. Depending on which range the current difference fits in, a different | ||
+ | # symbol for "small change", | ||
+ | # Exactly three values a,b,c (defining three ranges) are allowed. | ||
+ | $latest_trendThresholdT=[" | ||
+ | $latest_trendThresholdH=[" | ||
+ | $latest_trendThresholdPres=[" | ||
+ | |||
+ | |||
+ | # The trend-symbol definition. There are three up and three down symbols that indicate | ||
+ | # a week, average and a strong thrend up or down. | ||
+ | $latest_trendSymbDown= ['< | ||
+ | '< | ||
+ | '< | ||
+ | # | ||
+ | $latest_trendSymbUp=['< | ||
+ | '< | ||
+ | '< | ||
+ | |||
+ | # You may choose if a trend symbol or the symbol and the difference value or | ||
+ | # only the difference value without a symbol should be printed. | ||
+ | $latest_trendSymbMode=" | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # The colors for different amounts of the difference. Corresponds to | ||
+ | # $latest_trendSymbDown[123] and $latest_trendSymbUp[123] | ||
+ | $latest_trendSymbTextCol=[" | ||
+ | # Relative text size: Allowed are values like -1, -2, ... which makes the text size | ||
+ | # used for printing the value one, two, ... steps smaller than regular text. | ||
+ | $latest_trendSymbTextSize=" | ||
+ | | ||
+ | # This variable controls whether in the latest data output a sensors errors | ||
+ | # will be displayed. If its !=0 then if a sensor had more dropouts in the last | ||
+ | # hours (given by $latestAlertHours) the sensors name will be printed in | ||
+ | # the color $latestAlertColor, | ||
+ | # to much errors (==drop outs) in this period of time. | ||
+ | # The numbers of errors is taken from the error table in the database. | ||
+ | # So, for example | ||
+ | # you could say, that if any of sensors displayed in the latest data section | ||
+ | # had more than 10 errors in the last 12 hours then display its name in red: | ||
+ | # | ||
+ | $latestAlertErrCount=10; | ||
+ | $latestAlertHours=12; | ||
+ | $latestAlertColor=" | ||
+ | |||
+ | |||
+ | $tmpName=" | ||
+ | # Path where the created images are stored | ||
+ | # | ||
+ | $basePath="/ | ||
+ | |||
+ | # | ||
+ | $imgPath=" | ||
+ | # URL to access the images in Path " | ||
+ | # | ||
+ | $baseImgUrl=" | ||
+ | |||
+ | # Default Id for wether station. 1 ist the id for the first one | ||
+ | # You may add a different station ID to each individual sensor description | ||
+ | # created by addSensor() below by simply adding eg: " | ||
+ | # to the addSensor call. | ||
+ | $defaultStationId=1; | ||
+ | |||
+ | # Next you define all the sensor graphics that will be displayed in a HTML table | ||
+ | # For each sensor you want to add, you have to write down a addSensor() call | ||
+ | # with appropriate paramters. Bevor the first call to addSensor() you have to create | ||
+ | # an object of Class " | ||
+ | # see below) with sensDisplayData-> | ||
+ | # This has to be done excatly ONE time, and then you can place calls to addSensor() | ||
+ | # using the just created object. The minimum of information in the first parameter | ||
+ | # (the first hash, surrounded by {}) in addSensor() is the sensor | ||
+ | # type which may be one of TH, PR, WI, WD, WA, RA, LI. | ||
+ | # TH is a Temperature Himidity display | ||
+ | # PR is the air pressure display | ||
+ | # WI is the wind display sowing the windspeed over time | ||
+ | # WD is the wind display, showing the direction and speed in a polar | ||
+ | # coordinate system | ||
+ | # WA is the winddisplay showing the winddirection and varince over time | ||
+ | # LI is the light display. | ||
+ | #All Parameters are given in a anonymous | ||
+ | # hash ({" | ||
+ | # can specify all the parameters defined in the set?? | ||
+ | # where ?? is one of the Types from above (TH, ...). You probably want to specify | ||
+ | # the sensorid of the sensor to be displayed, else the default sensorId for each | ||
+ | # type is used. To specify one or more sensorids for one graphics simply add | ||
+ | # the ids like {" | ||
+ | # display T/H sensors with id 1,2 and 17 in one graphic. | ||
+ | # Especially for TH sensors where temperature and humidity can be printed | ||
+ | # it might be useful to be able to display just one of both or even none of | ||
+ | # both but just the windchill value (a virtual sensor) based on this sensor. | ||
+ | # To do so just set the omit array to the values that should not be printed. eg: | ||
+ | # " | ||
+ | # virtual sensor defined you would' | ||
+ | # no output values to be displayed! So always take care that there is at least one value left | ||
+ | # one of a T, H value or a virtual sensor value. | ||
+ | # | ||
+ | # For some sensors it might be useful to let gnuplot automatically calculate | ||
+ | # the Y-range. Usually the lower value is set by the script to a fix value. | ||
+ | # For TH-Sensors this is eg 0". If you would like to let gnuplot | ||
+ | # determine the Y bounds by itself set " | ||
+ | # addsensor() call like shown below. | ||
+ | # | ||
+ | # If you do not like the default sizes of the graphics you can modify them for each sensor | ||
+ | # by adding non default values to the addSensorCall like | ||
+ | # | ||
+ | # " | ||
+ | # " | ||
+ | # { } ); | ||
+ | # the Smallscale Variables desscribes the relative size of a graphic in the overview, whereas | ||
+ | # the NormalScale Variables determine the relative size in the detailed sensor graphics | ||
+ | # The default for SmallScale is 0.5, the default for NormalScale is 1.1. These values are multiplied | ||
+ | # with the default width/ | ||
+ | # The " | ||
+ | # | ||
+ | # By default all sensors (exepct WA, WD) defined by addSensor() will also be used in the | ||
+ | # statisticsMode. This may lead to a strange looking statistics table in | ||
+ | # case that one real sensor is shown in two graphics for example with | ||
+ | # different virtual sensor values. In the statistics display this would lead to the fact | ||
+ | # that the same sensor beeing shown twice with the same statistic values since | ||
+ | # the statistic display | ||
+ | # If a sensor that is defined by addSensor shall NOT be visible in the statistics overview | ||
+ | # then one may set the attribute " | ||
+ | # | ||
+ | # | ||
+ | # " | ||
+ | # " | ||
+ | # " | ||
+ | # { } ); | ||
+ | # | ||
+ | # It is even possible to define sensors only for statistic evaluation that will | ||
+ | # never be displayed in a graphics. This can be done by setting the " | ||
+ | # flag to " | ||
+ | # | ||
+ | # | ||
+ | # " | ||
+ | # | ||
+ | # In this case the sensor will not be visible as a graphics but will appear in the | ||
+ | # statistics display. | ||
+ | # | ||
+ | # In such a case the sensor is shown in the graphics mode but is hidden in the | ||
+ | # statistics mode. | ||
+ | # | ||
+ | # The addSensor() function actually has two Parameters. The first one has been descibed just above. | ||
+ | # The second one describes which virtual sensors (if there are any defined in the | ||
+ | # set*defaults() functions) should be active. | ||
+ | # At the moment only for TH-sensors there are virtual sensors for windchill, | ||
+ | # absolute humidity and dewpoint calculation. To activate one of them for a | ||
+ | # TH-sensor the second parameter for addSensor() is a hash like: | ||
+ | # {" | ||
+ | # In this hash virtual sensors can be turned on by assigning them a " | ||
+ | # If left undefined ({}) or even omitted no virtual sensors will be displayed. | ||
+ | # Please take care of the spelling of the virtual sensor names given above | ||
+ | # Only one or all in the three (windChill, absHumidity, | ||
+ | # | ||
+ | # The wind sensor can be configured to plot data in kts instead of km/h | ||
+ | # To do so simply put the directive " | ||
+ | # The example below. " | ||
+ | # You can set this option for every WI (Windspeed) and WD (Winddirection/ | ||
+ | # plot type individually. | ||
+ | # | ||
+ | # Attention. Either define the sensors here NOT using a config file or | ||
+ | # comment out the demo defs below and put the real definitions into | ||
+ | # your config file. But DONT put addSensor()-calls | ||
+ | # the sensDisplayData object in both the script and | ||
+ | # your config file, since this will result in nonesense or even an error! | ||
+ | # Values you might find useful to change are marked as USER in function | ||
+ | # setTHdefaults(). The same is of course true for the other sensor types not | ||
+ | # only for T/H. | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # " | ||
+ | # " | ||
+ | # { | ||
+ | # | ||
+ | # Now we want to define a TH sensor with virtual sensors windChill and | ||
+ | # dewPoint activated: | ||
+ | # | ||
+ | # {" | ||
+ | # The same like above but we only want to print the virtual sensor values | ||
+ | # not temperature or Humidity | ||
+ | # | ||
+ | # {" | ||
+ | # | ||
+ | # Defined a TH sensor with sensid 3 but do not activate any virtual sensors | ||
+ | # for it, so only temp and humidity will be displayed | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | |||
+ | $sensorData=sensDisplayData-> | ||
+ | |||
+ | |||
+ | $tmp=$sensorData-> | ||
+ | | ||
+ | $sensorData-> | ||
+ | |||
+ | # | ||
+ | |||
+ | $tmp=$sensorData-> | ||
+ | " | ||
+ | $sensorData-> | ||
+ | $sensorData-> | ||
+ | | ||
+ | $tmp=$sensorData-> | ||
+ | " | ||
+ | | ||
+ | $tmp=$sensorData-> | ||
+ | " | ||
+ | $sensorData-> | ||
+ | | ||
+ | $sensorData-> | ||
+ | | ||
+ | # | ||
+ | $sensorData-> | ||
+ | $sensorData-> | ||
+ | | ||
+ | $sensorData-> | ||
+ | $sensorData-> | ||
+ | $sensorData-> | ||
+ | | ||
+ | |||
+ | $position=" | ||
+ | $pageTitle=" | ||
+ | $pageAuthors=' | ||
+ | $pageDescription=" | ||
+ | |||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Your contact address | ||
+ | $contact=' | ||
+ | $pageMetaKeywords=" | ||
+ | $pageBackgroundPicture=" | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | $pageBackgroundColor="# | ||
+ | $pageTextColor="# | ||
+ | $pageLinkColor=" | ||
+ | $pageVisitedLinkColor=" | ||
+ | # Gnuplot background colors for graphics | ||
+ | $bgColorNormal=" | ||
+ | $bgColorAverage=" | ||
+ | # DST config, values are set by checkDst() | ||
+ | $dstStart=" | ||
+ | $deltaIsDst=2; | ||
+ | $dstEnd=" | ||
+ | $deltaNoDst=1; | ||
+ | |||
+ | # Some queries may be optimized by using SQL subqueries. Subqueries are | ||
+ | # available since MYSQL Server Version 4.1. They seem to work really | ||
+ | # efficiently starting with MYSQL 5.0 | ||
+ | # The variable below determines if the script should use subqueries | ||
+ | # for MMA determination. Usually this variable is set automatically | ||
+ | # to 0 or 1 depending on the MYSQL server version. If this is > 5.0 it | ||
+ | # is set to 1 else to 0. You can however overwrite this automatic here by | ||
+ | # manually setting this variable to either 0 or 1. | ||
+ | # If you want to use the automatic | ||
+ | # setting put a comment sign (#) at the beginning of the line. | ||
+ | # Note: You need at leaset MYSQL version 4.1 if you want to use subqueries | ||
+ | # else you will see SQL errors. | ||
+ | # $useSqlSubQueries=1; | ||
+ | |||
+ | |||
+ | # *** You can copy all the variables between START CONFIG and END CONFIG | ||
+ | # *** into a file that can be reached by your web-server unter the path | ||
+ | # *** given below in $configpath. $configPath is set to the value of the | ||
+ | # *** scriptname (eg wetter.cgi) with " | ||
+ | # *** and path are retrieved from the webservers environment variable | ||
+ | # *** named SCRIPT_FILENAME. apache on linux does provide this variable. | ||
+ | # *** If the given file exists and is readable | ||
+ | # *** the scripts config will be read from there overriding the variables | ||
+ | # *** set above. So then you do not have to modify | ||
+ | # *** further entries in the script itself e.g. for new versions. | ||
+ | # *** Take care that your config file contains a valid perl-script if | ||
+ | # *** unsure use perl -c wetter.cgi.conf to check the syntax, because | ||
+ | # *** running wetter.cgi you won't see an error if your config file is | ||
+ | # *** wrong!!!!! You will just see, that wetter.cgi is not showing any | ||
+ | # *** output. | ||
+ | # *** Please take care that your config file is readable only by you and your | ||
+ | # *** web server but not to anyone else! | ||
+ | # *** If this method fails you can still hard code a value for | ||
+ | # *** $configPath in the last else-branch of the if staement. | ||
+ | # R.K. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | #if( defined($ENV{" | ||
+ | # | ||
+ | #}elsif( defined($ENV{" | ||
+ | # | ||
+ | #}else{ | ||
+ | # if( -r " | ||
+ | # | ||
+ | # }elsif(-r "/ | ||
+ | # | ||
+ | # }else{ | ||
+ | # | ||
+ | # } | ||
+ | #} | ||
+ | |||
+ | $scriptBasename=`basename $0`; | ||
+ | chomp($scriptBasename); | ||
+ | if( defined($ENV{" | ||
+ | $configPath=$ENV{" | ||
+ | }elsif( defined($ENV{" | ||
+ | $configPath=$ENV{" | ||
+ | }else{ | ||
+ | if( -r " | ||
+ | $configPath=" | ||
+ | }elsif(-r "/ | ||
+ | $configPath="/ | ||
+ | }else{ | ||
+ | $configPath="/ | ||
+ | } | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # -------- END CONFIG VARIABLES ---------------------------------------------</ | ||
+ | |||
+ | [[wetter: | ||