API for MCCI Type C Super MUTT Model 3501.
Project description
model3501lib
MCCI Model 3501 SuperMUTT Python based library for control and operation
Install Python3.7 (32-bit) package
install python package from python.org
Install Python3.7 (64-bit) package
install python package from python.org
Install pip package
pip --version
python -m pip install --upgrade pip
Prerequisites for running or building
On Windows:
Development environment
- OS - Windows 10 and 11 64 bit
- Python - 3.7.8
- pyusb - 1.2.1
pip install pyusb
Installing model3501lib Packages
-
Clone the repository from github
-
Open a
cmd terminal
and change directory to{path_to_repository}/model3501lib
. usingcd
into the root directory where setup.py is located -
To install the library in your local Python setup, enter the command in Windows OS
python setup.py sdist bdist_wheel
python install .
Please navigate to dist/ directory and you will find the files .egg file.
Example: model3501api-1.0.0-py3.7.egg
package usage
Create a Python file named Simpletest.py
and open in text editor and import the model3501lib
modules.
from model3501lib import DeviceController, set_speed
from model3501lib import getrdoController, get_rdo_status
from model3501lib import getpowerRoleController, get_power_role_status
from model3501lib import ChargeController, set_charge
from model3501lib import CDstressONController, onset_cdstress
from model3501lib import CDstressOFFController, offset_cdstress
from model3501lib import PDCaptiveCablesController
from model3501lib import PDChargerPortController, pd_charger_port_status
from model3501lib import FindDeviceController, find_device_status
from model3501lib import ReconnectController, reconnect_status
#import the time for using delay between each commnds
import time
Sending a cmd for find device details
find_device_status()
Sending a cmd for Set Speed
#Set to speed: s is super speed , h is high speed, l is low speed
set_speed('s')
set_speed('h')
set_speed('l')
Sending a cmd for Emulate Charge
#Emulate a PD charger with max watts 'W'.
#15W (5V 3.0A)
#27W (9V 3.0A)
#45W (15V 3.0A)
#set_charge(w)
set_charge(15)
Sending a cmd for CDStressOn
#Enable connect disconnect stress
onset_cdstress()
Sending a cmd for CDStressOff
# Disable connect disconnect stress
offset_cdstress()
Sending a cmd for Reconnect X Y
# Disconnect and reconnect the Type-C MUTT one time with
#optional wait times (in ms), X before disconnect,and Y beforereconnect.
# Test reconnect functionality with specified delays
delay_disconnect_ms = 5000 # 1 second
delay_reconnect_ms = 10000 # 1 second
reconnect_status(delay_disconnect_ms, delay_reconnect_ms)
Sending a cmd for PdChargerPort
# Switch PD to charger receptacle
pd_charger_port_status()
Sending a cmd for PdCaptiveCable
# Switch PD to captive cable
pd_captive_cables_status()
Sending a cmd for GetRdo
# Read the RDO for the current power contract
get_rdo_status()
Sending a cmd for GetPowerRole
# Read the current power role
get_power_role_status()
Installing package via pip cmd
pip install model3501api
Development
- It is a fully independent package. All necessary things are installed during the normal installation process.
- currently works and tested only for Windows.
Demo
Release History
- Initial release
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 model3501api-1.0.6.tar.gz
.
File metadata
- Download URL: model3501api-1.0.6.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d709407701be5e740b42ec9184efbf9133b8bb998d1943cdf72bec618406670f |
|
MD5 | f68d00ac97f9ed6368ceb7682b1a04ae |
|
BLAKE2b-256 | c576655cadb04a4c3977e1d3919da104903274ba7652c445684996834fe351e6 |
File details
Details for the file model3501api-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: model3501api-1.0.6-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 479dbff1a6c6c405f9a8b433b6d1ffb050dd02a16d9e3ce450d36918820b03e4 |
|
MD5 | 122e075388a1db6101f74e090f8e4e9b |
|
BLAKE2b-256 | 303107126769c210880f3656ede67c556b52801ebaa94d4ea153854ceacddae3 |