Skip to content

Commit

Permalink
Merge pull request #105 from phate999/master
Browse files Browse the repository at this point in the history
MSS 2.5.5 Added version to HTML via JQuery
  • Loading branch information
phate999 authored Dec 15, 2023
2 parents 7fa055b + 4455b70 commit 6aa443d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
10 changes: 7 additions & 3 deletions Mobile_Site_Survey/Mobile_Site_Survey.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Mobile Site Survey - Drive testing application for cellular diagnostics with speedtests.
Access web interface on port 8000. Results CSV files can be accessed on port 8001.
Access web interface on port 8000.
Collects GPS, interface diagnostics, and speedtests and writes results to csv file.
Also supports https://5g-ready.io for data aggregation and export.
Results are also put in the description field for easy viewing in NCM devices grid.
Expand Down Expand Up @@ -55,6 +55,7 @@ def get(self):
"""Return app config in JSON for web UI."""
config = get_config('Mobile_Site_Survey')
config["results"] = dispatcher.results
config["version"] = dispatcher.version
self.write(json.dumps(config))
return

Expand Down Expand Up @@ -171,15 +172,15 @@ def __init__(self):
patch = package.get('Mobile_Site_Survey', 'version_patch')
self.version = f'{major}.{minor}.{patch}'
cp.log(f'Version: {self.version}')
if self.config["dead_reckoning"]:
enable_GPS_send_to_server()

def loop(self):
last_location = None
next_timer = None
self.router_id = cp.get('status/ecm/client_id') or 0
while True:
try:
if self.config["dead_reckoning"]:
enable_GPS_send_to_server()
self.modems = get_connected_wans()
# Run pings:
if self.config["packet_loss"]:
Expand Down Expand Up @@ -401,6 +402,9 @@ def get_appdata(name):

def get_config(name):
config = get_appdata(name)
if config.get('dead_reckoning') is None:
config['dead_reckoning'] = False
save_config(config)
if not config:
config = settings
cp.post('config/system/sdk/appdata', {"name": name, "value": json.dumps(config)})
Expand Down
9 changes: 4 additions & 5 deletions Mobile_Site_Survey/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@


<div class="x-panel x-border-item x-box-item x-panel-center-side" id="panel-1033" style="top:100px; left:40px">
<center><h2>Mobile Site Survey v2.5</h2></center>
<center><h2 id="version">Mobile Site Survey</h2></center>
<table>
<tr>
<td>
Expand Down Expand Up @@ -73,17 +73,16 @@ <h4>Configuration:</h4>
<label for="speedtests">Run Speedtests</label><br>
<input type="checkbox" name="packet_loss" id="packet_loss" value=1>
<label for="packet_loss">Monitor Packet Loss between tests</label><br>
<input type="checkbox" name="full_diagnostics" id="full_diagnostics" value=1>
<label for="full_diagnostics">Include Full Interface Diagnostics</label><br>
<input type="checkbox" name="write_csv" id="write_csv" value=1>
<label for="write_csv">Write to CSV</label><br>
<input type="checkbox" name="debug" id="debug" value=1>
<label for="debug">Debug Logs</label><br>
<h4>Send to Server - Powered by <a href="https://5g-ready.io">5g-ready.io</a></h4>
Send to Server will send results via HTTP POST<br>
to the Server URL with optional bearer token.<br>
HTTP POST results to the Server URL.<br>
<input type="checkbox" name="send_to_server" id="send_to_server" value=1>
<label for="send_to_server">Enable Send to Server</label><br>
<input type="checkbox" name="full_diagnostics" id="full_diagnostics" value=1>
<label for="full_diagnostics">Include Full Interface Diagnostics</label><br>
<input type="checkbox" name="include_logs" id="include_logs" value=1>
<label for="include_logs">Include Application Logs</label><br>
Server URL: <input type="text" name="server_url" id="server_url" value="https://5g-ready.io/injector" size="31"><br>
Expand Down
2 changes: 1 addition & 1 deletion Mobile_Site_Survey/package.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ firmware_major = 7
firmware_minor = 23
version_major = 2
version_minor = 5
version_patch = 4
version_patch = 5
uuid = 98b31c39-f649-43f3-b9f4-276a5d8824bf
1 change: 1 addition & 0 deletions Mobile_Site_Survey/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function loadForm(config) {
$('#enable_surveyors').prop('checked', config.enable_surveyors);
$('#surveyors').attr('value', config.surveyors);
$('#debug').attr('checked', config.debug);
$('#version').text('Mobile Site Survey v' + config.version);
if (config.results) {
$('#results').val(config.results);
}
Expand Down

0 comments on commit 6aa443d

Please sign in to comment.