From 2aa6e1b961f560a860f40d49a285937da06b8bb7 Mon Sep 17 00:00:00 2001 From: Stefal Date: Sat, 21 Oct 2023 18:43:47 +0200 Subject: [PATCH] change argument from detect-usb-gnss to detect-gnss change function name to detect-gnss --- README.md | 10 +++++----- tools/install.sh | 18 +++++++++--------- web_app/server.py | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 31971501..32534475 100644 --- a/README.md +++ b/README.md @@ -110,12 +110,12 @@ The `install.sh` script can be used without the `--all` option to split the inst Install gpsd and chrony to set date and time from the gnss receiver. - -e | --detect-usb-gnss - Detect your GNSS receiver. It works only with usb-connected receiver like ZED-F9P. + -e | --detect-gnss + Detect your GNSS receiver. It works only with receiver like ZED-F9P. -n | --no-write-port Doesn'\''t write the detected port inside settings.conf. - Only relevant with --detect-usb-gnss argument. + Only relevant with --detect-gnss argument. -c | --configure-gnss Configure your GNSS receiver. @@ -216,13 +216,13 @@ So, if you really want it, let's go for a manual installation with some explanat sudo systemctl enable gpsd ``` -1. Connect your gnss receiver to raspberry pi/orange pi/.... with usb or uart, and check which com port it uses (ttyS1, ttyAMA0, something else...). If it's a U-Blox usb receiver, you can use `sudo ./install.sh --detect-usb-gnss`. Write down the result, you may need it later. +1. Connect your gnss receiver to raspberry pi/orange pi/.... with usb or uart, and check which com port it uses (ttyS1, ttyAMA0, something else...). If it's a U-Blox usb receiver, you can use `sudo ./install.sh --detect-gnss`. Write down the result, you may need it later. 1. If you didn't have already configure your gnss receiver, you must set it to output raw data: If it's a U-Blox ZED-F9P (usb), you can use ```bash - sudo ./install.sh --detect-usb-gnss --configure-gnss + sudo ./install.sh --detect-gnss --configure-gnss ``` If it's a U-Blox ZED-F9P (uart), you can use this command (change the ttyS1 and 115200 value if needed)): diff --git a/tools/install.sh b/tools/install.sh index 218956b0..85a2fda8 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -60,12 +60,12 @@ man_help(){ echo ' Install gpsd and chrony to set date and time' echo ' from the gnss receiver.' echo '' - echo ' -e | --detect-usb-gnss' - echo ' Detect your GNSS receiver. It works only with usb-connected receiver like ZED-F9P.' + echo ' -e | --detect-gnss' + echo ' Detect your GNSS receiver. It works only with receiver like ZED-F9P.' echo '' echo ' -n | --no-write-port' echo ' Doesn'\''t write the detected port inside settings.conf.' - echo ' Only relevant with --detect-usb-gnss argument.' + echo ' Only relevant with --detect-gnss argument.' echo '' echo ' -c | --configure-gnss' echo ' Configure your GNSS receiver.' @@ -378,7 +378,7 @@ install_unit_files() { fi } -detect_usb_gnss() { +detect_gnss() { echo '################################' echo 'USB GNSS RECEIVER DETECTION' echo '################################' @@ -623,14 +623,14 @@ main() { ARG_RTKBASE_RQS=0 ARG_UNIT=0 ARG_GPSD_CHRONY=0 - ARG_DETECT_USB_GNSS=0 + ARG_DETECT_GNSS=0 ARG_NO_WRITE_PORT=0 ARG_CONFIGURE_GNSS=0 ARG_DETECT_MODEM=0 ARG_START_SERVICES=0 ARG_ALL=0 - PARSED_ARGUMENTS=$(getopt --name install --options hu:drbi:jf:qtgencmsa: --longoptions help,user:,dependencies,rtklib,rtkbase-release,rtkbase-repo:,rtkbase-bundled,rtkbase-custom:,rtkbase-requirements,unit-files,gpsd-chrony,detect-usb-gnss,no-write-port,configure-gnss,detect-modem,start-services,all: -- "$@") + PARSED_ARGUMENTS=$(getopt --name install --options hu:drbi:jf:qtgencmsa: --longoptions help,user:,dependencies,rtklib,rtkbase-release,rtkbase-repo:,rtkbase-bundled,rtkbase-custom:,rtkbase-requirements,unit-files,gpsd-chrony,detect-gnss,no-write-port,configure-gnss,detect-modem,start-services,all: -- "$@") VALID_ARGUMENTS=$? if [ "$VALID_ARGUMENTS" != "0" ]; then #man_help @@ -654,7 +654,7 @@ main() { -q | --rtkbase-requirements) ARG_RTKBASE_RQS=1 ; shift ;; -t | --unit-files) ARG_UNIT=1 ; shift ;; -g | --gpsd-chrony) ARG_GPSD_CHRONY=1 ; shift ;; - -e | --detect-usb-gnss) ARG_DETECT_USB_GNSS=1 ; shift ;; + -e | --detect-gnss) ARG_DETECT_GNSS=1 ; shift ;; -n | --no-write-port) ARG_NO_WRITE_PORT=1 ; shift ;; -c | --configure-gnss) ARG_CONFIGURE_GNSS=1 ; shift ;; -m | --detect-modem) ARG_DETECT_MODEM=1 ; shift ;; @@ -700,7 +700,7 @@ main() { install_unit_files && \ install_gpsd_chrony [[ $? != 0 ]] && ((cumulative_exit+=$?)) - detect_usb_gnss && \ + detect_gnss && \ configure_gnss start_services ; ((cumulative_exit+=$?)) [[ $cumulative_exit != 0 ]] && echo -e '\n\n Warning! Some errors happened during installation!' @@ -716,7 +716,7 @@ main() { [ $ARG_RTKBASE_RQS -eq 1 ] && { rtkbase_requirements ; ((cumulative_exit+=$?)) ;} [ $ARG_UNIT -eq 1 ] && { install_unit_files ; ((cumulative_exit+=$?)) ;} [ $ARG_GPSD_CHRONY -eq 1 ] && { install_gpsd_chrony ; ((cumulative_exit+=$?)) ;} - [ $ARG_DETECT_USB_GNSS -eq 1 ] && { detect_usb_gnss "${ARG_NO_WRITE_PORT}" ; ((cumulative_exit+=$?)) ;} + [ $ARG_DETECT_GNSS -eq 1 ] && { detect_gnss "${ARG_NO_WRITE_PORT}" ; ((cumulative_exit+=$?)) ;} [ $ARG_CONFIGURE_GNSS -eq 1 ] && { configure_gnss ; ((cumulative_exit+=$?)) ;} [ $ARG_DETECT_MODEM -eq 1 ] && { detect_usb_modem && _add_modem_port && _configure_modem ; ((cumulative_exit+=$?)) ;} [ $ARG_START_SERVICES -eq 1 ] && { start_services ; ((cumulative_exit+=$?)) ;} diff --git a/web_app/server.py b/web_app/server.py index ad729633..d7654365 100755 --- a/web_app/server.py +++ b/web_app/server.py @@ -564,7 +564,7 @@ def deleteLog(json_msg): def detect_receiver(json_msg): print("Detecting gnss receiver") #print("DEBUG json_msg: ", json_msg) - answer = subprocess.run([os.path.join(rtkbase_path, "tools", "install.sh"), "--user", rtkbaseconfig.get("general", "user"), "--detect-usb-gnss", "--no-write-port"], encoding="UTF-8", stderr=subprocess.PIPE, stdout=subprocess.PIPE) + answer = subprocess.run([os.path.join(rtkbase_path, "tools", "install.sh"), "--user", rtkbaseconfig.get("general", "user"), "--detect-gnss", "--no-write-port"], encoding="UTF-8", stderr=subprocess.PIPE, stdout=subprocess.PIPE) if answer.returncode == 0 and "/dev/" in answer.stdout: #print("DEBUG ok stdout: ", answer.stdout) try: