04.02.2020, 12:56
(03.02.2020, 12:51)admin Wrote: An example of Art-Net receiver. It ignores sequence and universe numbers which are not needed for general use. Edit mapping table to select which groups addresses are mapped to DMX channel numbers starting from 1. Output value for each channel is 1 byte (0..255).Thanks for the info, I’ve tried testing it with a couple of software controller, as I’m not on site, but the wiser only shows a connection to the controller (eg when I log server it shows art-net) but the data is alway nil.
Code:if not server then
mapping = {
[1] = '32/1/1',
[2] = '32/1/2',
[3] = '32/1/3',
}
server = require('socket').udp()
server:settimeout(1)
server:setsockname('*', 0x1936)
header = 'Art-Net' .. string.char(0, 0, 0x50)
values = {}
function parse(data)
local count, value
if data:sub(1, #header) ~= header then
return
end
count = #data - 18
for i = 1, count do
value = data:byte(i + 18)
if value ~= values[ i ] then
values[ i ] = value
if mapping[ i ] then
grp.update(mapping[ i ], value)
end
end
end
end
end
data = server:receive()
if data then
parse(data)
end
can I put the art-net transmit on the wiser and test that way?