Skip to content

Commit

Permalink
Merge branch 'dev' into lte_modem_support
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal authored May 22, 2024
2 parents effb43e + 5686338 commit 3bcf0fb
Show file tree
Hide file tree
Showing 52 changed files with 668 additions and 255 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ settings.conf
test.sh
test.conf
*.FCStd1
/venv/*
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
# Changelog

## [] - not released
### Added
- Added description below form input. #381
### Changed
### Deprecated
### Removed
### Fixed
- Remove Sbas rtcm message (1107) after F9P configuration. #391
- Tooltips buttons were a link to top page. #387
- Fix armbian ramlog bug with log older than 1 day. https://github.com/Stefal/build/issues/16
- Archive service will compress .sbf files too.
- Fix duplicates in .sbf to rinex conversion : https://github.com/rtklibexplorer/RTKLIB/issues/186
- Various fixes : #374
### Security

## [2.5.0] - 2024-01-30
### Added
- udev rules to create ttyGNSS port for usb connected F9P.
- Added UART connected F9P detection and configuration.
- Some scripts for using a base with a 4G Simcom A76XX modem. (Beta).
- Rules to manage rtkbase services without sudo (Bookworm or newer).
- Trying to detect the wrong cpu temp on Orange Pi Zero. #224
- Buttons and collapsing informations on the diagnostic page.
### Changed
- RTKLib upgraded to release b34i from rtklibexplorer.
- RTKBase now use a virtual environnement for the python environnement
- install.sh -> --detect-usb-gnss renamed to --detect-gnss
- Rinex conversion -> limit to 2 frequencies removed in "full" presets
- Rinex conversion -> receiver option (-TADJ=1 for ubx) is sourced from settings.conf
- Logs -> default time overlap changed from 30s to 0s
### Fixed
- More tests before copying RTKLib binaries. #313
- Skip unknown section or key when restoring settings. #336
- Fix space detection in various forms inputs.
- Fix broken form input validation patterns. #353
- Fix some issues with Orange Pi Zero images. #361
### Security
- Update of various python modules.
- Apply some restrictions on RTKBase services. #341

## [2.4.2] - 2023-11-10
### Fixed
- Pin Werkzeug module to v2.2.2 to fix dependencie failure. #330

## [2.4.1] - 2023-02-26
### Fixed
- GUI -> Settings: Fixed GNSS detect & configure. #303
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you use a Raspberry Pi, thanks to [jancelin](https://github.com/jancelin), yo
If you don't already know your base precise coordinates, it's time to read one of these tutorials:
- [rtklibexplorer - Post-processing RTK - for single and dual frequency receivers](https://rtklibexplorer.wordpress.com/2020/02/05/rtklib-tips-for-using-a-cors-station-as-base/)
- [rtklibexplorer - PPP - for dual frequency receivers](https://rtklibexplorer.wordpress.com/2017/11/23/ppp-solutions-with-the-swiftnav-piksi-multi/)
- [Centipede documentation (in french)](https://jancelin.github.io/docs-centipedeRTK/docs/base/positionnement.html)
- [Centipede documentation (in french)](https://docs.centipede.fr/docs/base/positionnement.html)

## Manual installation:
The `install.sh` script can be used without the `--all` option to split the installation process into several different steps:
Expand Down 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 Expand Up @@ -326,6 +326,8 @@ A gnss receiver with a timepulse output is a very accurate [stratum 0](https://e
^- kalimantan.ordimatic.net 3 6 177 16 -27ms[ -27ms] +/- 64ms
```
## Requirements:
Python >= 3.7

## History:
See the [changelog](./CHANGELOG.md)
Expand Down
4 changes: 2 additions & 2 deletions archive_and_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#You can customize archive_name and archive_rotate in settings.conf

BASEDIR=$(dirname "$0")
source <( grep = ${BASEDIR}/settings.conf )
source <( grep '=' ${BASEDIR}/settings.conf )
cd ${datadir}

check_space(){
Expand All @@ -30,7 +30,7 @@ done

#archive and compress previous day's gnss data.
#find . -maxdepth 1 -type f -mtime -1 -mmin +60 -name "*.ubx*" -exec tar -jcvf ${archive_name} --remove-files {} +;
find . -maxdepth 1 -type f -mtime -960 -mmin +60 \( -name "*.rtcm*" -o -name "*.nov*" -o -name "*.oem*" -o -name "*.ubx*" -o -name "*.ss2*" -o -name "*.hemis*" -o -name "*.stq*" -o -name "*.javad*" -o -name "*.nvs*" -o -name "*.binex*" \) -exec zip -m9 ${archive_name} {} +;
find . -maxdepth 1 -type f -mtime -960 -mmin +60 \( -name "*.rtcm*" -o -name "*.nov*" -o -name "*.oem*" -o -name "*.ubx*" -o -name "*.ss2*" -o -name "*.hemis*" -o -name "*.stq*" -o -name "*.javad*" -o -name "*.nvs*" -o -name "*.binex*" -o -name "*.sbf*" \) -exec zip -m9 ${archive_name} {} +;

#delete gnss data older than x days.
#find . -maxdepth 1 -type f -name "*.tar.bz2" -mtime +${archive_rotate} -delete
Expand Down
128 changes: 120 additions & 8 deletions rtkbase_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,54 @@ destination_directory=$2
data_dir=$3
old_version=$4
standard_user=$5
checking=$6

#store service status before upgrade
str2str_active=$(systemctl is-active str2str_tcp)
str2str_ntrip_A_active=$(systemctl is-active str2str_ntrip_A)
str2str_ntrip_B_active=$(systemctl is-active str2str_ntrip_B)
str2str_local_caster=$(systemctl is-active str2str_local_ntrip_caster)
str2str_rtcm=$(systemctl is-active str2str_rtcm_svr)
str2str_serial=$(systemctl is-active str2str_rtcm_serial)
str2str_file=$(systemctl is-active str2str_file)

check_before_update() {
TOO_OLD='You'"'"'re Operating System is too old\nPlease update it or reflash you SDCard with a more recent RTKBase image\n'

if [[ -f /etc/os-release ]]
then
source /etc/os-release
else
printf "Warning! We can't check your Os release, upgrade at your own risk\n"
fi

case $ID in
debian)
if (( $(echo "$VERSION_ID < 10" | bc -l) ))
then
printf "${TOO_OLD}" >/dev/stderr
exit 1
fi
;;
raspbian)
if (( $(echo "$VERSION_ID < 10" | bc -l) ))
then
printf "${TOO_OLD}" >/dev/stderr
exit 1
fi
;;
ubuntu)
if (( $(echo "$VERSION_ID < 20.04" | bc -l) ))
then
printf "${TOO_OLD}" >/dev/stderr
exit 1
fi
;;
esac
}

update() {
echo "remove existing rtkbase.old directory"
echo 'remove existing rtkbase.old directory'
rm -rf /var/tmp/rtkbase.old
mkdir /var/tmp/rtkbase.old

Expand All @@ -26,8 +71,13 @@ cp -r ${destination_directory}/!(${data_dir}) /var/tmp/rtkbase.old
#systemctl stop rtkbase_web.service

echo "copy new release to destination"
cp -rfp ${source_directory}/. ${destination_directory}

if [[ -d ${source_directory} ]] && [[ -d ${destination_directory} ]]
then
cp -rfp ${source_directory}/. ${destination_directory}
else
echo 'can t copy'
exit 1
fi
}

insert_rtcm_msg() {
Expand Down Expand Up @@ -171,7 +221,8 @@ upd_2.3.3() {
}

upgrade_rtklib() {
bin_path=$(dirname $(command -v str2str))
systemctl stop str2str_tcp
bin_path=$(dirname "$(command -v str2str)")
rm "${bin_path}"'/str2str' "${bin_path}"'/rtkrcv' "${bin_path}"'/convbin'
"${destination_directory}"'/tools/install.sh' --user "${standard_user}" --rtklib
}
Expand Down Expand Up @@ -206,7 +257,7 @@ upd_2.3.4() {
#update python module
"${destination_directory}"'/tools/install.sh' --user "${standard_user}" --rtkbase-requirements
# Get F9P firmware release
source <( grep = "${destination_directory}"/settings.conf )
source <( grep '=' "${destination_directory}"/settings.conf )
if [[ $(python3 "${destination_directory}"/tools/ubxtool -f /dev/"${com_port}" -s ${com_port_settings%%:*} -p MON-VER) =~ 'ZED-F9P' ]]
then
echo 'Get F9P firmware release'
Expand Down Expand Up @@ -243,12 +294,73 @@ upd_2.4.0() {
echo '####################'
echo 'Update from 2.4.0'
echo '####################'
upd_2.4.1 "$@"
}

upd_2.4.1() {
echo '####################'
echo 'Update from 2.4.1'
echo '####################'
upd_2.4.2 "$@"
}

upd_2.4.2() {
echo '####################'
echo 'Update from 2.4.2'
echo '####################'
apt-get update -y --allow-releaseinfo-change
apt-get --fix-broken install # needed for old installation (raspi image v2.1 from july 2020)
# only for Orange Pi Zero, disable sysstats-collect (https://github.com/Stefal/build/issues/14)
# and update hostapd if error (https://github.com/Stefal/build/issues/15)
computer_model=$(tr -d '\0' < /sys/firmware/devicetree/base/model)
sbc_array=('Xunlong Orange Pi Zero')
if printf '%s\0' "${sbc_array[@]}" | grep -Fxqz -- "${computer_model}"
then
echo 'Masking sysstat-collect.timer service and upgrading hostapd'
systemctl mask sysstat-collect.timer
dpkg -s hostapd | grep -q 'Version: 2:2.9' && apt-get upgrade -y hostapd
rm -r /var/log/sysstat/
fi
# end of Orange Pi Zero section
${destination_directory}/tools/install.sh --user "${standard_user}" --dependencies --rtkbase-requirements --unit-files
#upgrade rtklib to b34h
upgrade_rtklib
#restart str2str if it was active before upgrading rtklib
[ $str2str_active = 'active' ] && systemctl start str2str_tcp
# restart previously running services
[ $str2str_ntrip_A_active = 'active' ] && systemctl start str2str_ntrip_A
[ $str2str_ntrip_B_active = 'active' ] && systemctl start str2str_ntrip_B
[ $str2str_local_caster = 'active' ] && systemctl start str2str_local_ntrip_caster
[ $str2str_rtcm = 'active' ] && systemctl start str2str_rtcm_svr
[ $str2str_serial = 'active' ] && systemctl start str2str_rtcm_serial
[ $str2str_file = 'active' ] && systemctl start str2str_file
return 0
}

# standard update
update
upd_2.5.0 () {
# only for Orange Pi Zero, update armbian-ramlog (https://github.com/Stefal/build/issues/16)
computer_model=$(tr -d '\0' < /sys/firmware/devicetree/base/model)
sbc_array=('Xunlong Orange Pi Zero')
if printf '%s\0' "${sbc_array[@]}" | grep -Fxqz -- "${computer_model}" &&
lsb_release -c | grep -qE 'bullseye|bookworm' &&
grep -qE 'armbian' /etc/os-release
then
echo 'Updating armbian-ramlog'
sed -i 's/armbian-ramlog)" | while/armbian-ramlog)|\\.journal" | while/' /usr/lib/armbian/armbian-ramlog
fi
# end of Orange Pi Zero section
}
#check if we can apply the update
#FOR THE OLDER ME -> Don't forget to modify the os detection if there is a 2.5.x release !!!
[[ $checking == '--checking' ]] && check_before_update && exit

echo '################################'
echo 'Starting standard update'
echo '################################'
update || { echo 'Update failed (update)' ; exit 1 ;}
# calling specific update function. If we are using v2.2.5, it will call the function upd_2.2.5
upd_"${old_version/b*/b}" "$@"
echo 'Starting specific update'
upd_"${old_version/b*/b}" "$@" || { echo 'Update failed (upd_release_number)' ; exit 1 ;}
#note for older me:
#When dealing with beta version, "${oldversion/b*/b}" will call function 2.4b when we use a release 2.4b1 or 2.4b2 or 2.4beta99

