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.

LM5 RS485 check
#1
Hi,

I have an LM5 communicating with an arduino board via RS485 serial port.
It was working for several months but suddenly it stooped without any obvious reason.
Is there any easy way to check if there is a hardware problem with the RS485 port?

Thank you in advance
George
Reply
#2
You can connect two RS485 ports on LM5 together and write a script to test communication between them.
Reply
#3
(03.03.2019, 16:24)admin Wrote: You can connect two RS485 ports on LM5 together and write a script to test communication between them.

Didn't though about it... thank's!
Reply
#4
here is the script for RS485 self-test with either OK or ERROR message in Alerts. 
Make sure to adjust port names accordingly (2nd, 3rd lines):

Code:
require('serial')

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

function test(p1, p2)
errors = 0

p1:flush()
p2:flush()

for i = 1, 100 do
p1:write('1234567890')
res = p2:read(10, 1)
if res and res == '1234567890' then
res = '+'
else
res = '-'
errors = errors + 1
if errors > 5 then
break
end
end

io.write(res)
io.flush()

if i % 50 == 0 then
print()
end
end
end

test(port2, port1)
test(port1, port2)

alert(errors > 0 and 'ERROR' or 'OK')
Reply
#5
Here is a nice article about necessity to use 3 wires when interconnecting RS485 devices. Might help somebody to protect RS485 or the whole device from the damage  Sleepy
Reply
#6
Hi. I have a problem every time I restart the LM. The rs485 port of the dali installation is not enabled, needing to re-enter the dali configuration and enable it.
I have another LM in another similar installation and it doesn't fail. I already updated the firm and the Dali package, and still doing the same. Can you think of it?
Thank you
Reply
#7
Most likely your SD card is in read only mode and the configuration is not saved. Try changing any other configuration, reboot and see if it is still changed.
------------------------------
Ctrl+F5
Reply
#8
(23.09.2019, 15:35)Daniel. Wrote: Most likely your SD card is in read only mode and the configuration is not saved.  Try changing any other configuration, reboot and see if it is still changed.
The rest of the configuration is saved perfectly. Scripts, group addresses, objects ...
Where can I see if it is in read mode?
Reply
#9
Which FW?
------------------------------
Ctrl+F5
Reply
#10
(23.09.2019, 16:34)Daniel. Wrote: Which FW?

LM5 Power with extensions: https://dl.openrb.com/lm-18-imx6/lm5m3ex-20180828.img    

and genohm-scada-dali_20181128_imx6.ipk
Reply
#11
which port do you use?
------------------------------
Ctrl+F5
Reply
#12
(24.09.2019, 07:54)Daniel. Wrote: which port do you use?
I have 6 Dali catwalks. I use internal dali 1 and 2, and then 4 gateways connected to / dev / RS485-1.
The equipment works perfectly, the only thing, that when it restarts it loses the configuration of the port / dev / RS485-1.
I have another installation with 3 more gateways, and I have no problems.
Reply
#13
Hi David,
I expect that objects/icons were saved before the microSD got in read-only mode. Have you tried to add some new object/icon now, then Sync DB and then reboot. Are they saved?
We have tried, its working fine. So I suspect its microSD which need to be replaced following this procedure.
Reply
#14
Can you post a screenshot of partitions table? System config > Status > System status > Partitions. You might have a device with separate flash storage for the database so object changes will be saved even when SD card is read-only.
Reply


Forum Jump: