Serial Somfy motor Control

Discussion in 'C-Bus Serial Protocols' started by [email protected], Nov 29, 2012.

  1. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Hi!

    I'm trying to control via a PACA unit a series of ILT Somfy motors. I have connected to the PACA un Port 1 a RJ45 cable to a RS232 to RS485 convertor and outlet will control the Somfy motor.

    So far I have this programmed

    Also I have a Saturn 4 button keypad, and a button is program to turn ON "Arriba" making the blind to go up, but it is not working.

    Do you have any ideas of what can I do??

    German
     
    [email protected], Nov 29, 2012
    #1
    1. Advertisements

  2. man.vilches@gmail.com

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,418
    Likes Received:
    47
    Location:
    Adelaide
    WriteSerial(1, #$67#$F2#$FB#$01#$00#$00#$36#$FF#$FA#$FE#$FE#$06#$ 80);

    It looks like you are trying to send a series of hex values. I'm not sure if you can specify them like this though (having said that I would have expected a compiler error if it wasn't supported).

    Can you try converting the numbers to decimal before constructing the string?

    eg $67 = 103, $F2 = 242, so you would do

    WriteSerial(1, #103#242.....

    Failing that, it may be that the command string to the motor is not correct...

    Looking briefly at the doco here : http://www.somfysmarthome.co.uk/Resources/RS485 4ILT Interface multilangues.pdf

    It looks like the command is more or less correct, but the source address looks wrong, so your destination address may also be incorrect.

    Nick
     
    NickD, Nov 29, 2012
    #2
    1. Advertisements

  3. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    Hex literals in strings work just fine, although the compiler wouldn't like the space before the last 80. I assume that's just a typo though. Check the PICED log file to see if it's actually being written. Then I'd connect a monitor to the RS232 or RS485 to see if it's actually getting out. After that, it's a command problem as Nick suggested.
     
    Ashley, Nov 29, 2012
    #3
  4. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Rj45 Serial Jack

    Do you by any chance know the correct configuration of the RJ45 jack for the PASCAL RS232 entrance?
    Maybe the problem is there...
     
    [email protected], Dec 10, 2012
    #4
  5. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    Ashley, Dec 10, 2012
    #5
  6. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    The power supply can be 24Vac @ 1 A?
     
    [email protected], Dec 13, 2012
    #6
  7. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    The RS232 needs 24V AC at 20mA, so a 1A supply will work fine if that's what you've got. It will probably just draw more standby power than a smaller capacity supply.
     
    Ashley, Dec 13, 2012
    #7
  8. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Log file

    This is what I get from the log file.
     

    Attached Files:

    [email protected], Dec 17, 2012
    #8
  9. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Log event 2

    I think that the communication is working out, but still no blind movement.
     

    Attached Files:

    [email protected], Dec 17, 2012
    #9
  10. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Where can I see if the serial commands are been sent?
     
    [email protected], Dec 21, 2012
    #10
  11. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    First thing to do is turn on 'Show Logic Serial Messages' in the log options. That will show you what your logic is actually writing.

    Then you need some form of serial analyser hooked up to the PAC. The easiest way is to connect the RS232 output of the PAC to a serial input on a PC and run Hyperterm or some other terminal emulator. If you see data on the Pc screen you know the PAC RS232 is working.

    Alternatively you can do a loop back test by making up a simple cable that connects the Tx line to the Rx line. Then just add a ReadSerial command and print the result with LogMessage(). This will work on the PAC or PC.

    Testing the RS485 is difficult without a proper analyzer or oscilloscope. If you have 2 RS232-RS485 converters you can connect them back to back between the PAC and PC (i.e. PAC-(RS232-RS485)-(RS485-RS232)-PC

    You can also plug the RS232-RS485 converter directly into the PC and using Hyperterm type commands directly to the blind controller and see if it responds.

    You can do all the same things directly on the PC from PICED if you have 2 serial ports. I just use 2 USB-RS232 adapters and it works fine. You just need a RS232 swap over cable to connect the 2 ports together (they were generally known as Serial Laplink cables as they were used by a program called laplink to copy data between PC's in prehistoric times)

    Are you confident you are sending the correct commands to the blind controller?
     
    Ashley, Dec 21, 2012
    #11
  12. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    Thank you Ashley, I'll try what your are saying. In the other hand, yes I am confident the blind controls are correct, I'm working with a Somfy Mexico technicians. They have the the commands for the motors. So it must be something else.
     
    [email protected], Dec 26, 2012
    #12
  13. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    I'm still having this problems with the logic engine. Now there is an error of COM1, It seems that the serial is trying to send something but something is not working out.

    Do you have any more ideas?
     

    Attached Files:

    [email protected], Jan 8, 2013
    #13
  14. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    Are you opening the com port using OpenSerial in the Initialisation section?

    If so, try posting all your serial code so we can look at what you are trying to do.
     
    Ashley, Jan 9, 2013
    #14
  15. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    I tried what you suggested Ashley and I got this.
    It looks that the logic is being sent through the PAC, but still I have no motion on the Somfy motors.

    The only thing that I had in code was in the module, but after your reply I put this:

    And I already had this written down

    I?m almost there.
     

    Attached Files:

    [email protected], Jan 11, 2013
    #15
  16. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    You only need to open the serial port in the Intialisation section. Don't open and close it for each command. Also if you want to read back the acknowledge ment you need to put a delay in as the ReadSerial will not wait for a response.

    According to the Somy RS-485 protocol I have they use ODD parity where you have selected none. Also, your checksums don't seem to agree with the documentation I have. Perhaps you could post the RS485 protocol you are using.

    Ashley
     
    Ashley, Jan 12, 2013
    #16
  17. man.vilches@gmail.com

    [email protected]

    Joined:
    Nov 29, 2012
    Messages:
    11
    Likes Received:
    0
    Location:
    Mexico
    What do you mean by writing that my checksums don?t agree with what you have.

    Do I also need to close serial in initialisation section?
     
    [email protected], Jan 24, 2013
    #17
  18. man.vilches@gmail.com

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,267
    Likes Received:
    130
    Location:
    Adelaide, Australia
    According to the Somy RS485 document I have, the checksum (last byte) is the sum of the complement of all the bytes. (This is actually a bit unusual as the most common checksum is calculated buy adding all the bytes and negating the result, so on reception the sum of all the bytes including the checksum is zero). When I calculate a checksum using the Somfy algorithm I get a different result from what you have in your code. Where have you got the control strings from and how are you calculating your checksums?

    Generally you open the serial port in the initialisation section and just leave it open. There is no need to close and re-open. All the while the port is open the received data will be queued up until read, so you should never loose data by leaving the port open.
     
    Ashley, Jan 24, 2013
    #18
    1. Advertisements

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.