Logic Machine Forum
RS485 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Hardware (https://forum.logicmachine.net/forumdisplay.php?fid=12)
+--- Thread: RS485 (/showthread.php?tid=367)



RS485 - Girish - 05.08.2016

Hi,

      We are trying to control Somfy Curtain by sending Hexadecimal code from Logic Machine to Somfy RS485 RTS transmitter. We are not able to control the curtain by sending hexadecimal code from Logic Machine lm3. We have used following Script:

if not port then
require('serial')
port = serial.open('/dev/RS485-2', { baudrate = 4800, parity = 'odd', duplex = 'half' })
port:flush()
 
end
-- port ready
if port then
  cmd=string.char(0x7F, 0xF2, 0xFA, 0xFF, 0x00, 0x00, 0xB0, 0x4E, 0xFA, 0xF3, 0xFD, 0x07, 0x52)
 alert(cmd)
  res, err=port:write(cmd)
end

       Please check and tell if there is any problem with the Script. If No problem with this Script. what may be the problem?

We are able to control Somfy RTS curtains by sending RS485 hexadecimal command from PC RS485 software but we are not able to control from Logic Machine.

Please help us to solve this problem.


RE: RS485 - rocfusion - 05.08.2016

Try a connecting to a different port,  I found that with a LM4 only one port was working

I created a function and stored this in the Common scripts.

Code:
function sendSOMFY(command)
 require('serial')
 port = serial.open('/dev/RS485-3', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 })
 port:flush()
 port:write(command)
 port:close()
 sleep(0.1)
end

Also the codes you use, there are different versions of the Somfy command generator. Depending on what type of motor being used each version may generate a different RS485 command. Also be sure your selecting the right addressing scheme, ie individual or group which is determine by how that motor has been programmed.

thx

Roger


RE: RS485 - Girish - 06.08.2016

(05.08.2016, 13:50)Ok i will try this. Thank a lot  rocfusion.rocfusion Wrote: Try a connecting to a different port,  I found that with a LM4 only one port was working

I created a function and stored this in the Common scripts.

Code:
function sendSOMFY(command)
 require('serial')
 port = serial.open('/dev/RS485-3', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 })
 port:flush()
 port:write(command)
 port:close()
 sleep(0.1)
end

Also the codes you use,  there are different versions of the Somfy command generator.  Depending on what type of motor being used each version may generate a different RS485 command.  Also be sure your selecting the right addressing scheme, ie individual or group which is determine by how that motor has been programmed.

thx

Roger



RE: RS485 - buuuudzik - 27.08.2016

(06.08.2016, 05:08)Girish Wrote:
(05.08.2016, 13:50)Ok i will try this. Thank a lot  rocfusion.rocfusion Wrote: Try a connecting to a different port,  I found that with a LM4 only one port was working

I created a function and stored this in the Common scripts.

Code:
function sendSOMFY(command)
 require('serial')
 port = serial.open('/dev/RS485-3', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 })
 port:flush()
 port:write(command)
 port:close()
 sleep(0.1)
end

Also the codes you use,  there are different versions of the Somfy command generator.  Depending on what type of motor being used each version may generate a different RS485 command.  Also be sure your selecting the right addressing scheme, ie individual or group which is determine by how that motor has been programmed.

thx

Roger

Did you prepare also the reading data from the Somfy or only sending? I am before such integration. Can I check if blind received the data?