Serial SDARS receiver control in Python
CaniPy provides a modern foundation for hobbyists to continue using supported satellite radio hardware.
The project can either be used by itself with a GUI or as a module that can be imported to support other scripts.
Taking advantage of Python's more legible syntax, other projects can adapt this code for their needs and understand the control commands of the supported hardware.
The following are required to run CaniPy:
- A system that meets the minimum requirements for Python 3.10
- Windows 8.1 or higher
- macOS 10.9 or higher
- By default at least Ubuntu 22.04, Debian Bookworm, Fedora 35, EL 9, etc.
- A compatible serial-controlled satellite radio that is listed below, which receives the XM service by Sirius XM Radio LLC
| Device | Baud Rate |
|---|---|
| PCR | 9600 |
| Direct | 9600 |
| Commander | 9600 |
| WX (Portable) | 38400 |
| WX (Certified) | 115200 |
Further support for other devices may be implemented in the future
Warning
On Windows, the standalone EXE may get flagged due to its use of PyInstaller for packaging. This is a false positive!
You may alternatively download the source code package and run the main script directly if issues persist when attempting to run the packaged EXE.
The program can be run via either the latest pre-packaged executable from the releases page, the main script if using the source code (python3 main.py), or by making a packaged executable in the target system.
- Connect the tuner to the computer.
- Open the main program to start the CaniPy UI.
- Select and verify the device's COM/TTY port path from the drop-down menu. See below for guidance depending on your operating system. If the device is using a different path, you may change it by typing in the device port box.
- Select the corresponding device type from the drop-down menu underneath to connect and power it on.
- Change channels if needed by first changing the number on the channel input field and then clicking the "Enter" button.
- Assign a channel to a preset by clicking one of the 6 buttons. To clear the preset, go to "Settings" > "Clear preset" and select the button's number.
- Mute and unmute the audio by going to "File" > "Mute".
- Set the time zone and clock display settings in "Settings" > "Clock".
- Close the program when done. Time display settings and presets will be stored in a configuration file.
You can verify the COM port corresponding to the radio through the Device Manager and expanding the "Ports (COM & LPT)" dropdown.
The serial port device path starts with etiher /dev/ttyUSB* or /dev/ttyS*.
The serial port device path starts with etiher /dev/cu.usbserial* or /dev/cu.*.
Important
Certain Linux distributions, such as those that descend from Debian or use its APT package manager (Ubuntu included), provide pip and the graphical interface library used by CaniPy as discrete packages.
In this case, please make sure both python3-pip and python3-tk are installed through your distro's default package manager before building CaniPy.
If making a standalone CaniPy executable, first download the released source ZIP or TAR.GZ or clone the repo (git clone //link/to/canipy.git), then install pySerial and PyInstaller.
These prerequisites will be installed via pip automatically when using either make all or make deps. They can alternatively be installed manually following the requirements.txt list.
# Recommended (deps, build)
make all # Linux, Mac
.\build.ps1 -Task all # Windows
# Package only
make
.\build.ps1
# Package terminal version only
make term
.\build.ps1 -Task term
# Install req's only
make deps
.\build.ps1 -Task deps
# Clear artifacts
make clean
.\build.ps1 -Task clean
# clear, deps, build
make rebuild
.\build.ps1 -Task rebuild
# clear, build
make rebuild SKIP_DEPS=1
.\build.ps1 -Task rebuild -SkipDeps 1To use CaniPy as an extension for your project, if using Git for version tracking, it is possible to add the repo as a submodule (git submodule add //link/to/canipy.git). Otherwise, simply clone this repo in your project root.
Once CaniPy is added to a project, import it to the script using from canipy import CaniPy and start a CaniPy() instance.
To report issues encountered with CaniPy, file a new issue in either GitHub or GitLab.
Before filing, ensure the issue has not yet been reported in these pages before proceeding and that necessary troubleshooting steps are taken, such as running the software in a folder/directory that can be written to and ensuring the serial device is visible to the operating system.
Describe the issue with the sufficient detail necessary to diagnose it. Screenshots, along with error logs and messages, are also beneficial when possible.
Figured out an unknown return code or a new command, or want to help with the proram functionality? You can fork the project and submit a PR with your additions or file an issue request with the needed support logs (Ensure verbose output is on).
This codebase is derived from PyXM by Timothy Canham, under the Apache 2.0 license.
Serial commands were documented from both current CaniSat research and prior work conducted by Nick Sayer, the linuXMPCR and Perl XM PCR projects, Hybrid Mobile Technologies, and the defunct XM Fan forums.
CaniSat, a non-profit initiative, and its incubator NetOtt Solutions, LLC are not affiliated with either Sirius XM Holdings Inc, Sirius XM Radio LLC, Sirius XM Canada Inc, or any of their products, partners, or subsidiaries. Sirius, XM, SiriusXM, XMWX, and all related indicia are registered trademarks of Sirius XM Radio LLC.
The data products distributed in the service(s) are intended to be supplemental and advisory per the provider. It is not recommended for use in circumstances that require immediate urgency to fulfill safety-critical work. Both CaniSat and the service provider are not responsible for errors and inaccuracies encountered when utilizing the service data products.
CaniSat does not condone or encourage the use of its affiliated projects for unauthorized copying, duplication, or distribution of copyrighted materials received through the supported services. The end user is solely responsible for ensuring their activities comply with applicable copyright laws and service terms. Don't steal music.