Python module to communicate with SportIdent main stations
Project description
Sireader is a python module to communicate with a SportIdent main station to read out SportIdent cards. SportIdent is an electronic punching system mainly used for orienteering events.
Sireader supports two major operation modes. It can be used for complete card readout or in control station mode to send punches from a control. The first mode is typically used for card readout after the finish line to read the card data into an event software. The second mode is used to get live result from an intermediate control.
Website: http://bosco.durcheinandertal.ch/
GIT Repository: https://github.com/gaudenz/sireader/
Usage
There are 3 classes in the sireader module. SIReader is the base class containing common functions. It’s imported to have easy access to it’s constants. SIReaderReadout implements classical card readout. SIReaderControl implements a station configured as control which continuously sends punches.
First import the relevant classes:
from sireader import SIReader, SIReaderReadout, SIReaderControl
SIReader only supports the so called “Extended Protocol” mode. If your base station is not in this mode you have to change the protocol mode first:
# change to extended protocol mode si.set_extended_protocol()
To use a SportIdent base station for card readout:
from time import sleep # connect to base station, the station is automatically detected, # if this does not work, give the path to the port as an argument # see the pyserial documentation for further information. si = SIReaderReadout() # wait for a card to be inserted into the reader while not si.poll_sicard(): sleep(1) # some properties are now set card_number = si.sicard card_type = si.cardtype # read out card data card_data = si.read_sicard() # beep si.ack_sicard()
To use a base station as a control sending punches:
# configure station si.set_operating_mode(SIReader.M_CONTROL) si.set_station_code(99) si.set_autosend() # connect to station si = SIReaderControl() # poll for new punches punches = si.poll_punch() # reset station configuration si.set_operating_mode(SIReader.M_READOUT) si.set_autosend(False)
Finally set the station back to basic protocol:
# change back to basic protocl si.set_extended_protocol(False)
API Documentation
Complete documentation is contained in the module source code and can be read online at:
http://bosco.durcheinandertal.ch/epydoc-sireader/
This documentation is autogenerated from the source code and represents the version in the GIT repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sireader-1.1.3.tar.gz
.
File metadata
- Download URL: sireader-1.1.3.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd3aae668135e2f4d2c5fb785fafb2424a08fc423723b15cbc752e3897a6e8c |
|
MD5 | 2b2cd5b021776e9f1d98e88d21ba9170 |
|
BLAKE2b-256 | 264544270ad02dc350cc127df456610ab2b487efe8d4bf53fb6d7f8e3979f954 |
File details
Details for the file sireader-1.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: sireader-1.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c2e82a5de4d9e08ba9042053f4dbe7f6dab197809cebbe844484dc30d5eb9dc |
|
MD5 | e7376ea7f55da2e0af5becb60179e516 |
|
BLAKE2b-256 | a284e2d1c2f4c1c744a2bb388ebfed43b5241e395d0848cdb9dfce93a31c1ff8 |