Expand Down
2 changes: 1 addition & 1 deletion run_cast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://github.com/tomojitakasu/RTKLIB

BASEDIR=$(dirname "$0")
source <( grep = ${BASEDIR}/settings.conf ) #import settings
source <( grep '=' ${BASEDIR}/settings.conf ) #import settings

receiver_info="RTKBase ${receiver},${version} ${receiver_firmware}"
in_serial="serial://${com_port}:${com_port_settings}#${receiver_format}"
Expand Down
10 changes: 6 additions & 4 deletions settings.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[general]
# Version
version=2.4.1
version=2.5.0
# Rtkbase upgrade mandatory "checkpoint"
checkpoint_version=2.5.0
checkpoint_version=2.6.0
# User who runs str2str_file service
user=
# NTRIP caster program
Expand All @@ -24,10 +24,12 @@ web_password_hash=pbkdf2:sha256:150000$kWdEE8eU$d30b1a75e5cf898684bad60b47a45a80
maptiler_key=
#Receive prerelease update (beta version)
prerelease=False
#Cpu temp offset for Orange Pi Zero LTS (+30°C)
cpu_temp_offset=0

[main]
#base coordinates: lat long height
position='47.0983869 -1.2655108 36.4'
position='47.0983869 -1.2655108 36.40'
#gnss receiver com port
com_port=''
#gnss receiver com port settings
Expand Down Expand Up @@ -60,7 +62,7 @@ file_name='%Y-%m-%d_%h-%M-%S_GNSS-1'
#file rotate time in hour
file_rotate_time='24'
#file overlap time in seconds
file_overlap_time='30'
file_overlap_time='0'
#name for the compressed archive
archive_name=$(date -d "-1 days" +"%Y-%m-%d_%S").zip
#archives older than this value (in days) will be deleted by archive_and_clean.sh
Expand Down
Binary file removed tools/bin/rtklib_b34g/aarch64/convbin
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/aarch64/rtkrcv
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/aarch64/str2str
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/armv6l/convbin
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/armv7l/convbin
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/x86/convbin
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/x86/rtkrcv
Binary file not shown.
Binary file removed tools/bin/rtklib_b34g/x86/str2str
Binary file not shown.
Empty file.
Binary file added tools/bin/rtklib_b34i/armv6l/convbin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added tools/bin/rtklib_b34i/armv7l/convbin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 3bcf0fb

Please sign in to comment.