Skip to main content

Easy-to-use library to work with an OpenDMX controller

Project description

OpenDMXAdapter

OpenDMXAdapter is an easy-to-use library to work with an OpenDMX controller. Initially this library has been designed around the OpenDMX Adapter from Enttec.

Installing

This project has not been published on pypi yet and thus can only be used by cloning the git repository into your project.
You may need to install a different driver for your adapter (since the Enttec OpenDMX driver only works with their dll file and not with serial). Take a look at this tutorial from adafruit on how to install the correct driver (libusk).

Example Usage

from opendmxadapter.adapter import OpenDMXAdapter
from opendmxadapter.fixtures.cameo.rootpar6 import RootPar6

controller = OpenDMXAdapter("ftdi://ftdi:232:BG00DND8/1")
controller.start()
controller.blackout()

# Either manually set channel values
controller.set_channel(10, 255)

# Or add a custom fixture
light = RootPar6(0)
controller.add_fixture(light)

light.set_amber(255)
light.set_intensity(100)

controller.close()

For more examples, take look into the examples directory.

How does it work?

The main logic lies in adapter.py which is fairly simple and easy to understand. It talks via pyftdi serialtext to the controller itself and sends the data in a separate thread in a 40 Hz interval.

Writing a custom fixture

Generally, taking a look at the different fixtures available such as the cameo root par 6 is a good idea to get a basic understanding of how they work.
Most of the methods are defined in the BaseFixture class. Your fixture class should extend from this.
If you need any further abstraction of functionality, such as color, moving head or strobo, you can additionally extend from either ColorFixture, StroboFixture or the different classes available in basefixture.py. You may need to call special initialisation methods prefixed with an underscore to set the relative channels for different operations. See the example below.

from fixtures.basefixture import BaseFixture, ColorFixture


class CustomFixture(BaseFixture, ColorFixture):
    def __init__(self, channelCount: int, rawChannel: int | None = None):
        super().__init__(channelCount, rawChannel)
        # R, G, B, Intensity
        self._initializeColorChannels(0, 1, 2, 3)

    def mySuperCustomMethod(self):
        # Method provided by BaseFixture
        self.setValue(10, 255)
        self.adapter.blackout()  # You can also access the adapter
        
        # Method provided by ColorFixture
        self.setRgb(255, 0, 0)
        self.setIntensity(100)

Showcase

This is a video I took controlling the Eurolite TMH-X4 Shower Moving Head with my Dualshock Controller

Showcase

Help

If you're stuck in any way, have any questions or problem with the driver, feel free to ask me. I went through a lot of work to get a driver running after abandoning the driver from the Enttec Adapter. Open an issue or drop me a Twitter DM.

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

opendmxadapter-1.0.2.post1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendmxadapter-1.0.2.post1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file opendmxadapter-1.0.2.post1.tar.gz.

File metadata

  • Download URL: opendmxadapter-1.0.2.post1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for opendmxadapter-1.0.2.post1.tar.gz
Algorithm Hash digest
SHA256 0d32c140d46488bd1473f71f7d16b3dabaab0c435e1c23ea05ca8435d4882d92
MD5 eec1808bb2bbb23ba7a9ada1d4101a9f
BLAKE2b-256 28394bddeabb5730890c533f12a7ef25a5f114a12d0592350adb9e68484e5851

See more details on using hashes here.

File details

Details for the file opendmxadapter-1.0.2.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for opendmxadapter-1.0.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 467bc74d294b7f0edaf64b2102db72fa2d8b2f6d149ba338339fdf54d7fcab4a
MD5 f0d987df072430404ce8eedac42eb72e
BLAKE2b-256 6a15683be2c9a71a4336c2a6bef0407a70c4774f22d8eb06b5724301f286ce87

See more details on using hashes here.

Supported by

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