Wednesday, August 28, 2024

Installing and Trouble Shooting CHIRP Radio Programming Software


I bought a Baofeng UV 21R and needed to program it.  After a little research I figured out I could use a piece of software called CHIRP.  Installing CHIRP on Ubuntu 22.04 is not straight forward as it should be and once it's installed you, may run into issues getting your programming cable to be recognized. I did.  




Let's start with installing CHIRP:

1.  Download CHIRP here.
https://archive.chirpmyradio.com/chirp_next/next-20240821/
(Click on the Download the latest CHIRP-next build here link on the download page)

2. Once on the download page, your want to download the chirp-20240821-py3-none-any.whl version by right clicking on it's link and selecting "SAVE LINK AS" option. Put it in your HOME directory root.

NOTE that the number in the middle of the file name will change as the software is updated over time.  Make a note of the name of the file you downloaded as you will need this file name in the following steps.

3.  Now we need to check to see if you have Python version 3 or greater installed on your system.  Open a Terminal Window and type the following followed by the ENTER key:

python3 --version

If you get an Error after this command then you don't have Python3 installed and you will need to do the following three command to get it installed before continuing:

sudo apt install
sudo apt upgrade
sudo apt install python3

4.  Once Python 3 or greater is installed you now need to install the Python3-wxgtku interface environment to your Python install. Open a Terminal Window and run the following command to install python3-wxgtk4.0:

sudo apt install python3-wxgtk4.0 pipx

5.  Now you will need to add your USER to the "dialout" group by typing the following in Terminal Window (replace <username> with your actual username):

sudo usermod -aG dialout <username>

6.  Now let's install the CHIRP software we downloaded in step 2 (remember the file name I'm using here my be different from the file name you downloaded).  Open a Terminal Window and navigate to the root of your Home directory where you saved the chirp-20240821-py3-none-any.whl file you downloaded in Step 2.  Run the following command

pipx install --system-site-packages ./chirp-20240821-py3-none-any.whl

 NOTE: your file will have a different name then the one I'm using here.  Use your file name, not mine.

7.  Run CHIRP from the Command Line Terminal by typing the following command into a Terminal Window:

~/.local/bin/chirplocal/bin/chirp

8.  Once the software starts connect your USB programming cable to your radio, turn your radio on, and connect your USB cable to your computer.  In CHIRP go to the menu Radio / Down From Radio. You should now see a popup window that looks like this image.  For Port you are looking for something like what I have here "ttyUSB0" the "0" part may be different than mine.  If you do not see something like this for PORT then you need to go to the Addition Steps / Trouble Shooting section below.  For Vendor I have baofeng radios so I picked it.  For Model I have a UV 21R but it is not in the list but the UV-17Pro works for my radio.  Once you click OK you should get an option to Download (read) your radio's memory.  If you get a list of Freqs. in a spreadsheet like layout, congratulation! your good to go and can make any changes you need to your radio and write those changes back to your radio and save your radios file for later recall.  If you don't get the spreadsheet then see the  Addition Steps / Trouble Shooting section below.



Addition Steps / Trouble Shooting


If something went wrong then here are a few things your can try.  

First add permissions for your USER to use the ttyUSBO port by typing the following into a Terminal Window:

sudo usermod -a -G $(stat -c %G /dev/ttyUSB0) $USER

NOTE: Your ttyUSB0 maybe have a different end number, mine here is "0".  If your number is different replace the ttyUSB0 part of the above command with your port name.  The $USER part does NOT need changed unless you are logged on as a different user than the one that needs to use CHIRP.



If that doesn't fix your problem try the following:

In a Terminal Window type the following Command:

lsusb

you should see something that looks like this image


Notice the line:

Bus 005 Device 005: ID 1a86:7523 QinHeng Electronics CH340 serial converter

That is your Programming cable and means that your computer can see it.  This is a good thing but something is interfering with it.


Now run the the following command in a Terminal Window:

sudo dmesg

It will return a long response but the end will look something like this image:


Notice that "brltty" is overriding our ttyUSB0 port (both are trying to claim channel 341) brltty is used by Linux's Virtual Keyboard on my system and I don't need it so I just uninstalled  brltty with the following command from a Terminal Windows

sudo apt remove brltty 


After that everything worked as expected in CHIRP.