Project

General

Profile

ChirpOnLinux » History » Version 12

Jeffrey Vian, 03/20/2023 04:11 PM

1 1 Dan Smith
# Running CHIRP on Linux
2
3
This page describes how to get the newer python3-based CHIRP-next running on Linux.
4
5
## Debian, Ubuntu, Mint, Raspbian, etc
6
7
Install prerequisite packages:
8
9
```
10
$ sudo apt install git python3-wxgtk4.0 python3-serial python3-six python3-future python3-requests python3-pip
11
```
12
13
You should be able to install either the wheel or the tarball using `pip`:
14
15
```
16
$ pip3 install chirp-next-20230114.tar.gz
17
```
18
> **_NOTE:_**  Your system may install `pip` as `pip3` like above, or just `pip`
19
20
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.
21 2 Dan Smith
22 4 Masen Furer
### Create a desktop (menu) entry
23
24 6 Masen Furer
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.
25 4 Masen Furer
26 6 Masen Furer
See the template desktop entry distributed with chirp: https://github.com/kk7ds/chirp/blob/master/chirp/share/chirp.desktop
27 4 Masen Furer
28 6 Masen Furer
If you have installed chirp for your user only, then update the paths for your home directory: `~/.local/share/applications/chirp.desktop`
29 4 Masen Furer
30
```
31
[Desktop Entry]
32
Name=CHiRP-next (user install)
33
Comment=Program radios using CHiRP
34
Keywords=ham radio
35
Exec=.local/bin/chirp
36
Icon=.local/lib/python3.9/site-packages/chirp/share/chirp.ico
37
Terminal=false
38
StartupNotify=true
39
Type=Application
40
Categories=HamRadio
41
```
42
43
### (Optional) Newer `wxPython`
44
45
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:
46 2 Dan Smith
```
47
pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
48
```
49 3 Dan Smith
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.
50 5 Masen Furer
51 7 Dan Smith
## Python 3.11 issues
52
53
Right now (as of 9-March-2023), testing and 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.
54
55
For issues with `attrdict` see [this github issue](https://github.com/wxWidgets/Phoenix/issues/2296).
56
57 5 Masen Furer
## Serial port permissions
58
59 8 Dan Smith
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`):
60 1 Dan Smith
61 8 Dan Smith
```
62
$ stat -c %G /dev/ttyUSB0
63
dialout
64
```
65 1 Dan Smith
66 8 Dan Smith
Now you need to add your user to that group. On most Linux distros this is accomplished with:
67 1 Dan Smith
68 5 Masen Furer
```
69 8 Dan Smith
sudo usermod -a -G dialout $USER
70 5 Masen Furer
```
71
72 8 Dan Smith
Be sure to use whatever group the above `stat` command reported.
73 5 Masen Furer
74
You will then need to log out and back in for it to take effect.
75 9 Jeffrey Vian
76 10 Jeffrey Vian
## **Installation on Fedora 37 running Python 3.11**
77 11 Dan Smith
This was performed and tested on a clean installation of Fedora 37 that was fully updated before installing chirp.
78 12 Jeffrey Vian
The same procedure should work on all current versions of fedora running python3.
79
80 9 Jeffrey Vian
81 1 Dan Smith
First install certain system level packages
82
83 10 Jeffrey Vian
```
84
sudo dnf install python3-pip python3-devel gtk3-devel
85
```
86 1 Dan Smith
87
Now use pip to install the following packages as your regular user.
88 9 Jeffrey Vian
89 10 Jeffrey Vian
```
90
pip install wheel attrdict3
91
pip install wxpython
92
```
93 9 Jeffrey Vian
94 11 Dan Smith
The installation of wxpython may take some time to complete so be patient while it is running. Once the steps above have completed download and use pip to install the packages from the download site.
95 1 Dan Smith
96 11 Dan Smith
Download the .tar.gz file then install it with `pip`. For example:
97 10 Jeffrey Vian
98
```
99
pip install chirp-20230219.tar.gz
100
```
101
102 1 Dan Smith
When this is complete you can test the operation.
103 9 Jeffrey Vian
104 1 Dan Smith
First make certain that your user is a member of the dialout group with the command `groups`.
105 10 Jeffrey Vian
If necessary add your user to the dialout group with 
106
107
```
108
sudo usermod -aG dialout $USER
109
``` 
110
as noted above.  To have that take effect you must log out then back in.
111 1 Dan Smith
Again verify with the `groups` command.
112
113 10 Jeffrey Vian
Now you can test it from the command line with 
114
```
115
chirp
116
```
117
The executable is installed in ~/.local/bin
118
119 1 Dan Smith
when this works you can add the desktop file with 
120 10 Jeffrey Vian
```
121
$ cp .local/lib/python3.11/site-packages/chirp/share/chirp.desktop .local/share/applications/
122
```
123
which gives you the icon on the activities menu to launch chirp.
124 9 Jeffrey Vian
You might choose to edit the desktop file in .local/share/applications and change the path to the icon to read 
125
126 10 Jeffrey Vian
```
127
/home/<username>/.local/lib/python3.11/site-packages/chirp/share/chirp.ico
128
```
129
so it properly shows the chirp icon image.
130 1 Dan Smith
131
If the command `chirp` does not work please check your path to verify it is complete as mine is. 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 the desktop file should be able to launch chirp for your user.
132 10 Jeffrey Vian
133 1 Dan Smith
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 device so the user may need to use the 'custom' device and enter it manually.
134 9 Jeffrey Vian
135
Following the steps above installs the app as a user level app and it will only be accessible to that user.
136
137 11 Dan Smith
Once installed upgrades to newer versions are done simply:
138
139 9 Jeffrey Vian
1. download the newer .tar.gz file.
140 11 Dan Smith
1. `pip install --upgrade chirp-<version>.tar.gz`