Skip to main content

cdpop

Pop open cash drawer using http or https GET request:

GET /status	Return cash drawer status
GET /open	Request cash drawer open

If authentication is configured, supply user and/or auth as query parameters, eg:

GET /status?auth=Ricim8Knak

Requests to open drawer will return successfully (200) as soon as possible, but will be processed in turn once access to the attached device is available. No feedback is provided for an open request.

Requests for status will block until a valid status can be read from the attached device. In the case of a hardware error, status requests will return Internal Server Error (500).

Usage

$ cdpop [config.json]

Requirements

  • python >= 3.9
  • tornado
  • posiflex-hidcd

Configuration

Copy example config to a new file and edit as required. Available configuration options:

  • port (int) TCP service port, default: 41514 (optional)
  • host (string) Listen address, default: "localhost" (optional)
  • cert (string) TLS certificate path, default: None (optional)
  • key (string) TLS private key path, default: None (optional)
  • auth (string) Authorisation key, default: None (optional)
  • user (string) Authorisation username, default: None (optional)
  • drawer (int) Cash drawer number, default: None (optional)

Notes:

  • If drawer number is not specified, cdpop will connect to the first hid cash drawer found. See related project posiflex-hidcd for details.
  • To listen on all addresses, specify the empty string "" for host.

MacOS Installation

Install xcode developer tools:

$ xcode-select --install

Install brew according to brew website.

Install hidapi using brew:

$ brew install hidapi

Install python3 if not already installed:

$ brew install python@3.12

Using python, create a venv and install cdpop packages using pip:

$ python3 -m venv cdpop --system-site-packages
$ ./cdpop/bin/pip install cdpop

Optionally, create a cdpop config file.

Create launch agent plist file (see example cdpop.plist), copy to ~/Library/LaunchAgents and enable using launchctl:

$ cp cdpop.plist /Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/cdpop.plist
$ launchctl enable xxx/yyy/cdpop
$ launchctl kickstart -k xxx/yyy/cdpop

Metadata

Release files for cdpop 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdpop 1.0.0
File Size Uploaded
cdpop-1.0.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cdpop 1.0.0
File Interpreter ABI Platform
cdpop-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / cdpop-1.0.0.tar.gz

Download URL cdpop-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a4bade716310c8b6ea0b575f114308446741dfac3142941c38f212afa83812ea
BLAKE2b-256 checksum
How to use checksums
53749aae6297ac2b06a2e41b639ba3db64534df6429da5c71e456169ab4daafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / cdpop-1.0.0-py3-none-any.whl

Download URL cdpop-1.0.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
459fa696d3ff7812c62f20d675c251abe782cba3b3ef1be4da9dd52329959c71
BLAKE2b-256 checksum
How to use checksums
9b73d0f11eb26d2357b506a649306a711e6d92433b99913f02b5ccf0916ae726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page