pySimpleDMX icon indicating copy to clipboard operation
pySimpleDMX copied to clipboard

Can't render

Open pepourquier opened this issue 8 years ago • 9 comments

Hi,

I have some problem to connect a Contest light connected with Enttec OpenDMX USB.

So it works fine with QLC plus but I can't change colors with pySimpleDMX. It recognizes OpenDMX in /dev/ttyUSB0. Did I miss a value to change ?

In [1]: import pysimpledmx
In [2]: mydmx = pysimpledmx.DMXConnection("/dev/ttyUSB0")
Opened /dev/ttyUSB1.
In [3]: mydmx.setChannel(2, "100", autorender=True)
In [4]: mydmx.setChannel(1, "100", autorender=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-a1d167a61129> in <module>()
----> 1 mydmx.setChannel(1, "100", autorender=True)
/usr/local/lib/python2.7/dist-packages/pysimpledmx/pysimpledmx.pyc in setChannel(self, chan, val, autorender)
     45     '''
     46     if not 1 <= chan-1 <= DMX_SIZE:
---> 47       print 'Invalid channel specified: %s' % chan-1
     48       return
     49     # clamp value
TypeError: unsupported operand type(s) for -: 'str' and 'int'

Thank you for your help.

pepourquier avatar Feb 13 '17 16:02 pepourquier

I've found that with the Enttec DMX USB PRO it is channel number +1. So your line mydmx.setChannel(1, "100", autorender=True) is going to cause issues. Try adding one to each channel.

willcook4 avatar Feb 14 '17 13:02 willcook4

Well thank you for your answer.

As a matter of fact, neither this line works : mydmx.setChannel(2, "100", autorender=True) Like the spot light is not called by the dmx request.

pepourquier avatar Feb 14 '17 15:02 pepourquier

Hi,

I'm still looking for a solution. is the START_VAL value could be the problem ?

Thanks for your help

pepourquier avatar Feb 22 '17 13:02 pepourquier

When i run the following it works fine for me. Try taking the autorender off as it is advised against in the readme. Try only sending the packet to one channel, maybe 2 to see if that works.

It looks like your dmx values are strings, take the "" off too.


import pysimpledmx
mydmx = pysimpledmx.DMXConnection("/dev/ttyUSB0")

mydmx.setChannel(2, 255) # set DMX channel 2 to 128
mydmx.setChannel(3, 0)   # set DMX channel 3 to 0
mydmx.render()  # render  

Let me know if that code above works

willcook4 avatar Feb 22 '17 13:02 willcook4

Hi,

thank you for your answer. No, it doesn't work.

The only return I have is : Opened /dev/ttyUSB1.

Well, with this same code, I tried to add print steps to see what doesn't work :

So, in init function, I printed dmx_frame and com variable self.dmx_frame = [0] * DMX_SIZE
print(self.dmx_frame)
try:
self.com = serial.Serial(comport, baudrate = COM_BAUD, timeout = COM_TIMEOUT)
except:
com_name = 'COM%s' % (comport + 1) if type(comport) == int else comport
print "Could not open device %s. Quitting application." % com_name
sys.exit(0)
print(self.com)
print "Opened %s." % (self.com.portstr)

Here the result : [0, 0, 0, ... 0, 0, 0] Serial<id=0x7f482d2e5890, open=True>(port='/dev/ttyUSB1', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False) Opened /dev/ttyUSB1.

In render function, I printed packet variable before to write it in self.com ['~', '\x06', '\x00', '\x02', '\x00', '\xff', '\x00', ... '\x00', '\xe7']

pepourquier avatar Feb 22 '17 14:02 pepourquier

I know that when using the Enttec Open DMX signal timing is reliant on the host computer. It might be the case that QLC+ is handling the timing and pySimpleDMX is not. I don't have an Open DMX box but I do have an Enttec DMX Pro. Unfortunately I don't have any Enttec DMX boxes with me today. I might get a chance tomorrow to get a sample like you did of the output. If I do I'll post the output here for your comparison.

willcook4 avatar Feb 22 '17 22:02 willcook4

I, have you tested the Ettenc DMX box ? If not, what do you think I could to to fix it ? Thank you

pepourquier avatar Mar 06 '17 08:03 pepourquier

To be honest I'm getting the same issue now. I was testing from a debian machine before and that worked. Now from my mac with a fresh install of pySimpleDMX I'm getting the same results your getting. Very odd.

I have ended up going with an npm module called node-dmx, as the project I'm working on has more JavaScript developers than python devs. I'm sorry I can't help anymore. If anyone works out a solution then please do post it.

willcook4 avatar Mar 10 '17 13:03 willcook4

Thank you for your time. So, finally, I have ended up going with ola and ola-python for the wrapper. Just had hard time to configure ola with Enttec OpenDMX USB. Need to activate the good driver which is not opendmx but ftdidmx.

pepourquier avatar Mar 15 '17 15:03 pepourquier