This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Problems to get DMX to work
#1
Hi,

I can not get the DMX to work on the lm5, I have followed the example "DMX lighting control with LogicMachine", but I have probably done a minor mistake somewhere. 

I have added the scripts I think I need, changed the RS485 port, added dmx in the tag field on the objects and it says there is no error in the log. Have taken screenshots of my setup, so it is easier to spot my mistake

My objects:

[Image: t9e7aa.jpg]

Mark DMX objects script:

[Image: 16bmu54.jpg]

DMX handler script:

[Image: 2qdxz6f.jpg]

The RS485 port change:

[Image: 2hd1yja.jpg]

DMX function for firmware after 7.2016 script:

[Image: x6a5c2.jpg]
Reply
#2
(04.05.2019, 19:18)ole Wrote: Hi,

I can not get the DMX to work on the lm5, I have followed the example "DMX lighting control with LogicMachine", but I have probably done a minor mistake somewhere. 

I have added the scripts I think I need, changed the RS485 port, added dmx in the tag field on the objects and it says there is no error in the log. Have taken screenshots of my setup, so it is easier to spot my mistake

My objects:

[Image: t9e7aa.jpg]

Mark DMX objects script:

[Image: 16bmu54.jpg]

DMX handler script:

[Image: 2qdxz6f.jpg]

The RS485 port change:

[Image: 2hd1yja.jpg]

DMX function for firmware after 7.2016 script:

[Image: x6a5c2.jpg]

is there any errors in "Error log" Tab? maybe something else work on rs485-1? you sure that port is "-1"? check ports name in system config - status - system status - serial ports
Reply
#3
Have you tried swapping A/B? Do you have RS485 GND connected?
Reply
#4
(06.05.2019, 09:23)admin Wrote: Have you tried swapping A/B? Do you have RS485 GND connected?

Yes, I have tried to to change the ports (A/B), but have not connected the GND. Should it be connected?

Tried to use the RS-485 echo test resident script found in the manual for the LM5p-dr.
I tried it from RS485-1 to 3, 1-2, 3-2 and 2-3 with no message in either the log or the error log - is there something special one need to do with the script, I just copied it directly from the manual into a resident script, only changing the name of the port?

Thanks in advance

No, it doesn't say anything in either the error log or the log and it is connected to the middle rs485 port which should be port rs485-1

[Image: 23hsxt0.jpg]

But here it says RS485-2 and RS232, according to the datasheet it is not the same.
[Image: 2ynqpg9.jpg]
Here is says rs485-2 has the rs232, while on the system status one can think it's the port 3. Where is it possible to check if I got the correct firmware on the LM?
Reply
#5
(06.05.2019, 10:36)ole Wrote:
(06.05.2019, 09:23)admin Wrote: Have you tried swapping A/B? Do you have RS485 GND connected?

Yes, I have tried to to change the ports (A/B), but have not connected the GND. Should it be connected?

Tried to use the RS-485 echo test resident script found in the manual for the LM5p-dr.
I tried it from RS485-1 to 3, 1-2, 3-2 and 2-3 with no message in either the log or the error log - is there something special one need to do with the script, I just copied it directly from the manual into a resident script, only changing the name of the port?

Thanks in advance

No, it doesn't say anything in either the error log or the log and it is connected to the middle rs485 port which should be port rs485-1

[Image: 23hsxt0.jpg]

But here it says RS485-2 and RS232, according to the datasheet it is not the same.
[Image: 2ynqpg9.jpg]
Here is says rs485-2 has the rs232, while on the system status one can think it's the port 3. Where is it possible to check if I got the correct firmware on the LM?

if you hav 3*rs485 ports, then probably you installed incorrect Firmware, that could be reason of problems.
Reply
#6
All current devices share the same base board with one RS485 and one combined RS485/RS242 port. If loop test script does not work then port might be damaged physically. Do you have any plugins like ekey installed? These might use one of RS485 ports by default.
Reply
#7
(06.05.2019, 13:32)admin Wrote: All current devices share the same base board with one RS485 and one combined RS485/RS242 port. If loop test script does not work then port might be damaged physically. Do you have any plugins like ekey installed? These might use one of RS485 ports by default.

Not that I'm aware of, I have done a factory reset and uploaded a new firmware before starting testing. 
But why does not the port RS485-3 show in the system listing? 
Tried to run the DMX trough port 3, but get an error in the error log

[Image: 2db9ug9.jpg]
Reply
#8
Which firmware have you installed?
Reply
#9
(07.05.2019, 06:46)admin Wrote: Which firmware have you installed?

