Skip to main content

take control of a SkyRC charger via USB

Project description

py skyrc charger

this package allows to interface with skyrc chargers using the usb-connection as a more flexible replacement for the Charge Master software. This library was created by reverse engineering the protocol and does not support the complete set of functions yet.

supported devices

this code was developed and tested using the SkyRC T1000: https://www.skyrc.com/t1000 however chargers working with the original Charge Master software are likely to work as well. A list of supported devices is on the download page of Charge Master: https://www.skyrc.com/downloads

tested on linux only, windows should also work, but it is more difficult to setup the usb driver

setup (linux)

fix usb permissions

this might be necessary to run the code without sudo.

create a file /lib/udev/rules.d/50-skyrc-t1000.rules with the following content:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0000", ATTRS{idProduct}=="0001", MODE="660", GROUP="plugdev"

run:

sudo adduser $USER plugdev

how to use

import time
from py_skyrc_charger import Charger, Config, Action, ChargerResponse


def rec_data_callback_sample(data: ChargerResponse):
    print("---")
    print(f"got cmd: {data.command}")
    if data.is_error:
        print(f"error: {data.error_str}")
    else:
        print(f"got data: {data.data}")


if __name__ == "__main__":
    charger = Charger(rec_data_callback_sample, device_index=0)
    charger.connect()

    time.sleep(1.0)

    print("read version...")
    charger.poll_version()
    time.sleep(0.2)

    print("read settings...")
    charger.poll_settings()
    time.sleep(0.2)

    # configure charge program
    conf = Config(port=1,
                  action=Action.BALANCE,
                  cells=3,
                  cur_in=0.1,
                  cur_out=0.5)

    # read values in idle
    start_time = time.time()
    while time.time() - start_time < 5:
        charger.poll_all_vals()
        time.sleep(1.0)

    print("START")
    charger.start_program(conf)

    # read values while charging
    start_time = time.time()
    while time.time() - start_time < 10:
        charger.poll_all_vals()
        time.sleep(1.0)

    print("STOP")
    charger.stop_program(conf.port)

    # read values in idle
    start_time = time.time()
    while time.time() - start_time < 10:
        charger.poll_all_vals()
        time.sleep(1.0)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_skyrc_charger-0.0.12.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_skyrc_charger-0.0.12-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file py_skyrc_charger-0.0.12.tar.gz.

File metadata

  • Download URL: py_skyrc_charger-0.0.12.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for py_skyrc_charger-0.0.12.tar.gz
Algorithm Hash digest
SHA256 2aafccf4872038193def6e11d2bfcadd773ccfd664b860a6407f639b8359b52c
MD5 17ab8036a3f157c4bbbbea5478a122c7
BLAKE2b-256 aec511cbc1253074fb873b44f44ecfcb07312b024a961acd1eb9790633df39c7

See more details on using hashes here.

File details

Details for the file py_skyrc_charger-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for py_skyrc_charger-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 890edc2c6335238e7073ef1497b7b139436188a71b37688d978b58bc07af1b2c
MD5 8d05d97eb0a123fecfc426b534d05924
BLAKE2b-256 126874cbe7436fff9db28158f7a56ef7fe81583b10512e84843cc6f6bac5f0fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page