Home » Blog » Restoring QRZ on Pi-Star

Restoring QRZ on Pi-Star

This information pertains only to the 20210125 version of Pi-Star. If you are running version 20210127 or later then please see the updated guide at https://www.m0lxq.com/update-restoring-qrz-on-pi-star/

Do NOT run the script on version 20210127 or later

On 25th January 2021 an update was released for Pi-Star that changed the default callsign look up on the last heard page from QRZ.com to RadioID.net.

Not everyone liked this change and a topic popped up on the Pi-Star users forum pretty quickly! The author of Pi-Star Andy Taylor, MW0MWZ, has suggested he may build in an option to switch between the two but this isn’t available yet.

In the meantime, I have written a simple BASH script that changes it back to QRZ.com in less than two minutes from the Pi-Star web interface. Follow these simple steps to restore QRZ.com as your default look up.

Please note that using SSH gives you full access to the Pi-Star system. Although this script will not harm your device, you must proceed at your own risk. I cannot be held responsible for any corruption of your set up. Should the worst happen, you can reflash your SD card to restore everything. Make sure you back up your settings before continuing.

This ONLY works with the 20210125 version of Pi-Star.
If you are running a later version, see the updated guide at https://www.m0lxq.com/update-restoring-qrz-on-pi-star/

Step 1

From the main Pi-Star page, click on Configuration. If not already logged in, you’ll be prompted to do so here. Unless you have changed it, the user name is pi-star and the password is raspberry.

Step 2

On the configuration page, click Expert.

Step 3

On the expert editors page, click SSH Access.

Step 4

Log in to the SSH session using the same details as you use to log into Pi-Star configuration.

Step 5

You will be presented with a screen that looks like this when logged in.

Before you run ANY of the commands below, check that you are running the 20210125 version of Pi-Star.
If you are running a later version, see the updated guide at https://www.m0lxq.com/update-restoring-qrz-on-pi-star/

You will need to type the following prompts:

rpi-rw – this set the SD card to writable.

wget m0lxq.com/pistar.sh – this downloads the script from my website.

chmod +x pistar.sh – this makes the script executable so you can run it.

./pistar.sh – this runs the script. Ensure that the full stop (or period) and the forward slash are both present here or it won’t work.

All being well, your screen should now look like this until you press return on the last command:

When you press return, the script will load:

The script will ask you confirm whether you want to proceed or not. Only do so if your dashboard takes you to radioid.net rather than QRZ.com when you click on a callsign. Press y to continue.

Once you see this, your last heard dashboard should now point to QRZ.com again. In case something failed, it automatically backs up the original dashboard page, simply type ./restore.sh to rollback to the original dashboard page. You can do this at any time, so feel free to leave the SSH session to check your dashboard and return if necessary.

Before you leave, you can also run rpi-ro to make the SD card read only again if desired – recommended, but not essential.

How it works

Andy, MW0MWZ has ‘commented out’ the original QRZ.com link and added the radioid.net link above that line. The script just deletes the lines with the radioid.net link and uncomments the QRZ lines. It also backs up the original and creates a script to revert back if the user wants.

Here is the source code of the script:

#!/bin/bash

#    QRZ Restoration Script
#    Copyright (C) 2021 Mark Mearns, M0LXQ.
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>.


NOW=$(date +"%Y-%m-%d-%T")

echo "***************************************"
echo "*                                     *"
echo "*   P I - S T A R   C A L L S I G N   *"
echo "*     L O O K   U P   E D I T O R     *"
echo "*                                     *"
echo "***************************************"
echo ""
echo "        by Mark Mearns, M0LXQ"
echo "            www.m0lxq.com"
echo ""
echo "This script will swap the new radioid.net"
echo "    callsign look up back to QRZ.com."
echo ""
echo "Your existing file will be backed up as:"
echo "/var/www/dashboard/mmdvmhost/lh.$NOW.bak"
echo ""
echo "********************************************"
echo "ONLY CONTINUE IF YOU GET SENT TO RADIOID.NET"
echo "       WHEN YOU CLICK ON A CALLSIGN"
echo ""
echo "  If it is already on QRZ, doing this will"
echo "      stop your dashboard from working."
echo "********************************************"
echo ""

read -p "Continue? (Y or N)" -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
    exit 1
fi

sudo cp /var/www/dashboard/mmdvmhost/lh.php /var/www/dashboard/mmdvmhost/lh.$NOW.bak
sudo sed -i '41d;44d' /var/www/dashboard/mmdvmhost/lh.php
sudo sed -i 's#//echo#echo#g' /var/www/dashboard/mmdvmhost/lh.php

sudo rm restore.sh 2> /dev/null
sudo echo "sudo rm /var/www/dashboard/mmdvmhost/lh.php"  >> restore.sh
sudo echo "sudo cp /var/www/dashboard/mmdvmhost/lh.$NOW.bak /var/www/dashboard/mmdvmhost/lh.php" >> restore.sh
sudo echo "sudo rm restore.sh" >> restore.sh
sudo chmod +x restore.sh

echo ""
echo "This should have worked. If it has broken something,"
echo "run ./restore.sh to return to the original dashboard."

Licence

QRZ.com Restoration Script
©2021 Mark Mearns, M0LXQ

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.


8 Comments

  1. Thank you Mark.

    A great and simple to implement fix.

    I used cut and paste from your web page, so had hardly any typing.

    It worked like a dream.

    Regards

    Mike G0MJT

  2. Can’t thank you enough. And I can’t even imagine for a second why anyone would want to connect to DMR ID pages. I have all that info on my screen. 🙂

    Ah (a moment passed) I *can* think of a reason. Not a practical or helpful one, but a reason nonetheless. Anyway – Thanks again. Can’t wait for a “switch” to be thrown in.

  3. Thank you Mark.

    A simple implement to fix and correct.
    I also used cut and paste from your web page, so hardly had to typing.
    It worked like a dream.

    Extremely happy to be AWAY FROM THE RADIOID website.
    Andy please update PISTAR dashboard fast for everyone else.

    Regards

  4. thank you soooo much! i don’t have very many more hairs to pull out over this. 🙂

  5. Thanks for this. Will it also work on 20210203? I’m just getting around to this and noticed another update

Leave a comment

Your email address will not be published. Required fields are marked *