I installed LogicMachine5 Power / LogicMachine5 Reactor IO Power (lm5m3ex-20170620.img), from the "NEW Logic Machine firmware version 2017.06 x3 CPU POWER version (i.MX6)" listing.
I got the LM5p-DR unite. Is this correct and is there any way to see what firmware which is installed on the unite?
Reply
#10
Try this one: https://dl.openrb.com/lm-18-imx6/lm5m3ex-20180828.img
Reply
#11
(07.05.2019, 07:02)admin Wrote: Try this one: https://dl.openrb.com/lm-18-imx6/lm5m3ex-20180828.img

With that firmware I get up all rs485 ports and when I use it to run the dmx script I no longer get any error message in the log, but I still do not get the dmx light to work. I find it strange that all three rs485 ports have been damaged, so I guess I must be doing a mistake somewhere.

When one test the connection with the echo script, one need two resident script, one for port one and one for the other port right ?
Reply
#12
Use this script to test communication between RS485-1 <> RS485-2. Only single resident script is required.
Code:
require('serial')

p1 = serial.open('/dev/RS485-1', { duplex = 'half' })
p2 = serial.open('/dev/RS485-2', { duplex = 'half' })

function test(p1, p2)
  p1:flush()
  p2:flush()

  for i = 1, 100 do
    p1:write('1234567890')
    res = p2:read(10, 1)
    if not res or res ~= '1234567890' then
      haserror = true
      break
    end
  end
end

haserror = false

test(p2, p1)
test(p1, p2)

if haserror then
  alert('RS485 ERROR')
else
  alert('RS485 OK')
end
Reply
#13
(07.05.2019, 11:10)admin Wrote: Use this script to test communication between RS485-1 <> RS485-2. Only single resident script is required.

Thanks, with your script I get all rs485 ports to work, so then it must be me who is making a mistake when I'm configuring the dmx scripts or objects.

With the mark dmx objects script do one need to make any changes to the script? And the dmx address is the last group addres, so I got 10/0/0 as the first taged with dmx, that means it have address 1 on the dmx or am I wrong ?
Reply
#14
DMX channels are numbered from 1, so the first group address should be 10/0/1. You can also try running Random scene example so you don't need to change channels manually.
Reply
#15
(07.05.2019, 11:49)admin Wrote: DMX channels are numbered from 1, so the first group address should be 10/0/1. You can also try running Random scene example so you don't need to change channels manually.

Got the DMX to work by running the event dmx script inside the the editor.

[Image: 2z855z7.jpg]

There is an option one can choose "execute on group read" should this one be selected on the event script?

[Image: 27zm2rd.jpg]

Another thing I noticed, was that the response time on the dmx was a bit slow, it took around one second from turning on a dmx channel inside the lm5, til the light turned on, is it possible to speed up this? I have changed the transition time to "0" in the dmx handler script, guess this one is for how fast it is turning on and off ?

Edit:
Found an variable in the dmx libary, "resolution = 20" if one change this variable, will one decrease this time?
Reply
#16
It should work much faster than 1 second. Resolution controls how many DMX frames are sent per second. If value is too high you will get high CPU load, if it is too low then you might get delays.
Reply
#17
(08.05.2019, 08:40)admin Wrote: It should work much faster than 1 second. Resolution controls how many DMX frames are sent per second. If value is too high you will get high CPU load, if it is too low then you might get delays.

Seems like I was a bit fast there, after getting back from lunch the dmx had stopped working..
Have tried to reset the LM and I have checked that all the script are still there and I also did check the echo script I got to see if it was a problem with the RS485 port.

Is it hard to write a script that say one choose to use port 1 on the dmx and send the signal into port 2 and use a script to log the data sendt from the LM ?
I suspect the problem is with the LM, because the DMX works with the artnett module.
Reply
#18
I suspect that there's a physical problem somewhere. Try a different wire and also try connecting GND signal.
Reply
#19
(09.05.2019, 06:17)admin Wrote: I suspect that there's a physical problem somewhere. Try a different wire and also try connecting GND signal.

After a bit of testing I managed to get it to work. Tried with different cables and even checked the end of line resistor, but the thing that made it work was to change the nummber of DMX addresses in the script from 12 to 13, which I find odd since I only had connected a 12 channels dmx driver/controller. Does anyone have a good explanation on this ?

In regards to how fast it changes the led light when changing it from the LM there is still a noticeable delay, but it varies from time to time how long it takes, which is strange since the dmx script is the only thing running on the LM.
Reply
#20
I have same problem?
What is right connection between DMX jack (1-2-3) and rs485-1 on LM?

I try:
1-GND ; 2-A ; 3-B
1-GND ; 3-A ; 2-B
Reply


Forum Jump: