Differences from base OpenJ2300 0.21:
CREATE TABLE OUTSIDE_TEMP( TEMPERATURE DOUBLE, HUMIDITY INTEGER, TIME DATETIME ) ; CREATE TABLE WIND(SPEED DOUBLE,DIRECTION DOUBLE,GUST DOUBLE,TIME DATETIME) ; CREATE TABLE RAIN(TOTAL DOUBLE,TIME DATETIME) ; CREATE TABLE PRESSURE(RELATIVE DOUBLE,TIME DATETIME) ; CREATE INDEX WINDTIME ON WIND (TIME); create index TEMPTIME on OUTSIDE_TEMP( TIME ); create index RAINTIME on RAIN( TIME ); create index PRESTIME on PRESSURE( TIME );
2) Copy librxtxSerial.so to %JAVA_HOME%/jre/lib/i386, (%JAVA_HOME% is the folder where JRE is installed on your system; e.g. /usr/local/j2sdk1.4.1_01)
3) Copy RXTXcomm.jar to %JAVA_HOME%/jre/lib/ext
4) Extract openj2300-0.21-pb-2.0-bin.zip into new empty directory, for example /opt/meteo.
Change permissions on run.sh (
chmod u+x run.sh). Change paths in run.sh for your environment.
[Windows: change run.bat in the same way]
5) Change configuration in OpenJ2300.properties. You have to set the following fields:
6) Run "run.sh" [Windows: run.bat] and look for result in logfiles (in log/ directory). Does everything seems OK? Stop the running application.
7) Add the application into crontab:
*/10 * * * * /opt/meteo/run.sh >/opt/meteo/log/cron.log 2>&1Yes, it is run every 10 minutes. It is for ensuring the application will run even if it encounters any problem (because the application is "fail-fast" - it ends after any problem).
8) Wait 15 minutes. Check logfiles and data in database.
9) Extract web application into your WWW server's directory. Change configuration in _lib/_config.php.
2400, 8 bits, 1 stopbit, PARITY_NONE
As described in
DTR and RTS are not used for handshake by LaCrosse weather stations. They are steady DTR at negative voltage and RTS at positive voltage.
Since there is no ground it seems that the WS2300 uses the DTR and RTS to define high and low.
DTR must be low and RTS must be high for the communication to work.
BUT my Ethernet/Serial converter Lantronix MSS-100 doesn't allow user to control DTR/RTS wires and both signals were high (+12V) all the time. There is no wire with low (-12V) on connector. So I tried to connect DTR directly to GND... and it works.
In order to start communication with your weather station via serial-over-ethernet, you have to set DTR low and RTS high. If your serial-over-ethernet doesn't support setting this from management console, you have to change wiring weather station's cable as I did.
3) If you have some data in HSQLDB format from the original OpenJ2300 (open2300.script file), you may convert it to MySQL format:
sed "s/..000000'/'/" <open2300.script >2open2300.script sed "s/)/);/" <2open2300.script >3open2300.script
mysql --user=root --password=DBPASSWORD meteo <3open2300.script