Browse code

initial release

gandolf authored on 01/13/2020 03:50:38
Showing 10 changed files
... ...
@@ -10,15 +10,22 @@
10 10
 <h4>Contents</h4>
11 11
 
12 12
 <p><b>Yaesu FT991A Transceiver</b><br>
13
+<ul>
13 14
 Includes utilities for<br>
14 15
   * CAT command passthrough for software development<br>
15 16
   * Programming FT991 vfo/channel memory<br>
16 17
   * Backup FT991 Configuration (menu items)<br>
18
+</ul>
17 19
 </p>
18 20
 
19 21
 <p>
20
-<b>Future projects</b><br>
22
+<b>FT991A Future projects</b><br>
21 23
   * Web based interface for Internet remote control<br>
22 24
 </p>
25
+
26
+<p>
27
+<b>AREDN Mesh</b>
28
+  * Web app for viewing long term SNR statistics
29
+</p>
23 30
 </body>
24 31
 </html>
25 32
new file mode 100755
... ...
@@ -0,0 +1,29 @@
1
+#!/bin/bash
2
+#
3
+# The monitor url can look something like http://192.168.1.155, or
4
+# something linke http://radiationMonitor.domain.com depending on
5
+# whether your local network uses a domain name server.
6
+#
7
+
8
+APP_PATH="/home/$USER/bin"
9
+LOG_PATH="/home/$USER/log"
10
+
11
+if [ `hostname` == "raspi2" ]; then
12
+  AGENT_NAME="[a]rednsigAgent.py"
13
+  NODE_URL="-u http://192.168.1.30/cgi-bin/signal.json"
14
+else
15
+  AGENT_NAME="[a]rednsigMirrorAgent.py"
16
+  NODE_URL="-u http://73.157.139.23:7361/arednsig/dynamic/arednsigOutputData.js"
17
+fi
18
+
19
+PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')"
20
+
21
+if [ -n "$PROCESS_ID" ]; then
22
+  if [ "$1" != "-q" ]; then
23
+    printf "arednsig agent running [%s]\n" $PROCESS_ID
24
+  fi
25
+else
26
+  printf "starting up arednsig agent\n"
27
+  cd $APP_PATH
28
+  ./$AGENT_NAME $NODE_URL >> $LOG_PATH/arednsigAgent.log 2>&1 &
29
+fi
0 30
new file mode 100755
... ...
@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+# Stop the radmon agent process and clean up environment.
3
+
4
+if [ `hostname` == "raspi2" ]; then
5
+  AGENT_NAME="[a]rednsigAgent.py"
6
+else
7
+  AGENT_NAME="[a]rednsigMirrorAgent.py"
8
+fi
9
+
10
+PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')"
11
+
12
+if [ -n "$PROCESS_ID" ]; then
13
+  printf "killing arednsig agent [%s]\n" $PROCESS_ID
14
+  kill $PROCESS_ID
15
+else
16
+  echo arednsig agent not running
17
+fi
0 18
new file mode 100755
... ...
@@ -0,0 +1,662 @@
1
+#!/usr/bin/python -u
2
+# The -u option above turns off block buffering of python output. This 
3
+# assures that each error message gets individually printed to the log file.
4
+#
5
+# Module: arednsigAgent.py
6
+#
7
+# Description: This module acts as an agent between the aredn node
8
+# and aredn mesh web services.  The agent periodically sends an http
9
+# request to the aredn node, processes the response from
10
+# the node, and performs a number of operations:
11
+#     - conversion of data items
12
+#     - update a round robin (rrdtool) database with the node data
13
+#     - periodically generate graphic charts for display in html documents
14
+#     - write the processed radmon data to a JSON file for use by html
15
+#       documents
16
+#
17
+# Copyright 2020 Jeff Owrey
18
+#    This program is free software: you can redistribute it and/or modify
19
+#    it under the terms of the GNU General Public License as published by
20
+#    the Free Software Foundation, either version 3 of the License, or
21
+#    (at your option) any later version.
22
+#
23
+#    This program is distributed in the hope that it will be useful,
24
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
+#    GNU General Public License for more details.
27
+#
28
+#    You should have received a copy of the GNU General Public License
29
+#    along with this program.  If not, see http://www.gnu.org/license.
30
+#
31
+# Revision History
32
+#   * v20 released 11 Jan 2020 by J L Owrey; first release
33
+#
34
+#2345678901234567890123456789012345678901234567890123456789012345678901234567890
35
+
36
+import os
37
+import urllib2
38
+import sys
39
+import signal
40
+import subprocess
41
+import multiprocessing
42
+import time
43
+import json
44
+
45
+_USER = os.environ['USER']
46
+
47
+   ### DEFAULT AREDN NODE URL ###
48
+
49
+# ip address of the aredn node
50
+_DEFAULT_AREDN_NODE_URL = "http://192.168.1.30/cgi-bin/signal.json"
51
+
52
+    ### FILE AND FOLDER LOCATIONS ###
53
+
54
+# folder for containing dynamic data objects
55
+_DOCROOT_PATH = "/home/%s/public_html/arednsig/" % _USER
56
+# folder for charts and output data file
57
+_CHARTS_DIRECTORY = _DOCROOT_PATH + "dynamic/"
58