Connects a serial output device to ArtNET. This script is used to trigger grandMA onPC2 macros from a RF remote.
During the start script is catching the USB serial port by PID and VID. RF receiver outputs the bytes as hex strings to the serial port when remote is sending the packets and triggers the ArtNet channel (put max on one channel per packet). onPC2 is configured to remote control using DMX on a spare universe and triggers a macros.
debug.py shows serial output. Use it to catch the packets and assign them to ArtNet channels in config. It shows the output of the reciever as bytes converted to hex strings. This hex string shoud be mapped to channel num in dev_remote.ini.
01 = ab2e6b864ad5
means that packet ab2e6b864ad5
will flash ArtNet channel 1
.
daemon.py recieve packets in a loop, triggers ArtNet channels according to mapped packets in dev_remote.ini [ACTIONS]
section.
pip install stupidartnet
pip install pyserial
In some cases and networks you'll need to create a virtual network interface with ArtNet ip ranges (2.x.x.x or 10.x.x.x), to make it work. If your current network setup is 192.168.x.x probably you should to this.
Also, when onPC is launching it grabs the serial port to use it for GPS, and this script will not connect to it. To disable serial port reservation you'll need to disable this in windows registry:
HKEY_CURRENT_USER\SOFTWARE\MA Lighting Technologies\grandMA2 onPC\Settings
CheckComport
shoud be set to 0
pnPC2 should be accept ArtNet input, and input should be enabled.
Setup > Network Protocols > Art-Net tab
Universe param should be set to 1
Setup > Remote input setup > DMX remotes tab
Channels from Universe 2
is mapped to macros. When the remote button is pressed, channel put on max, and action triggers.
You can use free ArtNetView to check if triggering is working on a system level and use DXM sheet inside onPC to check if onPC see the triggers.
How to install it as a service on Windows (more on this):
-
Download nssm.exe
-
Open a Win prompt as admin
-
nssm.exe install ProjectService
-
A popup will be shown.
-
Path to the python file should look like this
c:\path\to\python.exe" "c:\path\to\project\serial_to_artnet\daemon.py"
nssm.exe start ProjectService
nssm.exe stop ProjectService
nssm.exe remove ProjectService confirm