Skip to content

Commit

Permalink
change argument from detect-usb-gnss to detect-gnss
Browse files Browse the repository at this point in the history
change function name to detect-gnss
  • Loading branch information
Stefal committed Oct 21, 2023
1 parent d6f5e12 commit 2aa6e1b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)):
Expand Down
18 changes: 9 additions & 9 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -378,7 +378,7 @@ install_unit_files() {
fi
}

detect_usb_gnss() {
detect_gnss() {
echo '################################'
echo 'USB GNSS RECEIVER DETECTION'
echo '################################'
Expand Down Expand Up @@ -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
Expand All @@ -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 ;;
Expand Down Expand Up @@ -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!'
Expand All @@ -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+=$?)) ;}
Expand Down
2 changes: 1 addition & 1 deletion web_app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2aa6e1b

Please sign in to comment.