Skip to main content

COOPER Control Tool

Travis Release License PyPI

This is the Gateway tool for cooper dongle

Installation

You can install cpgw directly from PyPI:

sudo pip3 install -U cpgw

Note: You may need to use sudo before the command - it depends on the operating system used...

Configuration

Insert this snippet to the file /etc/cooper/cpgw.yml:

device: /dev/ttyUSB0
zmq:
  publisher:
    host: 127.0.0.1
    port: 5680
  dispatcher:
    host: 127.0.0.1
    port: 5681

Usage

cpgw -c /etc/cooper/cpgw.yml

Start using systemd

Insert this snippet to the file /etc/systemd/system/cpgw.service:

[Unit]
Description=COOPER cpgw
After=network.target

[Service]
Type=simple
User=pi
ExecStart=/usr/local/bin/cpgw -c /etc/cooper/cpgw.yml
Restart=always
RestartSec=5
StartLimitIntervalSec=0

[Install]
WantedBy=multi-user.target

Start the service:

systemctl start cpgw.service

Enable the service start on boot:

systemctl enable cpgw.service

View the service log:

journalctl -u cpgw.service -f

Start using PM2

pm2 start `which python3` --name "cpgw" -- `which cpgw` -c /etc/cooper/cpgw.yml

Usage as Python module

from cpgw.gateway import Gateway

def on_recv(payload):
    print(payload)

gw = Gateway("/dev/ttyUSB0")
gw.on_recv = on_recv
gw.run()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for cpgw 1.7.1

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

Source distribution (sdist)

Source distribution for cpgw 1.7.1
File Size Uploaded Provenance Actions
cpgw-1.7.1.tar.gz 6.2 kB Without provenance Details for cpgw-1.7.1.tar.gz

Release files / cpgw-1.7.1.tar.gz

Download URL cpgw-1.7.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7719cb899a5a11c874a0b00cde21a0a295b1aeffbc74714b46c1d3f62fe4c8d6
BLAKE2b-256 checksum
How to use checksums
1997f6e3d7c7920537f2f9b86816ff7f193b8458fb6e2dd1804528e1c87a7ede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.1

Security for cpgw 1.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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