Project

General

Profile

ChirpOnLinux » History » Revision 16

Revision 15 (Jeffrey Vian, 03/20/2023 07:52 PM) → Revision 16/43 (Jeffrey Vian, 03/22/2023 12:05 PM)

# Running CHIRP on Linux 

 This page describes how to get the newer python3-based CHIRP-next running on Linux. 

 ## Debian, Ubuntu, Mint, Raspbian, etc 

 Install prerequisite packages: 

 ``` 
 $ sudo apt install git python3-wxgtk4.0 python3-serial python3-six python3-future python3-requests python3-pip 
 ``` 

 You should be able to install either the wheel or the tarball using `pip`: 

 ``` 
 $ pip3 install chirp-next-20230114.tar.gz 
 ``` 
 > **_NOTE:_**    Your system may install `pip` as `pip3` like above, or just `pip` 

 If you run the above command as a regular user, the `chirp` executable will be installed into `~/.local/bin/chirp`. If you run it as root, then it will be in `/usr/local/bin/chirp` as you might normally expect. 

 ### Create a desktop (menu) entry 

 A desktop entry can be placed in `/usr/share/applications/chirp.desktop` to have a menu entry added. Or it can be placed on the desktop itself to add an icon. 

 See the template desktop entry distributed with chirp: https://github.com/kk7ds/chirp/blob/master/chirp/share/chirp.desktop 

 If you have installed chirp for your user only, then update the paths for your home directory: `~/.local/share/applications/chirp.desktop` 

 ``` 
 [Desktop Entry] 
 Name=CHiRP-next (user install) 
 Comment=Program radios using CHiRP 
 Keywords=ham radio 
 Exec=.local/bin/chirp 
 Icon=.local/lib/python3.9/site-packages/chirp/share/chirp.ico 
 Terminal=false 
 StartupNotify=true 
 Type=Application 
 Categories=HamRadio 
 ``` 

 ### (Optional) Newer `wxPython` 

 You may want to install a newer wxPython, depending on what your distro ships. For Debian-derived distros (including Ubuntu and Mint) you can do that with a command like: 
 ``` 
 pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython 
 ``` 
 Check the [directory listing](https://extras.wxpython.org/wxPython4/extras/linux/gtk3/) for other distro versions and use the closest match to what you're on. **NOTE** that this will not work for non-x86_64 machines (like the Raspberry Pi) as there are no binary builds for those platforms. 

 ## **Fedora Python 3.11 issues 

 Right now (as of 9-March-2023), testing and compatible** released builds are based on <=3.10. If you want to run chirp on a distro with 3.11 you'll likely have to do some work on your own. 

 For issues with `attrdict` see [this github issue](https://github.com/wxWidgets/Phoenix/issues/2296). 

 ## Serial port permissions 

 Note that you may need to add your users who want to use CHIRP to the group that owns the serial ports. This issue is often indicated by an "access denied" error when accessing serial port. Determine the group ownership of your serial port like this (assuming `ttyUSB0`): 

 ``` 
 $ stat -c %G /dev/ttyUSB0 
 dialout 
 ``` 

 Now you need to add your user to that group. On most Linux distros this is accomplished with: 

 ``` 
 sudo usermod -a -G dialout $USER 
 ``` 

 Be sure to use whatever group the above `stat` command reported. 

 You will then need to log out and back in for it to take effect. 

 ## **Installation on Fedora 37 running Python 3.11** 
 This was performed and tested on a clean installation of Fedora 37 with python 3.11. that was fully updated before installing chirp. 
 The same procedure should work on all current versions of fedora running python3. 


 First install certain system level packages 

 Install prerequisite packages: 

 ``` 
 sudo dnf install python3-pip python3-wxpython4 
 ``` 

 ## The next steps should work for all versions of linux using pip. 

 Use Now use pip to install the following packages as your regular user. 

 ``` 
 pip install wheel attrdict3 
 ``` 

 Download the latest .tar.gz file then install it with `pip`. For example: 

 ``` 
 pip install chirp-20230322.tar.gz chirp-20230219.tar.gz 
 ``` 

 Now When this is complete you can test it from the operation. 

 First make certain that your user is a member of the dialout group with the command line "groups". 
 If necessary add your user to the dialout group with  

 ``` 
 chirp sudo usermod -aG dialout $USER 
 ``` 
 If  
 as noted above.    To have that does not work try take effect you must log out then back in. 
 Again verify with the "groups" command. 

 Now you can test it from the command line with  
 ``` 
 ~/.local/bin/chirp chirp 
 ``` 
 The executable is installed as ~/.local/bin/chirp (or as /usr/local/bin/chirp if sudo was used to do in ~/.local/bin 

 when this works you can add the install). desktop file with  
 ``` 
 The first time chirp is    launched from the command line it should pop up a prompt to add the .desktop file.   
 Select "yes" if $ cp .local/lib/python3.11/site-packages/chirp/share/chirp.desktop .local/share/applications/ 
 ``` 
 which gives you want to have the icon on the activities menu to launch chirp. 
 You might choose to edit the desktop file in .local/share/applications and change the path to the icon to read  

 ``` 
 /home/<username>/.local/lib/python3.11/site-packages/chirp/share/chirp.ico 
 ``` 
 so it properly shows the chirp icon image. 

 If the command "chirp" does not work please check your path to verify it is complete. The command "echo $PATH" should show "`/home/<username>/.local/bin:`" at the beginning.    If not that can be fixed by editing the ~/.bashrc or ~/.bash_profile to add that to the existing $PATH.    If the path is configured properly then chirp the desktop file should be able to launch with the "chirp" command. chirp for your user. 

 Note that the device used as the comm port may be either /dev/ttyUSB0 or /dev/ttyACM0 so the user might need to verify which port is available.    Chirp does not seem to automatically detect the /dev/ttyACM0 port so the user may need to select the 'custom' port and enter it manually. 

 Following the steps above (without sudo) installs the app as a user level app and it will only be accessible to that user. 

 Once chirp is properly installed, installed upgrades to newer versions are done with two simple steps: simply: 

 1. download the newer .tar.gz file. 
 2. 1. `pip install --upgrade chirp-<version>.tar.gz` 


 ## Serial port permissions 

 Note that you may need to add your users who want to use CHIRP to the group that owns the serial ports. This issue is often indicated by an "access denied" error when accessing serial port. Determine the group ownership of your serial port like this (assuming `ttyUSB0`): 

 ``` 
 $ stat -c %G /dev/ttyUSB0 
 dialout 
 ``` 

 Now you need to add your user to that group. On most Linux distros this is accomplished with: 

 ``` 
 sudo usermod -a -G dialout $USER 
 ``` 

 Be sure to use whatever group the above `stat` command reported. 

 You will then need to log out and back in (or maybe even reboot) for it to take effect. 

 ### (Optional) Newer `wxPython` 

 You may want to install a newer wxPython, depending on what your distro ships. For Debian-derived distros (including Ubuntu and Mint) you can do that with a command like: 
 ``` 
 pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython 
 ``` 
 Check the [directory listing](https://extras.wxpython.org/wxPython4/extras/linux/gtk3/) for other distro versions and use the closest match to what you're on. **NOTE** that this will not work for non-x86_64 machines (like the Raspberry Pi) as there are no binary builds for those platforms.