MCCI Model 3501 SuperMUTT Python based library for control and operation
install python package from python.org
install python package from python.org
pip --version
python -m pip install --upgrade pip
On Windows:
Development environment
- OS - Windows 10 and 11 64 bit
- Python - 3.7.8
- pyusb - 1.2.1
pip install pyusb
-
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
Create a Python file named Simpletest.py
and open in text editor and import the model3501lib
modules.
#import the time for using delay between each commnds
import time
# To show list of the Model3501 devices.
# import FindDeviceController
from model3501lib import FindDeviceController, find_device_status
# Command
find_device_status()
#Set to speed: s is super speed , h is high speed, l is low speed
# import DeviceController
from model3501lib import DeviceController, set_speed
# Command
set_speed('s')
set_speed('h')
set_speed('l')
#Emulate a PD charger with max watts 'W'.
#15W (5V 3.0A)
#27W (9V 3.0A)
#45W (15V 3.0A)
#set_charge(w)
# import ChargeController
from model3501lib import ChargeController, set_charge
# Command
set_charge(15) #15 is Example
#Enable connect disconnect stress
# import CDstressONController
from model3501lib import CDstressONController, onset_cdstress
# Command
onset_cdstress()
# Disable connect disconnect stress
# import CDstressOFFController
from model3501lib import CDstressOFFController, offset_cdstress
# Command
offset_cdstress()
# 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
# import ReconnectController
from model3501lib import ReconnectController, reconnect_status
# Command
delay_disconnect_ms = 5000 # 1 second
delay_reconnect_ms = 10000 # 1 second
reconnect_status(delay_disconnect_ms, delay_reconnect_ms)
# Switch PD to charger receptacle.
# import PDChargerPortController
from model3501lib import PDChargerPortController, pd_charger_port_status
# Command
pd_charger_port_status()
# Switch PD to captive cable
# import PDCaptiveCablesController
from model3501lib import PDCaptiveCablesController
# Command
pd_captive_cables_status()
# Read the RDO for the current power contract.
# import getrdoController
from model3501lib import getrdoController, get_rdo_status
# Command
get_rdo_status()
# Read the current power role.
# import getpowerRoleController
from model3501lib import getpowerRoleController, get_power_role_status
# Command
get_power_role_status()
pip install model3501api
- It is a fully independent package. All necessary things are installed during the normal installation process.
- currently works and tested only for Windows.
- Initial release