Somfy RTS 485 to SHAC

Discussion in 'C-Bus Automation Controllers' started by peteinau, Jun 30, 2019.

  1. peteinau

    peteinau

    Joined:
    Jun 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi,

    Having recently acquired a SHAC I have been trying to connect my Somfy RTS 485 transmitter directly. I can't seem to get it working tho, I can't tell if it is a case of not wiring it well or sending the wrong serial string...

    I've got it wired as:
    Somfy + to SHAC AT
    Somfy - to SHAC BT
    Somfy GND to SHAC COM

    Scripting I'm using:

    msg = string.char(0x7F,0xF2,0xFA,0x01,0x00,0x00,0xDA,0x68,0xFA,0xFF,0xFE,0x06,0xA5)
    require('serial')
    port = serial.open('/dev/RS485', {
    baudrate = 4800,
    databits = 8,
    stopbits = 1,
    parity = 'odd',
    duplex = 'half'
    })
    port:flush()
    port:write(msg)
    port:close()

    Anyone have any ideas? It's hard to troubleshoot as I don't get any errors, it just doesn't work. The string works when I had it connected to an USB RS232 to RS485 dongle on my PC.

    Thanks,
    Pete
     
    peteinau, Jun 30, 2019
    #1
  2. peteinau

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    Hi Peteinau,

    Are you running this in an event script?

    You could try sending the string as an escaped string like,
    msg = ("\x7F\xF2\xFAx01\x00\x00\xDA\x68\xFA\xFF\xFE\x06\xA5")

    I think the leading zeros ,0x00 may be an issue when using string.char(),
    Other thing would be to insert
    log(msg) after port:flush() to see how the string looks in the log

    Or use USB to 485 converter and wire the SHAC to that then run a terminal session on your computer to see what you have coming out the SHAC 485 port.
     
    Pie Boy, Jun 30, 2019
    #2
    Mr Mark likes this.
  3. peteinau

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    The 0x notation is correct for Lua.

    You do have a syntax error however in the serial.open. You are missing a quote, comma and open curly bracket:

    port = serial.open('/dev/RS485', {
    baudrate = 4800,
    databits = 8,
    stopbits = 1,
    parity = 'odd',
    duplex = 'half'
    })
     
    Ashley, Jun 30, 2019
    #3
  4. peteinau

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    It looks like the forum deletes those characters for some reason :)

    Yours is probably correct then.
     
    Ashley, Jun 30, 2019
    #4
  5. peteinau

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    The data lines need to be connected to A and B, not AT and BT.

    The AT and BT terminals on the SHAC are for the optional termination... you put a link between AT and BT if you want the low power (120R + 1n) termination, or between A and BT if you want the high power (120R) termination.

    Nick
     
    NickD, Jul 1, 2019
    #5
    Ashley likes this.
  6. peteinau

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Lucky someone reads the docs :)
     
    Ashley, Jul 1, 2019
    #6
  7. peteinau

    peteinau

    Joined:
    Jun 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi guys, thanks for the input, nice to know that I'm at least on the right path!

    I've connected it to the A and B with wires twisted and not twisted but still no luck. I tried wiring my RS485-USB cable to the SHAC to see if it was sending anything but doesn't seem to be either....

    Is there something I need to turn on with the SHAC to enable the port or something? I feel like I've missed something basic somewhere.

    Thanks in advance for any help!
     
    peteinau, Jul 6, 2019
    #7
  8. peteinau

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    I assume you have supplied power via the 24V input... the I/O ports don't get power when you're powered from USB.

    Can you see the RS485 LED flash when you transmit/receive?

    Nick
     
    NickD, Jul 8, 2019
    #8
  9. peteinau

    peteinau

    Joined:
    Jun 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi Nick,

    Ahhhh... that might indeed be the problem! We have been powering it by USB. I thought it could be powered by POE initially, but that didn't seem to work so we just used USB. Ordered a power supply to supply the power, hopefully it will just work then.

    Thanks heaps!
     
    peteinau, Jul 9, 2019
    #9
  10. peteinau

    peteinau

    Joined:
    Jun 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi Guys,

    I've been away travelling but got a power supply connected it up, but I can't see the RS485 LED flash when I transmit/receive. Does that mean I haven't configured something?

    Thanks,
    Pete
     
    peteinau, Jul 27, 2019
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.