Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ var/dongleshift.txt
var/gsm_channel.txt
var/www/*.html
var/www/*.tmp
modules/noaa/noaa.conf
modules/meteor-m2/meteor.conf
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Variable data.
dongleshift.txt - current dongle shift
nextpass.* - list and plot of the next passes
tle/ - directory with tle data
flask/ - flask webserver stuff (see flask documentation):
node/ - NodeJS webserver stuff (see NodeJS documentation):
static/ - css, js
templates/ - html template(s)
www/ - stuff for static webpages; templates and output data
Expand All @@ -273,7 +273,7 @@ The web page is generated into `/var/www/` (the default location).

# Webserver

autowx2 is equipped with a simple flask webserver showing what is going on - displaying current logs (with some limitations, i.e., not showing logs of external programs - solution needed) and updated pass list.
autowx2 is equipped with a simple NodeJS webserver showing what is going on - displaying current logs (with some limitations, i.e., not showing logs of external programs - solution needed) and updated pass list.

![static web page](docs/www-dynamic+shadow.jpg)

Expand Down
3 changes: 2 additions & 1 deletion _listvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ echo $stationName
# add some environmental variables
#

export autowx2version=$(cd $baseDir && git describe --tags)
export autowx2version=$(cd $baseDir && git describe --all)

26 changes: 16 additions & 10 deletions autowx2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@
#

# from autowx2_conf import * # configuration
from autowx2_functions import * # all functions and magic hidden here
# all functions and magic hidden here
from autowx2_conf import cleanupRtl
from autowx2_functions import log, saveToFile, wwwDir, time, debugPrint
from autowx2_functions import killRtl, mainLoop, process

# ------------------------------------------------------------------------------------------------------ #


if __name__ == "__main__":
log("⚡ Program start")
saveToFile("%s/start.tmp" % (wwwDir), str(time.time())) # saves program start date to file
# saves program start date to file
saveToFile("%s/start.tmp" % (wwwDir), str(time.time()))

debugPrint("Main program started")

if cleanupRtl:
log("Killing all remaining rtl_* processes...")
justRun(["bin/kill_rtl.sh"], loggingDir)
killRtl()

while True:
t1 = Thread(target = mainLoop)
t1.setDaemon(True)
t1.start()
# app.run(debug=True, port=webInterfacePort)

socketio.run(app, port=webInterfacePort, debug=False)
debugPrint("Main loop started")
try:
mainLoop()
finally:
print("[MAIN] Main loop exited for some reason. Check the logs.")
process.terminate()
Loading