Skip to content

MCCI Model 3501 SuperMUTT Python based library for control and operation

License

Notifications You must be signed in to change notification settings

mcci-usb/model3501lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Clone the repository from github

  2. Open a cmd terminal and change directory to {path_to_repository}/model3501lib. using cd into the root directory where setup.py is located

  3. 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.

#import the time for using delay between each commnds
import time

Sending a cmd for find device details

# To show list of the Model3501 devices.
# import FindDeviceController
from model3501lib import FindDeviceController, find_device_status

# Command
find_device_status()

Sending a cmd for Set Speed

#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')

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)

 # import ChargeController
 from model3501lib import ChargeController, set_charge

 # Command
 set_charge(15) #15 is Example

Sending a cmd for CDStressOn

#Enable connect disconnect stress
# import CDstressONController
from model3501lib import CDstressONController, onset_cdstress

# Command
onset_cdstress()

Sending a cmd for CDStressOff

# Disable connect disconnect stress

# import CDstressOFFController
from model3501lib import CDstressOFFController, offset_cdstress

# Command
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

# 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)

Sending a cmd for PdChargerPort

# Switch PD to charger receptacle.

# import PDChargerPortController
from model3501lib import PDChargerPortController, pd_charger_port_status

# Command
pd_charger_port_status()

Sending a cmd for PdCaptiveCable

#  Switch PD to captive cable

# import PDCaptiveCablesController
from model3501lib import PDCaptiveCablesController

# Command
pd_captive_cables_status()

Sending a cmd for GetRdo

#  Read the RDO for the current power contract.

# import getrdoController
from model3501lib import getrdoController, get_rdo_status

# Command
get_rdo_status()

Sending a cmd for GetPowerRole

#  Read the current power role.

# import getpowerRoleController
from model3501lib import getpowerRoleController, get_power_role_status

# Command
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

Demo Video

Release History

  • Initial release

About

MCCI Model 3501 SuperMUTT Python based library for control and operation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages