Gateway Dstarmon

From KJ4BYI D-Star Wiki

Jump to: navigation, search

First you will need to configure perl to have some additional modules. link

Next you will need to download the postgresql jar file

Tested verson with D-Star Pg Engine:
postgresql-8.3-603.jdbc3.jar

Modify monstart.sh

javadir=/opt/products/dstar/j2se/jre/bin/java

arg1=DStarMonitor.jar
arg2=javAPRSSrvr.jar
arg3=jpcap-0.01.16/jars/net.sourceforge.jpcap-0.01.16.jar
arg4=mysql-connector-java-5.1.6-bin.jar
arg5=postgresql-8.3-603.jdbc3.jar

$javadir -cp $arg1:$arg2:$arg3:$arg4:$arg5 Main &

You will then need to create the postgres username and password to be used by dstarmon.

access psql via the username that dstar gw service uses

psql -U dstar dstar_global

Then Create the User, and then Create the Database.

CREATE USER dstarmon PASSWORD 'dstar123';
CREATE DATABASE dstarmon OWNER = dstarmon;
Then Logoff by typing
\q
and log in under the new username and password.
psql -U dstarmon dstarmon

Now, Create the Tables Needed by dstarmon.

CREATE TABLE LastHeard ( 
     ReportTime timestamp NOT NULL, 
     StationCall char(8) NOT NULL PRIMARY KEY, 
     RepeaterCall char(8) NOT NULL, 
     XmtType char(1) NOT NULL ,
     iXmtType smallint NULL, 
     Flag1 smallint NULL, 
     Flag2 smallint NULL, 
     Flag3 smallint NULL, 
     DestRptr char(8) NULL, 
     SrcRptr char(8) NULL, 
     DestStn char(8) NULL, 
     SrcStn char(8) NULL, 
     SrcStnExt char(4) NULL, 
     Length int NULL
); 

CREATE INDEX RepeaterCall ON LastHeard (RepeaterCall); 

CREATE TABLE LastXmt ( 
     StartTime timestamp NOT NULL, 
     Duration int NOT NULL, 
     XmtType smallint NOT NULL, 
     Flag1 smallint NOT NULL, 
     Flag2 smallint NOT NULL, 
     Flag3 smallint NOT NULL, 
     DestRptr char(8) NOT NULL, 
     SrcRptr char(8) NOT NULL, 
     DestStn char(8) NOT NULL, 
     SrcStn char(8) NOT NULL, 
     SrcStnExt char(4) NOT NULL, 
     Length int NULL
); 

CREATE INDEX StartTime ON LastXmt (StartTime); 
CREATE INDEX SrcStn ON LastXmt (SrcStn); 
CREATE INDEX DestStn ON LastXmt (DestStn);

Now, edit the dstarmon.properties page, and define the local connection.


(note) you will need to change the existing config to have the "1" on the end of each parm

LHDriver1=com.mysql.jdbc.Driver
LHURI1=jdbc:mysql://xxxxxxxxxxxxxxxxxxxxxxxx
LHParameters1=user;xxxxxx;password;xxxxx

Add:

LHDriver2=org.postgresql.Driver
LHURI2=jdbc:postgresql://127.0.0.1/dstarmon
LHParameters2=user;dstarmon;password;dstar123

LXDriver1=org.postgresql.Driver
LXURI1=jdbc:postgresql://127.0.0.1/dstarmon
LXParameters1=user;dstarmon;password;dstar123

More To Come....

Personal tools