https://github.com/rsc-dev/loophole
Polar devices Python API and CLI.
https://github.com/rsc-dev/loophole
api cli polar polar-devices python reverse-engineering
Last synced: 7 months ago
JSON representation
Polar devices Python API and CLI.
- Host: GitHub
- URL: https://github.com/rsc-dev/loophole
- Owner: rsc-dev
- License: mit
- Created: 2016-01-20T09:33:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-01-12T17:34:33.000Z (about 5 years ago)
- Last Synced: 2025-07-02T23:57:03.068Z (7 months ago)
- Topics: api, cli, polar, polar-devices, python, reverse-engineering
- Language: Python
- Homepage:
- Size: 182 KB
- Stars: 147
- Watchers: 14
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# loophole - Polar devices API
[](https://pypi.python.org/pypi/loophole)
[](https://gitter.im/rsc-dev/loophole?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## About
Python API for Polar devices. Command line interface included.
Tested with:
* A360
* Loop
* M400
## Installation
```sh
pip install loophole
```
or
```sh
python setup.py install
```
## Usage
### CLI
Invoke CLI:
```bash
python __main__.py
```
Type '?' or 'help' to see available commands.
```python
_| _| _|
_| _|_| _|_| _|_|_| _|_|_| _|_| _| _|_|
_| _| _| _| _| _| _| _| _| _| _| _| _|_|_|_|
_| _| _| _| _| _| _| _| _| _| _| _| _|
_| _|_| _|_| _|_|_| _| _| _|_| _| _|_|_|
_|
_|
ver. 0.3
loophole(no device)>?
Documented commands (type help ):
========================================
connect disconnect exit help info list walk
```
| Command | Description |
| --- | --- |
| connect \ | Connect Polar device. Run 'list' to see available devices. |
| disconnect | Disconnect Polar device. |
| dump \ | Dump device memory. |
| get \ \| Read file from device. |
| exit | Quit. |
| help | List available commands with "help" or detailed help with "help cmd". |
| info | Print connected device info. |
| list | List available Polar devices. |
| walk [path] | Walk file system. Default path is root path (\\). |
### permissions
Note: You need the right permission to access the USB device. Otherwise you will get the error: `The device has no langid`
e.g.: run as root via sudo:
```bash
sudo python __main__.py
```
Or create udev role.
```bash
cat - > /etc/udev/rules.d/40-Polar_A360.rules << EOF
#Polar A360 permissions granted to users group
SUBSYSTEM=="usb", ATTRS{idProduct}=="0008", ATTRS{idVendor}=="0da4", MODE="0660", GROUP="plugdev"
SUBSYSTEMS=="usb-serial", MODE="0660", GROUP="plugdev"
EOF
udevadm control --reload-rules && udevadm trigger
```
### Dependencies
* [protobuf](https://pypi.python.org/pypi/protobuf/3.0.0b2)
* [pywinusb](https://pypi.python.org/pypi/pywinusb/) (Windows)
* [pyusb] (https://github.com/walac/pyusb) (Linux, > 1.0.0rc1)
#### for debian/ubuntu:
```bash
sudo apt install python-protobuf python-usb
```
## Changelog
[Here](https://github.com/rsc-dev/loophole/blob/master/CHANGELOG.md).
## License
Code is released under [MIT license](https://github.com/rsc-dev/loophole/blob/master/LICENSE.md) © [Radoslaw '[rsc]' Matusiak](https://rm2084.blogspot.com/).