1

I am starting a project in java where I want to control a Lights from my computer using a Terminal Window. I am using a piece of hardware called an Enttec Open DMX USB Converter. So I am writing this question, to ask the community if anyone has an idea of how to send data to this Enttec device to control lights. Where would I start? I already know how to write terminal command aliases and execute .jar files so I don't need help with that.

What I have tried so far is to look at an open source project called "Open Lighting Project" that I know can control the device and learn how it works and how can possibly make my program. But I got stuck looking at the java code folder in the Github Repository, trying to find a DmxData.java class that it says OlaClient.java is importing. So I am very confused where it is getting it from.

I have also tried looking at the developer tools on the Enttec Website, and they don't work. More Specifically I looked at the file package called Java Wrapper, and tried running the test and kept failing every time with different errors.

These are the links:

Enttec Device: https://www.enttec.com/product/controls/dmx-usb-interfaces/open-dmx-usb/

Open Lighting Architecture Github Repository: https://github.com/OpenLightingProject/ola

Any help would be appreciated!

Thanks!

Ethan Pervere
  • 23
  • 1
  • 10

2 Answers2

1

I ported a DmxPy to Java a little over a year ago. It worked for my needs with an ENTEC DMX USB Pro. See if this works for you.

Link: https://github.com/trevordavies095/DmxJava

Instantiate: DmxJava dmx = new DmxJava();

Set a DMX address's value: dmx.setChannel(dmx_address, value);

DMX packet to be sent byte[] dmx_packet = dmx.render(); You can now send the packet to the ENTTEC using whatever serial library you are using.

ltd9938
  • 1,444
  • 1
  • 15
  • 29
  • Thanks for answer! Could you explain how you send the actual data to the Enttec Device? Basically, What Serial Library would you recommend? – Ethan Pervere Jan 20 '20 at 22:36
  • 1
    @EthanPervere I used UsbSerial (an Android Library). I'm fairly certain you can use Java's serial library, however, I have not tried it myself. – ltd9938 Jan 21 '20 at 13:04
  • I got data sending to the DMX lights I have but it isn't the right data. So what I need to do is use the DMX512 Protocol here [link](https://tsp.esta.org/tsp/documents/docs/ANSI-ESTA_E1-11_2008R2018.pdf) which ETC pointed me towards. So how did you create real DMX data such as above? – Ethan Pervere Feb 29 '20 at 17:28
0

I use Juanjo's lib (https://sourceforge.net/projects/opendmxjavajni/). DMX512 protocol is pretty simple. Main concepts are:

Universe: you can choose any universe, starting from 0, up to ~65K. A universe is a isolated network of fixtures, and has 512 channels each. Most entry-level DMX/USB interfaces work with only one universe.

Channel: each channel supports an integer value between 0 and 255. Some fixtures use only one channel (for instance, a dimmer), some use more than one (an RGB fixture, using a channel for dimmer, and other 3 for red, green and blue, for instance), and some may get really complex, using a huge ammount of channels (ex.: a moving head). You'll have to understand what are the channels used by the actual fixtures you want to use (channel n: dimmer, channel n+1: red, etc.). Usually you can set the "n" value in the fixture configurations.

To connect your DMX/USB interface, use:

OpenDmx.connect(OpenDmx.OPENDMX_TX)

Usually, you'll want to run an infinite loop, in which you control what goes on each channel. Just update the DMX array (an array of 'ints'), considering that channel 1 will be at position 0, and so on untill position 511. The interface will keep updating your fixtures accordingly.

OpenDmx.setValue(channel,value);

Juanjo's lib has several examples that might be useful.

Good luck.