== Component name == Name: LabEnv v1.2 Type: BASE extension Full name: Lab Environment Extension == Requirements == 1. BASE 3.2.2 or later. == Introduction == This package is an extension package to BASE that allows storage of regular measurements of lab environment data through ThermoWorks Thermo Recoder TR-702W sensors placed in the labs, and inspection of the stored values. * The homepage for this extension: http://baseplugins.thep.lu.se/wiki/net.sf.basedb.labenv == Installation == 1. Download the `labenv-*.tar.gz` file. 2. Unpack the downloaded file to a directory of your choice. 3. Place a copy of JAR file `sqlite-jdbc-*.jar` in the Tomcat `lib/` directory. 4. Copy the `labenv-config.xml` file to `WEB-INF/classes` directory. 5. The default `labenv-config.xml` file does not contain any useful configuration values, but has to be edited with information on the lab sensors. a. Configuration of database for lab environment data and settings common for all lab sensors. If no values are given for "dbfilename", "timeoutinseconds", "storageintervalinseconds", and "numberofmeasurementsperstoredvalue", default values "labenv.db", 5, 300, and 5, will be used, respectively. This corresponds to measurements each minute and storage of the average values every 5th minute. If alarm notification via e-mail is desired, information about what e-mail server to use must be entered for "smtphost". Attribute "fromaddress" is the e-mail address shown in the "From"-field for the mail; normally this is of the type "noreply@*" here, e.g. "noreply@thep.lu.se". Attribute "fromname" is the name part of the "From"-field for the mail, e.g. something generic like "Lab Environment BASE extension", or something more specific for your BASE server or lab. b. Measurement data will be stored in the database for the sensor number defined in the configuration file. This lab sensor number is therefore not just a trivial index number for internal use in the XML configuration file. When sensors are added for new locations, they should normally be configured with a new unique number. If no "startdate" is given for a sensor, it will be ignored. c. Alarm configuration for a lab sensor is optional. One or more alarm configurations can be entered for each sensor. Each alarm configuration contains start and end time in "HHmm" format, a weekday filter with one of the values "all", "mondaytofriday", "saturdaytosunday", "workdays", or "nonworkdays" (last two entries are currently adapted to the automatic climate control at labs in Medicon Village, Lund University, Sweden), minimum and maximum allowed values for temperature and humidity, and a user list of alarm administrators. For each alarm administrator is entered the BASE log-in name ("id"), and an optional e-mail address for alarm notification. 6. Copy the 'labenv.jar' file to your BASE plug-ins directory. Look in your 'base.config' file if you don't know where this is. 7. Go to 'Administrate->Plug-ins & Extensions->Overview' page. 8. Run the installation wizard and select to install 'labenv.jar'. 9. The LabEnv Server should now be running, and collect data from the configured sensors regularly, and store the average values in the local database. The BASE `Extensions` menu should now have a new cascade menu entry `Lab Environment`, with child menu items for different functionality of the extension, such as retrieving configuration data from the sensors, or inspecting the data stored in the database. 10. If the BASE server running the LabEnv extension is placed at a location different from that of the labs, where the sensors are installed, firewalls must be configured to allow the BASE server to access the internal web servers of the sensors, for lab environment data to be collected (port 80 has to be opened). 11. Done. == Known issues == * No known issues. == Tips and tricks == * It is recommended to configure the extension to make a number of measurements per stored value, as this will reduce the instrument noise in the stored data (the average value will be stored), and reduce the size of the database. * If a lab sensor is out of work for a longer time period (whether due to problem with the sensor or the network connection), you can configure the LabEnv extension to skip this sensor, when acquiring data. This is done by setting the start date for the sensor in question to a blank value in the configuration file `labenv-config.xml`, and restarting the extension. * If a malfunctioning sensor for an important location needs to be temporarily exchanged for a working sensor internally configured for a another, less important, location, and there is no time to re-configure the latter sensor internally, the lab environment configuration file can be modified so the measurements from the temporary sensor are stored for the sensor number of the malfunctioning one. == Compiling == To compile this package you also need: 1. Ant 1.8 2. Java 1.6 Follow these instructions: 1. Download the source code from the subversion repository. See http://baseplugins.thep.lu.se/wiki/net.sf.basedb.labenv for instructions. 2. Type `ant download-lib` to automatically download the BASE core JAR file that are needed for compilation. You can also do this manually by copying the base-core-3.*.jar and base-webclient-3.*.jar files from the BASE installation directory (`/www/WEB-INF/lib/`) to the `./lib/compile` directory. 3. Type `ant` to compile the code and generate the `labenv.jar` file in the project directory. 4. Use `ant package` to create a downloadable tar.gz package. Tip: If you need different values for any of the properties defined in the 'build.xml' file, create a file named 'build.properties' and set the values there. == Alarm functionality == * After an alarm has been reported, new alarm reports for that configuration are normally blocked, until an alarm administrator resets the alarm. An exception is alarm for lost contact with the sensor, that blocks alarms of the same type, but not alarms for temperature or humidity values outside allowed values, if contact with the sensor should be reestablished. * All alarms are reset if the Lab Environment service is restarted. * All users can inspect alarm status via menu Extensions -> Lab Environment -> Lab environment alarms, but only an alarm administrator for an alarn can reset it. It is reset by setting option "Alarm blocked" to "No" and clicking button "Set alarm blocker".