Python Forum
Python and DMX (aka, light controller)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python and DMX (aka, light controller)
#1
Howdy, Everyone.

Formally, I'm a retired programmer. Informally, I still like to play so starting last summer began teaching myself Python.

Where I am stuck is using the PyDMXControl library.. I've written the code to import libraries and Python finds the light controller on Comm3 with Port ID 24577. I’m stumped as to which commands in library OpenDMXController needed to command the light controller and turn lights on/off. I’m not finding enough information on OpenDMXController’s context menu's attributes.

import win32com.client   
import serial        
from serial.tools import list_ports
from PyDMXControl.controllers import OpenDMXController

dmx = OpenDMXController

dmx.?????
is where I am stuck. It lists many context options but stuck trying to find what each does and the syntax.

Ideas,
Thanks,
Scott F
Gribouillis write Mar-17-2023, 09:13 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
There is what looks to be a pretty comprehensive pagkage for this on PyPi here, haven't used it, but I expect that it supports at least one of the boards that you mention.

Since you are new at python, you may or may not know that there's a huge library of open source python libraries available for download here https://www.pypi.org.

Each package normally has a GitHb page associated with it that can be accessed by clicking on the Homepage button, and usually, installation instructions, examples etc. can be found.
Reply
#3
(Mar-16-2023, 10:48 PM)Larz60+ Wrote: There is what looks to be a pretty comprehensive pagkage for this on PyPi here, haven't used it, but I expect that it supports at least one of the boards that you mention.

Since you are new at python, you may or may not know that there's a huge library of open source python libraries available for download here https://www.pypi.org.

Each package normally has a GitHb page associated with it that can be accessed by clicking on the Homepage button, and usually, installation instructions, examples etc. can be found.

Thanks,
I've been on that page looking for info. Looking again after clicking your link, there is some information I overlooked. It may be what I am trying to find.
Followup: To clarify. I am looking for the how-to for OpenDmxController (assigned to dmx above). Such as, what does dmx.fget (fget is an option in the context menu) do and what is the syntax? Given the syntax, the above code should perform one action on the light controller.
Reply
#4
Looks like everything I need, and a lot more, is at https://pypi.org/project/PyDMXControl/

Git clone https://github.com/MattIPv4/PyDMXControl/
Larz60+ likes this post
Reply
#5
Solution Found:

My DMX light controller is a Light-O-Rama.

The sample code at https://github.com/MattIPv4/PyDMXControl/ does work, and it's the only good Python DMX code sample on the internet that I found. However, when I executed it, Python burped with error NotImplementedError: Operation not supported or unimplemented on this platform. Python could see my controller but could not talk to it. The issue was an old WinUSB driver. The fix I used is downloaded Zadig, selected the USB DMX device from Options – List All Devices, and updated the WinUSB driver.

https://github.com/pbatard/libwdi/wiki/Zadig

Once updated, Python and my controller connected.

CAVEAT/WARNING: The updated driver may overwrite a previous driver that came as a part of the DMX controller. On my development computer, it did overwrite so now the OEM software can't connect to the controller. For me, that is ok because my development machine is not the light show machine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Python Script to generate SVG Dot Matrix Pattern for LED Light Guide iamrickm 2 773 Aug-25-2023, 06:07 PM
Last Post: iamrickm
  How can flask find the controller? 3lnyn0 3 1,331 Jul-08-2022, 10:05 AM
Last Post: Larz60+
  Controller Buzzer as Distance Decreases barkster 6 2,100 Nov-01-2021, 03:26 PM
Last Post: barkster
  Auto re-pair / re-sync Controller via Script? User3000 2 2,346 Nov-30-2020, 11:42 AM
Last Post: User3000
  Tuning PID controller Sancho_Pansa 4 4,404 Nov-09-2020, 07:51 AM
Last Post: Sancho_Pansa
  Xbox Controller arki 0 1,726 Jun-30-2020, 10:32 AM
Last Post: arki
  Please help! Akai APC20 midi controller script versusliveact 0 2,144 Feb-14-2020, 05:37 AM
Last Post: versusliveact
  managing command codes for external controller box Oolongtea 0 1,920 Sep-19-2019, 08:32 AM
Last Post: Oolongtea
  Python with LED light strip question. Ostromaj 5 4,038 Aug-07-2018, 09:06 PM
Last Post: Ostromaj
  beginner programming LED light rbowler 2 41,637 Jun-16-2018, 08:29 PM
Last Post: rbowler

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020