MIDI-MT Documentation in English
To implement the integration of ArtNet,
MQTT and DMX512 network technologies
into a single lighting control system, you can use not only equipment
from well-known manufacturers. It is much cheaper to use
Arduino
-like boards for these purposes that support
WiFi
technology, designed on ESP
chipsets, for
example ESP8266
, ESP32
, etc.
At the same time, it turns out to get a device with maximum
capabilities at a minimum price. The budget of such a device will cost
about the cost of one track lamp, in other words, its cost will be
approximately 10-15%
of the price of similar branded
equipment.
One of these designs, which serves to expand the coverage of a network of smart devices, runs under the control of the MIDI-MT program, for which it was specially developed. Simplicity of execution and the wide availability of electronic components make it universal.
The circuitry of the “Repeater” and “End Point” is very simple; the
test specimen uses a ready-made microcontroller board developed by LOLIN
(Wemos) on the ESP8266
chipset and a ready-made
TTL
level converter board to the RS485
interface. There are no restrictions, you can use any available
analogues.
“Repeater” device
Endpoint device
DE
(data enable) to the pin on the microcontroller
(Wemos - pin D2)RE
(receive enable) to the pin on the
microcontroller (Wemos - pin D2)DI
(data in) connect to D4/TX1 on the
microcontroller (Wemos - pin D4)VCC
connect to 5V power supplyA
DMX signal output, to the lighting control bus
(XLR connector pin 3, Ethernet connector pin 1)B
DMX signal output, to the lighting control bus
(XLR connector pin 2, Ethernet connector pin 2)GND
ground, DMX output, to lighting control bus
(XLR connector pin 1, Ethernet connector pin 7,8)The “Repeater” and “Endpoint” devices use HTTP
server to
receive the DMX512 network configuration in
Json
format. The json
name of the
configuration file is composed according to the following scheme:
the names art-dmx-XXX-XXX
refer to the “Repeater”
device.
the names art-ep-XXX-XXX
refer to the “Endpoint”
device.
general part of the name: art-dmx
or
art-ep
hostname: art-dmx-1-2
or
art-ep-1-2
fully qualified domain name: art-dmx-1-2.local
or
art-ep-1-2.local
, where numbers 1 and 2 are part of the IP
address issued to the device: 192.168.1.2
configuration file name: art-dmx-1-2.json
or
art-ep-1-2.json
Json
file of device settings “Repeater” or “Endpoint”sub - full name of the MQTT topic. dmx - channel number in the DMX512 network.
{"mqtt":[
{"sub":"sensor/ctrl9/av9/slider","dmx":9},
{"sub":"sensor/ctrl9/b21/onoff","dmx":10},
{"sub":"sensor/ctrl9/b22/onoff","dmx":11},
{"sub":"sensor/ctrl9/b23/onoff","dmx":12}
]}
One option for placing configurations is to use the built-in web
server in the MQTT daemon mosquitto
. To do this, you need
to enable the use of web sockets and specify the path to the directory
with json
configuration.
per_listener_settings true
listener 1883
protocol mqtt
socket_domain ipv4
user mosquitto
allow_anonymous false
retain_available true
use_username_as_clientid true
allow_zero_length_clientid true
auto_id_prefix auto-
queue_qos0_messages false
sys_interval 90
autosave_interval 1800
autosave_on_changes true
persistence true
persistent_client_expiration 1m
persistence_location /var/lib/mosquitto/
password_file /etc/mosquitto/pass.cfg
acl_file /etc/mosquitto/mosquitto.acl
pid_file /run/mosquitto/mosquitto.pid
log_dest syslog
log_type warning
listener 9001
protocol websockets
# путь до каталога с `json` конфигурацией
http_dir /srv/git/linuxconfig/mqttweb
topic read $SYS/#
pattern readwrite sensor/%u/#
pattern write $SYS/broker/connection/%c/state
# !!! ADD !!!
# name (login) gateway (art-dmx-XXX-XXX) or end point (art-ep-XXX-XXX)
# read only access!
user art-dmx-0-11
topic read #
user art-ep-0-12
topic read #
# your administrator rights to access topics.
user admin
topic readwrite #
The main settings are in the config.h.default
file. You
need to edit it and rename it to config.h
.
Options:
USING_HTTP_AS_GW
- determines the location of the
MQTT and HTTP server as the IP address of the WiFi gate
(router).
USING_HTTP_AS_HOST
- the IP address of the MQTT and
HTTP server is indicated, numbers are entered separated by commas,
without spaces.
USING_HTTP_PORT
- defines the HTTP server
port.
USING_MQTT_SUBSCRIBE
- MQTT topic for subscription
and listening.
USING_MQTT_PASSWORD
- password for the MQTT server,
the login is the host name, which is generated automatically.
USING_MQTT_STATE
- MQTT topic for indicating the
device state.
USING_MQTT_PORT
- MQTT server port.
USING_MQTT_ID
- use an extended MQTT identifier,
used to work with several devices from one account, not
recommended.
DEBUG
- building code in debug mode, with output to
USB Serial
. Should not be used on a working instance, as it
creates an additional load on the microcontroller memory.
SEND_DMX_CODE_T1
- options for forming DMX packet
headers; it is not recommended to change.
PIN_ERROR
- contact for connecting a status
indicator (Wemos - pin D1 LED).
USING_ARTNET_FILTER
- allow only DMX channels specified
in the configuration to pass through from the ArtNet network.PIN_RS485_UP
- contact for activating the RS485
interface (Wemos - pin D2).PIN_RS485_TX
- TX pin of the RS485 interface (Wemos -
pin D4)USING_MODE_ONOF
- defines the load control algorithm:
relays or PWM modules. When using a relay, the value should be
1
. When used as a dimmer, the value should be
0
.PINS_OUT
- list of contacts to which the load is
connected: relays or PWM modules (Wemos - pins: D2, D5, D6, D7).The “Repeater” device’s tasks include collecting control information about the switching status of lighting fixtures from the ArtNet and MQTT networks, then the information is summarized and transmitted via the DMX protocol to the wired network, through which actual lighting control occurs. Use requires the presence of a wired DMX512 network and a connection point to it.
The Endpoint device processes data received from the ArtNet and MQTT networks. This data is used to physically control relay blocks or dimmers connected to the device.
Management can be carried out using the ArtNet and MQTT protocols. The standard operating mode is the simultaneous use of the ArtNet and MQTT protocols to generate an outgoing DMX stream or control end devices.
MQTT control commands take precedence over ArtNet commands. If the source was enabled using MQTT control, it can only be disabled by it. This applies to any adjustments, both on and off, and to adjusting the brightness or changing the color. On the contrary, if the lighting fixture was turned on by commands from the ArtNet source, further control can be taken over by control signals via the MQTT protocol.
Schemes and firmware can be downloaded here.