Anytime Help Center

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Support
  • Guest
  • Log In
English (US)
US English (US)
DE German
CN Chinese
MX Spanish (Mexico)
Chinese (Simplified)
  • AKG
    Microphones Wireless Integrated Systems Automatic Mixers Headphones Discontinued Products (AKG) General AKG Inquiries Certifications (AKG)
  • AMX
    Networked A/V Distribution (AVoIP) Traditional A/V Distribution Video Signal Processing Architectural Connectivity User Interfaces Control Processing Power (AMX) Programming (AMX) Software (AMX) Discontinued Products (AMX) General AMX Inquiries Certifications (AMX)
  • BSS
    Soundweb™ Omni Soundweb™ London Soundweb™ Contrio™ Software (BSS) Discontinued Products (BSS) General BSS Inquiries Certifications (BSS)
  • Crown
    CDi DriveCore Series CDi Series Commercial Series ComTech Series DCi DriveCore Series I-Tech HD Series XLC series XLi Series XLS DriveCore 2 Series XTi 2 Series Discontinued Products (Crown) Software (Crown) General Crown Inquiries Certifications (Crown)
  • dbx
    CX Series 500 Series DriveRack Personal Monitor Control ZonePRO Zone Controllers FeedBack Suppression Microphone Preamps Dynamics Processors Crossovers Equalizers Software (dbx) Discontinued Products (dbx) General dbx Inquiries Certifications (dbx)
  • Flux::
    Immersive Processing Analysis Subscriptions
  • JBL
    Cinema Sound Installed Live Portable Tour Sound Recording & Broadcast Software (JBL) Discontinued Products (JBL) Video Manual Series (JBL) General JBL Inquiries Certifications (JBL)
  • Lexicon
    Plugins Effects Processors Cinema Discontinued Products (Lexicon) Video Manual Series (Lexicon) General Lexicon Inquiries Certifications (Lexicon)
  • Martin
    Atomic ELP ERA Exterior MAC P3 VC VDO Tools Discontinued Products (Martin) General Martin Inquiries Certifications (Martin)
  • Soundcraft
    Digital Analog Connected Analog Only Discontinued Products (Soundcraft) Video Manual Series (Soundcraft) General Soundcraft Inquiries Certifications (Soundcraft)
  • General HARMAN Inquiries
    Dante
+ More
  • Home
  • AMX
  • Control Processing
  • Central Controllers
  • MU-Series Controller

Controlling MUSE Serial Ports with Python Code

Written by Will Fraser

Updated at January 5th, 2026

Table of Contents

Question:   Answer:

Question:  

How do I control the MUSE Serial Ports with Python Code?


Answer:

​The below Python code controls a serial port on a MUSE controller.  It contains code for configuring ports, sending and receiving strings, and reporting port errors.


from mojo import context

context.log.info('Sample Python program')


#Create objects for the controller (idevice) and touch panel (AMX-11241)
dvidevice = context.devices.get("idevice")
dvTP = context.devices.get("AMX-11241")


#Create a variable to access just the serial port
serialPort1 = dvidevice.serial[0]


#This creates a buffer for incoming serial strings, if a string is longer than 64 characters
#it will trigger multiple events, this allows building the string until a delimiter is reached
serialBuffer = ""


#As long as the idevice is online it will set the baud rate of the serial port
if(dvidevice.isOnline()):
    context.log.info("idevice online, setting baud rate.")
    serialPort1.setCommParams("9600",8,1,"NONE","232")


#This function processes incoming strings utilizing the serialBuffer variable declared above
#Once a carriage return is seen in the string it prints what has been received
def receiveString(event):
    global serialBuffer

    serialBuffer += event.arguments['data'].decode()
    
    if (serialBuffer.find("\r") >= 0):
        print(f"Full string: {serialBuffer}")
        serialBuffer = ""

serialPort1.receive.listen(receiveString)


#An example of sending an ASCII string from the serial port
def sendASCII(event):
    serialPort1.send("ASCII string\r".encode())
    
dvTP.port[1].button[1].watch(sendASCII)


#An example of sending a hexadecimal string from the serial port
def sendHEX(event):
    serialPort1.send("\x02 \x68 \x65 \x6c \x6c \x6f \x03 \x0d".encode())
    
dvTP.port[1].button[2].watch(sendHEX)


#An example of sending a mixed hex/ASCII string from the serial port
def sendMIX(event):
    serialPort1.send("\x02 Mixed string \x03 \r".encode())
    
dvTP.port[1].button[3].watch(sendMIX)


#This function is triggered by a fault detection in the serial port, it will print out the error 
def receiveFault(event):
    context.log.info(f"Serial port fault: {event.arguments['value']}".encode())

serialPort1.fault.listen(receiveFault)


# leave this as the last line in the Python script
context.run(globals())


Related Videos

q&a guide

Was this article helpful?

Yes
No
Give feedback about this article

Table of Contents

Question:   Answer:

Related Articles

  • Duet Module Upload Error Message in Muse

Related Articles

  • Duet Module Upload Error Message in Muse
Copyright © HARMAN Professional. All rights reserved. Privacy Policy | Terms of Use
Expand