Skip to main content

Rotel RSP-1570 processor asyncio RS-232 protocol

Project description

rsp1570serial

An asyncio based package to talk to a Rotel RSP-1570 processor using the RS-232 protocol

See this document for the protocol definition

Known to work with a GANA USB to RS-232 DB9 cable on Windows 10 (Python 3.7.0) and on Rapbian Stretch (Python 3.5.3)

The protocol is similar to that used by other older Rotel kit. For example, it looks as though the RSP-1572 used a protocol like this. It has a different device id and supports a few more messages but this package could probably be updated to support it.

Usage

The RotelAmpConn object encapsulates all of the functionality of the library:

    try:
        conn = RotelAmpConn(serial_port)
        await conn.open()
    except:
        logging.error("Could not open connection", exc_info=True)
    else:
        # Do something here
        conn.close()

The serial_port parameter can be anything that can be passed to serial.serial_for_url(). E.g.

  • /dev/ttyUSB0 (Linux)
  • COM3 (Windows)
  • socket://192.168.0.100:50000 (if you are using a TCP/IP to serial converter)

Send a command (see commands.py for the full list):

    await conn.send_command('MUTE_TOGGLE')

Send a volume direct command to a zone:

    zone = 1
    volume = 50
    await conn.send_volume_direct_command(zone, volume)

Read the input stream from the device:

    async for message in conn.read_messages():
        if (isinstance(message, (FeedbackMessage, TriggerMessage))):
            message.log()
        else:
            logging.warning("Unknown message type encountered")

Please see example1.py and example2.py for fully working examples.

This library was built to support a rotel_rsp1570 media player platform entity for Home Assistant that I will also make available shortly.

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

rsp1570serial-pp81381-0.0.6.dev2.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

Supported by

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