MattIPv4 / MattIPv4/PyDMXControl

Multiple USB to DMX interface support?

未关闭
#56 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
143
派生
23
PR 合并指标
30 天内没有已合并 PR

描述

Hi Matt! I‘m currently trying to use this library for a lighting project. I use USB to DMX interface cables with FT232R chip. I used "zadig" to flash the driver of interface to libusb-win32 and successfully dim the light on PC using Python! Thankyou :)

But I found when I plug two dongles in my PC, it seems that it can only control one of them. Luminaires of the other cable won't work.
Does this library support multiple interface to work simultaneously?

I am not a programmer. If I question something wrong please forgive me. And here's my code:


# Create controller
dmx = Controller()

# Load fixture from JSON
dmx.json.load_config('LabLight.json')

# Define a global fade time
fade_time = 5000

# DMA Value Mapping Percentage
def percent_to_dmx_value(percent):
    return int((255 * percent) / 100)

# clear
dmx.clear_all_effects()

for brightness_percent in range(5, 101, 5):
    dmx_value = percent_to_dmx_value(brightness_percent)
    # Dimming
    for f in dmx.get_fixtures_by_name_include('DownLight_1Y'):       # Y for Yellow light, W for White light
        f.dim(dmx_value, fade_time)
    for f in dmx.get_fixtures_by_name_include('DownLight_1W'):
        f.dim(dmx_value, fade_time)
    for f in dmx.get_fixtures_by_name_include('DownLight_2Y'):
        f.dim(dmx_value, fade_time)
    for f in dmx.get_fixtures_by_name_include('DownLight_2W'):
        f.dim(dmx_value, fade_time)
    # rest of downlights

    time.sleep(3)

# Manual Close
dmx.sleep_till_enter()
dmx.close()

And the json:

    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_1Y",
        "start_channel": 1
    },
    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_1W",
        "start_channel": 2
    },
    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_2Y",
        "start_channel": 3
    },
    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_2W",
        "start_channel": 4
    },
    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_3Y",
        "start_channel": 5
    },
    {
        "type": "Generic.Dimmer",
        "args": [],
        "name": "DownLight_3W",
        "start_channel": 6
    }
]```

There're more but it's just for example.

For instance Downlight1-3 connect dongle_1, and 3_6 connect dongle_2. 

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从示例中所示的入口点 OpenDMXController 开始,跟踪 USB 接口的选择和管理方式。使用两个 FT232R/libusb-win32 加密狗复现该设置;当分配给每个加密狗的 fixtures 可以同时进行控制时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
embedded-iot
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。