Skip to content

Commit

Permalink
check if gnss configuration is ok
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed Jun 14, 2024
1 parent c850197 commit 41c1d90
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ configure_gnss(){
sudo -u "${RTKBASE_USER}" sed -i s/^receiver_firmware=.*/receiver_firmware=\'${firmware}\'/ "${rtkbase_path}"/settings.conf
#configure the F9P for RTKBase
"${rtkbase_path}"/tools/set_zed-f9p.sh /dev/${com_port} ${com_port_settings%%:*} "${rtkbase_path}"/receiver_cfg/U-Blox_ZED-F9P_rtkbase.cfg && \
echo 'U-Blox F9P Successfuly configured' && \
#now that the receiver is configured, we can set the right values inside settings.conf
sudo -u "${RTKBASE_USER}" sed -i s/^com_port_settings=.*/com_port_settings=\'115200:8:n:1\'/ "${rtkbase_path}"/settings.conf && \
sudo -u "${RTKBASE_USER}" sed -i s/^receiver=.*/receiver=\'U-blox_ZED-F9P\'/ "${rtkbase_path}"/settings.conf && \
Expand All @@ -537,14 +538,22 @@ configure_gnss(){
#configure the mosaic-X5 for RTKBase
echo 'Resetting the mosaic-X5 settings....'
python3 "${rtkbase_path}"/tools/sept_tool.py --port /dev/ttyGNSS_CTRL --baudrate ${com_port_settings%%:*} --command reset --retry 5
sleep_time=20 ; echo 'Waiting '$sleep_time's for mosaic-X5 reboot' ; sleep $sleep_time
sleep_time=30 ; echo 'Waiting '$sleep_time's for mosaic-X5 reboot' ; sleep $sleep_time
echo 'Sending settings....'
python3 "${rtkbase_path}"/tools/sept_tool.py --port /dev/ttyGNSS_CTRL --baudrate ${com_port_settings%%:*} --command send_config_file "${rtkbase_path}"/receiver_cfg/Septentrio_Mosaic-X5.cfg --store --retry 5
systemctl enable --now rtkbase_gnss_web_proxy.service #won't work during installation but, needed after a detect&configure from the gui.
sudo -u "${RTKBASE_USER}" sed -i s/^com_port_settings=.*/com_port_settings=\'115200:8:n:1\'/ "${rtkbase_path}"/settings.conf && \
sudo -u "${RTKBASE_USER}" sed -i s/^receiver=.*/receiver=\'Septentrio_Mosaic-X5\'/ "${rtkbase_path}"/settings.conf && \
sudo -u "${RTKBASE_USER}" sed -i s/^receiver_format=.*/receiver_format=\'sbf\'/ "${rtkbase_path}"/settings.conf
return $?
if [[ $? -eq 0 ]]
then
echo 'Septentrio Mosaic-X5 successfuly configured'
systemctl list-unit-files rtkbase_gnss_web_proxy.service &>/dev/null && \
systemctl enable --now rtkbase_gnss_web_proxy.service && \
sudo -u "${RTKBASE_USER}" sed -i s/^com_port_settings=.*/com_port_settings=\'115200:8:n:1\'/ "${rtkbase_path}"/settings.conf && \
sudo -u "${RTKBASE_USER}" sed -i s/^receiver=.*/receiver=\'Septentrio_Mosaic-X5\'/ "${rtkbase_path}"/settings.conf && \
sudo -u "${RTKBASE_USER}" sed -i s/^receiver_format=.*/receiver_format=\'sbf\'/ "${rtkbase_path}"/settings.conf
return $?
else
echo 'Failed to configure the Gnss receiver'
return 1
fi

else
echo 'No Gnss receiver has been set. We can'\''t configure'
Expand Down

0 comments on commit 41c1d90

Please sign in to comment.