Currently, you cannot use a hostname for NTRIP client configuration.
As a workaround, you can use the following script:
# Hostname to resolve
# Get current IP from UCI NTRIP
current_ip=$(uci get rs_ntrip.1.ntrip_ip)
# Resolve hostname to IP using nslookup
new_ip=$(nslookup $hostname | grep 'Address 1:' | cut -d ' ' -f3)
# Compare current and resolved IPs
if [ "$current_ip" != "$new_ip" ]; then
# Update UCI NTRIP with new IP
uci set rs_ntrip.1.ntrip_ip=$new_ip
logger "NTRIP IP updated to $new_ip"
logger "No update needed, NTRIP IP is already set to $current_ip"
To create a script, connect to the device via CLI/SSH (CLI information here) and execute the following commands to create a file, allow script execution and edit the file:
- touch /etc/ntripip.sh
- chmod +x /etc/ntripip.sh
- vi /etc/ntripip.sh
You will open a text editor. Press 'i' to start editing. Copy this script (change the hostname that you want to resolve) and paste it into the file. Save the script by pressing 'esc' button, typing ':wq' and pressing 'enter'. The script should be created.
This script resolves your defined hostname to an IP address and checks if it is the same as in the NTRIP settings. If the IP address is different, it changes it to a newly resolved IP address.
You can add this script to crontab to execute at specific intervals. (Crontab information here). Hence, if the IP address of the hostname changes, the script should change the IP address in the NTRIP settings.
To add the script to crontab, execute the following command and add your script:
Add a line as in the image below. (you can refer to crontab wiki page mentioned before to change how often the script should run, in my example its every minute).