ChirpOnLinux » History » Version 15
Jeffrey Vian, 03/20/2023 07:52 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 | 14 | Jeffrey Vian | sudo dnf install python3-pip python3-wxpython4 |
85 | 10 | Jeffrey Vian | ``` |
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 | ``` |
||
92 | 1 | Dan Smith | |
93 | 11 | Dan Smith | Download the .tar.gz file then install it with `pip`. For example: |
94 | 10 | Jeffrey Vian | |
95 | ``` |
||
96 | pip install chirp-20230219.tar.gz |
||
97 | 1 | Dan Smith | ``` |
98 | 10 | Jeffrey Vian | |
99 | When this is complete you can test the operation. |
||
100 | 9 | Jeffrey Vian | |
101 | 13 | Jeffrey Vian | First make certain that your user is a member of the dialout group with the command "groups". |
102 | 10 | Jeffrey Vian | If necessary add your user to the dialout group with |
103 | 1 | Dan Smith | |
104 | 10 | Jeffrey Vian | ``` |
105 | sudo usermod -aG dialout $USER |
||
106 | ``` |
||
107 | as noted above. To have that take effect you must log out then back in. |
||
108 | 13 | Jeffrey Vian | Again verify with the "groups" command. |
109 | 1 | Dan Smith | |
110 | 10 | Jeffrey Vian | Now you can test it from the command line with |
111 | ``` |
||
112 | chirp |
||
113 | ``` |
||
114 | The executable is installed in ~/.local/bin |
||
115 | |||
116 | 1 | Dan Smith | when this works you can add the desktop file with |
117 | 10 | Jeffrey Vian | ``` |
118 | $ cp .local/lib/python3.11/site-packages/chirp/share/chirp.desktop .local/share/applications/ |
||
119 | ``` |
||
120 | which gives you the icon on the activities menu to launch chirp. |
||
121 | 9 | Jeffrey Vian | You might choose to edit the desktop file in .local/share/applications and change the path to the icon to read |
122 | 1 | Dan Smith | |
123 | 9 | Jeffrey Vian | ``` |
124 | 10 | Jeffrey Vian | /home/<username>/.local/lib/python3.11/site-packages/chirp/share/chirp.ico |
125 | ``` |
||
126 | so it properly shows the chirp icon image. |
||
127 | 1 | Dan Smith | |
128 | 15 | Jeffrey Vian | 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 the desktop file should be able to launch chirp for your user. |
129 | 10 | Jeffrey Vian | |
130 | 15 | Jeffrey Vian | 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. |
131 | 9 | Jeffrey Vian | |
132 | Following the steps above installs the app as a user level app and it will only be accessible to that user. |
||
133 | |||
134 | 11 | Dan Smith | Once installed upgrades to newer versions are done simply: |
135 | |||
136 | 9 | Jeffrey Vian | 1. download the newer .tar.gz file. |
137 | 11 | Dan Smith | 1. `pip install --upgrade chirp-<version>.tar.gz` |