情况
我自愿参加一个小型组织,我们举办聚会,音乐会等。
我们有一个昂贵的灯光控制台(Avolites Titan Quartz)。我们仅将其用于大型演出和手动控制。控制台连接到LAN2DMX设备(dmXLAN Buddy),该设备将Art-Net协议转换为DMX设备可以理解的信号。
我们需要一种可以从主控制台记录程序,然后不断播放此预设的设备。它应该易于使用,而不必伸手去拿昂贵和复杂的设备。
决断
铁
- 树莓派。任何版本都可以。我用了现有的第二个
- 液晶屏。我使用了16x2的I2C防护罩
- 旋转编码器。可以扭曲和窃听的东西,作为一种输入手段。我买了一个带有所有电阻的现成的电阻。
- 跳线。或只是电线,如果紧密焊接到RPi梳子上
- 小物件:机壳,USB微型电缆,电源按钮
连接
显示:
- GND至引脚6(接地)
- VCC至引脚4(5V电源)
- SDA至引脚3(GPIO 2)
- 引脚5(GPIO 3)上的SLC
微调器:
- CLK至Pin 12(GPIO 18)
- DT至引脚13(GPIO 27)
- SW至引脚11(GPIO 17)
- +至针1(3V3电源)
- GND至引脚14(接地)
电源:
我刚刚断开了微型USB电缆,焊接了按钮。我带出了一个圆形的电源连接器,它更易于使用。
软件
轴
我们采用标准的Raspberry Pi OS(32位)Lite,并使用Etcher将其安装在SD上。
将“ ssh”文件添加到/ boot以启用SSH,因为您不想连接监视器和键盘。
SSH到RPi:
youruser@homepc:~ $ ssh pi@[Pi-IP-address]
我们为所有人更新:
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get dist-upgrade
开放式闪电架构
安装软件包以构建我们设备的心脏-Open Lightning Architecture。pi@raspberrypi:~ $ sudo apt-get install git autoconf libtool bison flex uuid-dev libcppunit-dev python-protobuf python-numpy protobuf-compiler libmicrohttpd-dev libprotoc-dev i2c-tools python3-smbus python3-gpiozero python3-pip3
pi@raspberrypi:~ $ git clone https://github.com/OpenLightingProject/ola.git
pi@raspberrypi:~ $ cd ola
编译并安装。收集包裹实在太懒了,我希望在项目结束之后,再也没有人可以看到里面了。将花费很多时间。在RPi 2和速度较慢的SD卡上,我将其放置了一夜。
pi@raspberrypi:~/ola $ autoreconf -i
pi@raspberrypi:~/ola $ ./configure --enable-rdm-tests
pi@raspberrypi:~/ola $ make
pi@raspberrypi:~/ola $ sudo make install
我们加载或检查性能:
pi@raspberrypi:~/ola $ sudo ldconfig
pi@raspberrypi:~/ola $ olad -l 3
转到http:// // [Pi-IP地址]:9090 / ola.html,然后看一切都打开了。实际上,我们不需要Web服务器,我们可以在配置文件中对其进行萨满,并在不使用它的情况下进行构建。
为systemd创建服务
pi@raspberrypi:~ $ sudo nano /etc/systemd/system/olad.service
[Unit]
Description=OLA daemon
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
ExecStart=olad
[Install]
WantedBy=multi-user.target
并放入启动
pi@raspberrypi:~ $ sudo systemctl start olad
pi@raspberrypi:~ $ sudo systemctl enable olad
I2C
您需要启用I2C与显示器进行交互pi@raspberrypi:~ $ sudo raspi-config
在“接口选项”>“ I2C”>“启用”中,然后重新启动。
我们查看I2C总线上的显示地址,我们需要它
pi@raspberrypi:~/dmx-priest $ sudo i2cdetect -y 1
我的是3楼,需要在RPi_I2C_driver.py中注册。从理论上讲,从程序中读取系统变量会更好,但是我懒得在一切正常后才完成它。
静态IP
有些控制台擅长广播,有些则需要手动注册,因此让我们在一个清晰的地址中创建一个静态IP,所有dmx设备都可以访问该地址。
pi@raspberrypi:~ $ sudo nano /etc/dhcpcd.conf
# Example static IP configuration:
interface eth0
static ip_address=2.150.43.69/24
static routers=2.124.1.1
static domain_name_servers=2.124.1.1
dmx牧师
自行编写的程序,用于显示,扭曲和光晕。Python我不知道,欢迎PR。
拉ola_patch以调入输入(用于从控制台写入)或输出(以单独工作)。使用ola_recorder进行记录和播放。
安装:
pi@raspberrypi:~ $ sudo pip3 install git+https://github.com/Virusmater/dmx-priest
添加到启动:
pi@raspberrypi:~ $ nano /etc/systemd/system/dmx-priest.service
[Unit]
Description=dmx-priest
Requires=olad.service
After=network.target olad.service
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
ExecStart=dmx-priest
[Install]
WantedBy=multi-user.target
pi@raspberrypi:~ $ sudo systemctl start dmx-priest
pi@raspberrypi:~ $ sudo systemctl enable dmx-priest
游子

- 向右扭转20次以找到录制模式。20次,以使用户不会意外写任何东西。显示:“记录模式-按下旋钮”。
- 推送:“准备记录-推送开始”
- 准备要播放的主控制台。我们坚持以正确的方式点亮
- 单击以开始录制:“录制正在进行-按下即可停止”
- 我们等待一段时间,具体取决于主控制台上的程序。
- 单击以停止录制。我们返回到菜单:“播放模式-按下旋钮”
- 点击进入播放菜单。新记录的预设格式为YYYY.mm.dd HH:MM
- 单击预设或单击99_blackout退出并关闭所有灯光
源代码
https://github.com/Virusmater/dmx-priest