Skip to content

Commit

Permalink
add missing parameters for tcp client connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed May 29, 2024
1 parent 00ec57a commit 5d27970
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion run_cast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ out_rtcm_svr="tcpsvr://:${rtcm_svr_port}#rtcm3 -msg ${rtcm_svr_msg} -p ${positio
#add receiver options if it exists
[[ ! -z "${rtcm_receiver_options}" ]] && out_rtcm_svr=""${out_rtcm_svr}" -opt "${rtcm_receiver_options}""

out_rtcm_client="tcpcli://${rtcm_client_addr}:${rtcm_client_port}#rtcm3 -msg ${rtcm_client_msg} -p ${position}"
out_rtcm_client="tcpcli://${rtcm_client_user}:${rtcm_client_pwd}@${rtcm_client_addr}:${rtcm_client_port}#rtcm3 -msg ${rtcm_client_msg} -p ${position}"
#add receiver options if it exists
[[ ! -z "${rtcm_client_receiver_options}" ]] && out_rtcm_client=""${out_rtcm_client}" -opt "${rtcm_receiver_client_options}""

Expand Down
3 changes: 3 additions & 0 deletions settings.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ rtcm_receiver_options=''
#port for rtcm client
rtcm_client_addr=''
rtcm_client_port='80'
#user/password credentials to connect to the server
rtcm_client_user=''
rtcm_client_pwd=''
#messages for rtcm client use
rtcm_client_msg='1004,1005(10),1006,1008(10),1012,1019,1020,1033(10),1042,1045,1046,1077,1087,1097,1107,1127,1230'
#Receiver dependent options
Expand Down
3 changes: 1 addition & 2 deletions web_app/RTKBaseConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ def get_rtcm_client_settings(self):
and remove the single quotes.
"""
ordered_rtcm_client = [{"source_section" : "rtcm_client"}]
for key in ("rtcm_client_addr", "rtcm_client_port", "rtcm_client_msg", "rtcm_client_receiver_options"):
for key in ("rtcm_client_addr", "rtcm_client_port", "rtcm_client_user", "rtcm_client_pwd", "rtcm_client_msg", "rtcm_client_receiver_options"):
ordered_rtcm_client.append({key : self.config.get('rtcm_client', key).strip("'")})
print("ORDERED RTCM CLIENT", ordered_rtcm_client)
return ordered_rtcm_client

def get_rtcm_udp_svr_settings(self):
Expand Down
2 changes: 1 addition & 1 deletion web_app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
import urllib

app = Flask(__name__)
app.debug = False
app.debug = True
app.config["SECRET_KEY"] = "secret!"
#app.config["UPLOAD_FOLDER"] = os.path.join(os.path.dirname(__file__), "../logs")
app.config["DOWNLOAD_FOLDER"] = os.path.join(os.path.dirname(__file__), "../data")
Expand Down
2 changes: 1 addition & 1 deletion web_app/static/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $(document).ready(function () {
// View/hide password buttons for: Ntrip A, Ntrip B and Local caster
document.querySelectorAll(".input-group-append").forEach(function(e) {
var name = e.querySelector("button").id.replace("_button", "");
if (!["svr_pwd_A", "svr_pwd_B", "local_ntripc_pwd"].includes(name))
if (!["svr_pwd_A", "svr_pwd_B", "local_ntripc_pwd", "rtcm_client_pwd"].includes(name))
return;

var button = $("#" + name + "_button");
Expand Down
31 changes: 28 additions & 3 deletions web_app/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ <h4>Services:</h4>
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
</svg>
</a>
</div>
</div>
</div>
<form id="{{ local_ntripc_settings.pop(0).source_section }}" class="collapse was-validated">
<div class="form-group row">
Expand Down Expand Up @@ -400,17 +400,42 @@ <h4>Services:</h4>
<div class="invalid-feedback">Rtcm client port</div>
</div>
</div>
<div class="form-group row">
<label for="rtcm_client_user" class="col-sm-3 col-form-label">Tcp server username: </label>
<div class="col-sm-9">
<input id="rtcm_client_user" type="text" name="rtcm_client_user" class="form-control" aria-describedby="rtcm_client_userHelp" placeholder="Enter a username" value="{{ rtcm_client_settings[2].rtcm_client_user }}" pattern="\w+[^\|><\s]*">
<small class="form-text text-muted" id="rtcm_client_userHelp">username for the tcp connection</small>
</div>
</div>
<div class="form-group row">
<label for="rtcm_client_pwd" class="col-sm-3 col-form-label">Tcp server password: </label>
<div class="col-sm-9">
<div class="input-group">
<input id="rtcm_client_pwd" type="password" name="rtcm_client_pwd" class="form-control" aria-describedby="rtcm_client_pwdHelp" placeholder="Choose a password" value="{{ rtcm_client_settings[3].rtcm_client_pwd }}" pattern="\w+[^\|><\s]*">
<span class="input-group-append">
<button class="btn btn-outline-secondary" id="rtcm_client_pwd" type="button">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">
<path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>
<path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
<path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>
</svg>
</button>
</span>
</div>
<small class="form-text text-muted" id="rtcm_client_pwdHelp">Password for the tcp connection</small>
</div>
</div>
<div class="form-group row">
<label for="rtcm_client_msg" class="col-sm-3 col-form-label">Rtcm client messages: </label>
<div class="col-sm-9">
<input id="rtcm_client_msg" type="text" name="rtcm_client_msg" class="form-control" value="{{ rtcm_client_settings[2].rtcm_client_msg }}" title="Rtcm client messages list" pattern="[0-9,\(\).]+" required>
<input id="rtcm_client_msg" type="text" name="rtcm_client_msg" class="form-control" value="{{ rtcm_client_settings[4].rtcm_client_msg }}" title="Rtcm client messages list" pattern="[0-9,\(\).]+" required>
<div class="invalid-feedback">Rtcm client messages list</div>
</div>
</div>
<div class="form-group row">
<label for="rtcm_client_receiver_options" class="col-sm-3 col-form-label">Receiver options: </label>
<div class="col-sm-9">
<input id="rtcm_client_receiver_options" type="text" name="rtcm_client_receiver_options" class="form-control" value="{{ rtcm_client_settings[3].rtcm_client_receiver_options }}" title="Receiver options" pattern="[^\|><\/]*">
<input id="rtcm_client_receiver_options" type="text" name="rtcm_client_receiver_options" class="form-control" value="{{ rtcm_client_settings[5].rtcm_client_receiver_options }}" title="Receiver options" pattern="[^\|><\/]*">
<div class="invalid-feedback">Receiver dependent options</div>
</div>
</div>
Expand Down

0 comments on commit 5d27970

Please sign in to comment.