Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# Changelog

## [2.3.5] - not released
### Added
### Changed
- Flask upgraded to v2.0.3 and other dependencies upgraded too.
### Fixed
- GUI -> Status: Sat. levels and coordinates are set to zero in case of a signal interruption. #164

### Security

## [2.3.4] - 2022-04-01
### Fixed
- Failure with some python dependancies. #215
Expand All @@ -30,6 +20,7 @@
- GUI -> Status: Ortho HR (aerial images) max zoom changed from 20 to 21.
### Fixed
- GUI -> Settings: "Save" buttons are disabled when a new setting is saved. #193
- Rtcm and Ntrip services are restarded after a RTKBase update. #171
- The Rinex conversion is more robust and error message is more understandable.
- GUI -> Rinex conversion is now enabled only for zip files.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Frontend's main features are:
Other images are available in the ./images folder.

## Ready to flash release:
A ready to flash image is available for Orange Pi Zero SBC : [Armbian_22.02 bullseye current 5.15.24](https://rtkbase.eu/armbian_rtkbase/Armbian_22.02.0-trunk_Orangepizero_bullseye_current_5.15.24_minimal.zip)
A ready to flash image is available for Orange Pi Zero SBC : [Armbian_RTKBase](https://github.com/Stefal/build/releases/latest)

If you use a Raspberry Pi, thanks to [jancelin](https://github.com/jancelin), you can download a ready to flash iso file [here](https://github.com/jancelin/pi-gen/releases).
If you use a Raspberry Pi, thanks to [jancelin](https://github.com/jancelin), you can download a ready to flash iso file [here](https://github.com/jancelin/pi-gen/releases/latest).

## Easy installation:
+ Connect your gnss receiver to your raspberry pi/orange pi/....
Expand Down
52 changes: 27 additions & 25 deletions rtkbase_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,42 +156,44 @@ upd_2.3.2() {
}

upd_2.3.3() {
#update gpsd unit file
cp /lib/systemd/system/gpsd.service /etc/systemd/system/gpsd.service
sed -i 's/^After=.*/After=str2str_tcp.service/' /etc/systemd/system/gpsd.service
sed -i '/^# Needed with chrony/d' /etc/systemd/system/gpsd.service
#Add restart condition
grep -qi '^Restart=' /etc/systemd/system/gpsd.service || sed -i '/^ExecStart=.*/a Restart=always' /etc/systemd/system/gpsd.service
grep -qi '^RestartSec=' /etc/systemd/system/gpsd.service || sed -i '/^Restart=always.*/a RestartSec=30' /etc/systemd/system/gpsd.service
#Add ExecStartPre condition to not start gpsd if str2str_tcp is not running. See https://github.com/systemd/systemd/issues/1312
grep -qi '^ExecStartPre=' /etc/systemd/system/gpsd.service || sed -i '/^ExecStart=.*/i ExecStartPre=systemctl is-active str2str_tcp.service' /etc/systemd/system/gpsd.service
systemctl daemon-reload
systemctl restart gpsd
upd_2.3.4 "$@"
}

upd_2.3.4() {
#update python module
python3 -m pip install -r ${destination_directory}'/web_app/requirements.txt' --extra-index-url https://www.piwheels.org/simple
#Overriding gpsd.service with custom dependency
cp /lib/systemd/system/gpsd.service /etc/systemd/system/gpsd.service
sed -i 's/^After=.*/After=str2str_tcp.service/' /etc/systemd/system/gpsd.service
sed -i '/^# Needed with chrony/d' /etc/systemd/system/gpsd.service
#Add restart condition
grep -qi '^Restart=' /etc/systemd/system/gpsd.service || sed -i '/^ExecStart=.*/a Restart=always' /etc/systemd/system/gpsd.service
grep -qi '^RestartSec=' /etc/systemd/system/gpsd.service || sed -i '/^Restart=always.*/a RestartSec=30' /etc/systemd/system/gpsd.service
#Add ExecStartPre condition to not start gpsd if str2str_tcp is not running. See https://github.com/systemd/systemd/issues/1312
grep -qi '^ExecStartPre=' /etc/systemd/system/gpsd.service || sed -i '/^ExecStart=.*/i ExecStartPre=systemctl is-active str2str_tcp.service' /etc/systemd/system/gpsd.service

systemctl daemon-reload
systemctl restart gpsd
}

# standard update
update
# calling specific update function. If we are using v2.2.5, it will call the function upd_2.2.5
upd_${old_version} "$@"

# The new version numbers will be imported from settings.conf.default during the web server startup.
echo "Delete the line version= and checkpoint_version= in settings.conf"
sed -i '/^checkpoint_version=/d' ${destination_directory}/settings.conf
sed -i '/^version=/d' ${destination_directory}/settings.conf
echo 'Insert updated status in settings.conf'
sed -i '/^\[general\]/a updated=true' ${destination_directory}/settings.conf
# The new checkpoint_version number will be imported from settings.conf.default during the web server startup.
echo "delete the line checkpoint_version= in settings.conf"
sed -i '/checkpoint_version=/d' ${destination_directory}/settings.conf

echo "update the release version in settings.conf"
new_release=$(grep '^version=*' ${destination_directory}/settings.conf.default)
sed -i 's/^version=.*/'${new_release}'/' ${destination_directory}/settings.conf

#change rtkbase's content owner
chown -R ${standard_user}:${standard_user} ${destination_directory}

#if a reboot is needed
#systemctl reboot
echo 'restart ntrip/rtcm to send the new release number in the stream'
systemctl is-active --quiet str2str_ntrip.service && systemctl restart str2str_ntrip.service
systemctl is-active --quiet str2str_local_ntrip_caster.service && systemctl restart str2str_local_ntrip_caster.service
systemctl is-active --quiet str2str_rtcm_svr.service && systemctl restart str2str_rtcm_svr.service
systemctl is-active --quiet str2str_rtcm_serial.service && systemctl restart str2str_rtcm_serial.service

echo "Restart web server"
systemctl restart rtkbase_web.service

#if a reboot is needed
#systemctl reboot
2 changes: 1 addition & 1 deletion tools/convbin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ RINEX=$(echo "${filedate}"-"${MOUNT_NAME}"."${year2}"o)
echo "- Processing on ""${RAW_ARCHIVE}"
extract_raw_file && \
${rnx_conversion_func} && \
echo -n 'rinex_file='"${RINEX}"
echo -n 'rinex_file='"${RINEX}" && \
rm "${raw_file}"
6 changes: 0 additions & 6 deletions web_app/RTKBaseConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ def get(self, *args, **kwargs):
"""
return self.config.get(*args, **kwargs)

def remove_option(self, *args, **kwargs):
"""
a wrapper around configparser.remove_options()
"""
return self.config.remove_option(*args, **kwargs)

def update_setting(self, section, setting, value, write_file=True):
"""
Update a setting in the config file and write the file (default)
Expand Down
15 changes: 1 addition & 14 deletions web_app/RTKLIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,24 +698,17 @@ def sendState(self):
# and emits them to the connected browser as messages
def broadcastSatellites(self):
count = 0
last_gps_timestamp=""

while self.server_not_interrupted:

# update satellite levels
self.rtkc.getObs()
#check if gps time is the same (no signal input)
if last_gps_timestamp == self.rtkc.obs_rover.get("gps_time"):
self.rtkc.obs_rover = {}
else:
last_gps_timestamp = self.rtkc.obs_rover.get("gps_time")

# if count % 10 == 0:
#print("Sending sat rover levels:\n" + str(self.rtkc.obs_rover))
#print("Sending sat base levels:\n" + str(self.rtkc.obs_base))

self.socketio.emit("satellite broadcast rover", self.rtkc.obs_rover, namespace = "/test")
#self.socketio.emit("satellite broadcast base", self.rtkc.obs_base, namespace = "/test")
count += 1
self.sleep_count +=1
time.sleep(1)
Expand All @@ -724,18 +717,12 @@ def broadcastSatellites(self):
# this function reads current rtklib status, coordinates and obs count
def broadcastCoordinates(self):
count = 0
last_receiver_timestamp = ""

while self.server_not_interrupted:

# update RTKLIB status
self.rtkc.getStatus()

#check if receiver time is the same (no signal input)
if last_receiver_timestamp == self.rtkc.status.get("time of receiver clock rover"):
self.rtkc.status = {}
else:
last_receiver_timestamp = self.rtkc.status.get("time of receiver clock rover")

# if count % 10 == 0:
# print("Sending RTKLIB status select information:")
# print(self.rtkc.status)
Expand Down
7 changes: 2 additions & 5 deletions web_app/RtkController.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def getObs(self):

obs = self.child.before.decode().split("\r\n")
obs = [_f for _f in obs if _f]

matching_strings = [s for s in obs if "SAT" in s]

if matching_strings != []:
Expand All @@ -281,7 +282,6 @@ def getObs(self):
sat_name_index = header.index("SAT")
sat_level_index = header.index("S1")
sat_input_source_index = header.index("R")
sat_time_index = header.index("TIME(GPST)")

if len(obs) > (header_index + 1):
# we have some info about the actual satellites:
Expand All @@ -295,22 +295,19 @@ def getObs(self):
if len(spl) > sat_level_index:
name = spl[sat_name_index]
level = spl[sat_level_index]
gps_time = spl[sat_time_index]

# R parameter corresponds to the input source number
if spl[sat_input_source_index] == "1":
# we consider 1 to be rover,
self.obs_rover[name] = level
self.obs_rover["gps_time"] = gps_time
elif spl[sat_input_source_index] == "2":
# 2 to be base
self.obs_base[name] = level
self.obs_base["gps_time"] = gps_time

else:
self.obs_base = {}
self.obs_rover = {}

self.semaphore.release()

return 1
Expand Down
24 changes: 13 additions & 11 deletions web_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
cryptography==36.0.1
itsdangerous==2.0.1
Flask==2.0.3
Flask-SocketIO==5.1.1
eventlet==0.33.0
Bootstrap-Flask==2.0.1
Flask-WTF==1.0.0
jinja2==3.0.3
werkzeug==2.0.2
cryptography==3.3.2
itsdangerous==1.1.0
Flask==1.1.2
Flask-SocketIO==4.3.2
eventlet==0.31.0
Bootstrap-Flask==1.5.1
Flask-WTF==0.14.3
Flask-Login==0.5.0
#On some linux distribution, pexpect and psutil are already installed
#and can't be upgraded with pip. In these cases, pip fail, leaving
#some package uninstalled.
#With pexpect <=4.8.0, pip will not fail.
#With psutil <= 5.8.0, pip will not fail.
pexpect<=4.8.0
psutil<=5.9.0
pyOpenSSL==22.0.0
psutil<=5.8.0
pyOpenSSL==20.0.1
pyserial==3.5
pystemd==0.10.0
requests==2.27.1
pystemd==0.8.0
requests==2.25.1
6 changes: 0 additions & 6 deletions web_app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,6 @@ def update_settings(json_msg):
services_list = load_units(services_list)
#Update standard user in settings.conf
update_std_user(services_list)
#check if we run RTKBase for the first time after an update
#and restart some services to let them send the new release number.
if rtkbaseconfig.get("general", "updated", fallback="False").lower() == "true":
restartServices(["ntrip", "local_ntrip_caster", "rtcm_svr", "rtcm_serial"])
rtkbaseconfig.remove_option("general", "updated")
rtkbaseconfig.write_file()
#Start a "manager" thread
manager_thread = Thread(target=manager, daemon=True)
manager_thread.start()
Expand Down
Loading