|
3 | 3 | **An Unofficial Python API for the tinySA Device Series** |
4 | 4 |
|
5 | 5 | [](https://badge.fury.io/py/tsapython) |
| 6 | +[](https://pypi.org/project/tsapython/) |
| 7 | +[](https://pypi.org/project/tsapython/) |
| 8 | +[](https://pepy.tech/project/tsapython) |
6 | 9 | [](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) |
| 10 | +[](https://doi.org/10.5281/zenodo.20546764) |
7 | 11 |
|
8 | | -A Non-GUI Python API for the tinySA series of spectrum analyzer devices. This library provides programmatic control over tinySA devices for automated measurements, data collection, and analysis. |
| 12 | +A non-GUI Python API for the tinySA series of spectrum analyzer devices. This library provides programmatic control over tinySA devices for automated measurements, data collection, and analysis. |
9 | 13 |
|
10 | | -Popular features: |
| 14 | +This repository uses official resources and documentation but is **NOT** endorsed by the official tinySA product, owner, or company. Refer to official resources and support for product information. This library was built for the official tinySA device line(s); knock-off or custom devices may not be compatible and have not been tested. |
11 | 15 |
|
12 | | -- **Device Discovery**: Automatic detection and serial connection to tinySA devices |
13 | | -- **Frequency Sweeps**: Collect data across specified frequency ranges |
14 | | -- **Multiple Modes**: Support for both input and output modes (device dependent) |
15 | | -- **Data Export**: Easy integration with matplotlib and numpy |
16 | | -- **Error Handling**: Error checking and verbose output options |
17 | | -- **Device Control**: Full programmatic control of tinySA settings and measurements |
| 16 | +## Features |
18 | 17 |
|
| 18 | +- **Device Discovery** — automatic detection and serial connection to tinySA devices |
| 19 | +- **Frequency Sweeps** — collect data across specified frequency ranges |
| 20 | +- **Multiple Modes** — support for both input and output modes (device dependent) |
| 21 | +- **Data Export** — easy integration with `matplotlib` and `numpy` |
| 22 | +- **Error Handling** — input checking and verbose output options |
| 23 | +- **Device Control** — full programmatic control of tinySA settings and measurements |
19 | 24 |
|
20 | | -This repository uses official resources and documentation but is **NOT** endorsed by the official tinySA product, owner, or company. Refer to official resources and support for product information. This library was built for the official tinySA device line(s), so any knock-off or custom devices may not be compatible with the library. Unofficial devices have not been tested. |
| 25 | +## Installation |
21 | 26 |
|
| 27 | +```bash |
| 28 | +pip install tsapython |
| 29 | +``` |
22 | 30 |
|
| 31 | +The library itself depends only on `numpy` and `pyserial`. The plotting examples need an optional extra: |
23 | 32 |
|
| 33 | +```bash |
| 34 | +pip install "tsapython[plotting]" |
| 35 | +``` |
24 | 36 |
|
25 | | -## Full Code Examples: |
| 37 | +## Quick Start |
| 38 | + |
| 39 | +```python |
| 40 | +from tsapython import tinySA |
| 41 | + |
| 42 | +tsa = tinySA() |
| 43 | +found, connected = tsa.autoconnect() |
| 44 | +if connected: |
| 45 | + print(tsa.device_id()) |
| 46 | + tsa.disconnect() |
| 47 | +``` |
| 48 | + |
| 49 | +## Examples |
| 50 | + |
| 51 | +The [main GitHub repository](https://github.com/LC-Linkous/tinySA_python) provides runnable examples, grouped by what they demonstrate. |
26 | 52 |
|
27 | | - |
28 | | -The README on the [main GitHub repo](https://github.com/LC-Linkous/tinySA_python) provides runnable examples, grouped by what they demonstrate: |
29 | | - |
30 | 53 | **Getting started / device control** |
| 54 | + |
31 | 55 | - `using_autoconnect.py` — detect and connect to a tinySA, read the device ID |
32 | 56 | - `identifying_serial_ports.py` — manually identify serial ports (useful if autoconnect has trouble) |
33 | 57 | - `using_command_func.py` — send raw device commands for functionality not yet wrapped by the library |
34 | 58 | - `hardware_walkthrough.py` — a guided walkthrough of connecting and reading device info/data |
35 | 59 | - `complete_workflow.py` — end-to-end: connect, read info, collect a sweep, and plot it |
| 60 | + |
36 | 61 | **Plotting scan data** |
| 62 | + |
37 | 63 | - `plotting_scan.py` — plot a single `scan` |
38 | 64 | - `plotting_scanraw.py` — compare `scan` vs. the binary `scanraw` (with decoding to dBm) |
39 | 65 | - `plotting_waterfall_static.py` — collect several sweeps and render a static waterfall plot |
40 | 66 | - `plotting_waterfall_realtime.py` — a live, continuously updating waterfall plot |
| 67 | + |
41 | 68 | **Continuous acquisition** |
| 69 | + |
42 | 70 | - `continuous_scanraw_live.py` — loop `scan_raw` and live-plot each frame |
43 | 71 | - `continuous_scanraw_collect.py` — loop `scan_raw`, decode to dBm, and save sweeps to CSV |
| 72 | + |
| 73 | +**Analysis** |
| 74 | + |
| 75 | +- `find_peaks.py` — find the strongest signal(s) two ways: the device's marker peak, and a Python multi-peak finder over scan data |
| 76 | +- `filtering_scan_artifacts.py` — show the `:` firmware artifact and compare a median filter against a moving average on one figure |
| 77 | + |
44 | 78 | **Exporting data** |
| 79 | + |
45 | 80 | - `save_scan_csv.py` — run a scan and write frequency/power pairs to a CSV file |
| 81 | + |
46 | 82 | > Most plotting examples require the optional plotting dependencies: |
47 | 83 | > `pip install "tsapython[plotting]"` |
48 | 84 |
|
49 | | - |
50 | | -## Documentation & Examples |
| 85 | +## Documentation |
51 | 86 |
|
52 | 87 | For comprehensive documentation, advanced examples, and troubleshooting: |
53 | 88 |
|
54 | | -- **Library GitHub Repository**: [https://github.com/LC-Linkous/tinySA_python/](https://github.com/LC-Linkous/tinySA_python/) |
55 | | -- **Official tinySA Documentation**: [https://tinysa.org/wiki/](https://tinysa.org/wiki/), not associated with this library |
| 89 | +- **Library GitHub repository**: [https://github.com/LC-Linkous/tinySA_python/](https://github.com/LC-Linkous/tinySA_python/) |
| 90 | +- **Official tinySA documentation**: [https://tinysa.org/wiki/](https://tinysa.org/wiki/) (not associated with this library) |
56 | 91 |
|
57 | 92 | ## Contributing |
58 | 93 |
|
59 | 94 | This is an unofficial community project. Contributions welcome! |
60 | 95 |
|
61 | | -- Report bugs and request features on [GitHub]( https://github.com/LC-Linkous/tinySA_python) |
| 96 | +- Report bugs and request features on [GitHub](https://github.com/LC-Linkous/tinySA_python) |
| 97 | +- For device information and OFFICIAL resources, see the official tinySA community at [https://groups.io/g/tinysa](https://groups.io/g/tinysa) |
| 98 | + - Please do **NOT** request features or report bugs on the official community! This is an unofficial project and they do not maintain it. |
| 99 | + |
| 100 | +## Citing |
62 | 101 |
|
63 | | -- For device information and OFFICIAL resources, check the official tinySA community at [https://groups.io/g/tinysa](https://groups.io/g/tinysa) |
64 | | - - Please do NOT request features or report bugs on the official community! This is an unofficial project and they do not maintain it. |
| 102 | +If you use this library in your work, citation details are in the repository's `CITATION.cff`, or use the Zenodo DOI: [10.5281/zenodo.20546764](https://doi.org/10.5281/zenodo.20546764). |
65 | 103 |
|
66 | 104 | ## License |
67 | 105 |
|
68 | | -GPL-2.0 - This is unofficial software with no warranty, offered AS-IS. Use at your own risk. |
| 106 | +GPL-2.0 — this is unofficial software with no warranty, offered AS-IS. Use at your own risk. |
69 | 107 |
|
70 | 108 | The licensing of this software does NOT take priority over the official releases and the decisions of the official tinySA team. This licensing does NOT take priority for any of their products, including the devices that can be used with this software. |
71 | 109 |
|
72 | 110 | ## Acknowledgments |
73 | 111 |
|
74 | | -- tinySA device creators and community, who have created an awesome device |
75 | | -- Official tinySA documentation and resources, especially www.tinysa.org/wiki/ |
| 112 | +- The tinySA device creators and community, who have created an awesome device |
| 113 | +- Official tinySA documentation and resources, especially [www.tinysa.org/wiki/](https://www.tinysa.org/wiki/) |
76 | 114 | - All contributors to this library, including those who have contributed code and reached out with questions |
77 | 115 |
|
78 | 116 | --- |
79 | 117 |
|
80 | | -**Disclaimer**: This software is unofficial and not supported by the tinySA team. For official software and support, visit [tinysa.org](https://tinysa.org). The tinySA team does not offer tech support for this software, does not maintain it, and has no responsibility for any of the contents. |
81 | | - |
82 | | - |
| 118 | +**Disclaimer**: This software is unofficial and not supported by the tinySA team. For official software and support, visit [tinysa.org](https://tinysa.org). The tinySA team does not offer tech support for this software, does not maintain it, and has no responsibility for any of the contents. |
0 commit comments