5500PACA and RS232 Tutorials

Discussion in 'C-Bus Serial Protocols' started by IanCun, Apr 19, 2015.

  1. IanCun

    IanCun

    Joined:
    Sep 6, 2012
    Messages:
    71
    Likes Received:
    0
    Location:
    UK
    Hi,

    Are there any tutorials or walkthroughs for a beginner when it comes to interfacing with the RS232 ports on a 5500PACA pascal unit? I'm interested to know if it would be possible to interface with the C-Bus system using a Raspberry Pi over the RS232 ports. For example, I could use logic to control the Rasberry Pi to play things over Sonos, etc...

    I've seen that this is possible when using C-Gate installed on a machine connected to the USB port on the 5500PACA, but I'd be more interested in using the RS232 ports if possible, as the logic engine will remain active.

    Has anyone tried this before, or have you seen information elsewhere that may prove useful? Even if I can get to the stage where things are physically connected and I can send very basic commands would be a huge starting step - or perhaps this is a little over ambitious, so please do let me know if that is the case ;)

    Cheers,
    Ian
     
    IanCun, Apr 19, 2015
    #1
  2. IanCun

    IanCun

    Joined:
    Sep 6, 2012
    Messages:
    71
    Likes Received:
    0
    Location:
    UK
    Sorry, 2nd question ;).

    It looks like the Raspberry Pi has RS232 comms which can be enabled by using the Tx and Rx pins (14 and 15 on the GPIO header). However, from what I understand I will have to use the 24VAC power input on the 5500PACA to get the serial comms working - I can't power them from the Raspberry Pi I guess.

    Would something like this allow me to power the serial ports on the 5500PACA? It supports up to 5V power output:

    http://www.amazon.co.uk/UART-CP2102...1?ie=UTF8&qid=1429467925&sr=8-1&keywords=ftdi
     
    IanCun, Apr 19, 2015
    #2
  3. IanCun

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,521
    Likes Received:
    173
    Location:
    Adelaide, Australia
    The RS232 ports on the PAC can only be accessed by the logic engine read/write serial functions. As such they have no defined protocol. Generally they are used to connect to other serial equipment that uses a proprietary protocol, and it is up to you read read and decode the messages. If you are connecting the PAC to a raspberry PI, you can invent any protocol you like. The complexity of this depends on what you actually want to accomplish. There are numerous topics on these forums discussing how to interface to serial devices which should get you going.

    The PAC needs 24v AC to power the RS232 lines (RS232 uses -12V and +12V). A USB to TTL converter is not much use here. Just buy a 24VAC plug pack and connect it to the PAC. Note that if the Raspberry PI supports the DTR and RTS signal lines they can be used in lieu of the 24VAC supply.

    The other choice you have is to purchase a PCI which is an RS232 to CBUs interface. This supports the CBUS serial protocol which is fully described in the downloadable documents. This gives you complete access to all CBUS functions directly. You can either write your own code in the PI the talk to the PCI, or others have actually managed to get Cgate running on the PI which makes life a whole lot easier. This is described on these forums somewhere.
     
    Ashley, Apr 20, 2015
    #3
  4. IanCun

    IanCun

    Joined:
    Sep 6, 2012
    Messages:
    71
    Likes Received:
    0
    Location:
    UK
    Thanks Ashley - I've got C-Gate running on the Pi already, but as it disables the logic engine when I'm connected to the USB on the PAC, I'm trying to avoid using it.

    I'll try powering the serial interface with +/- 12v on the DTR/RTS lines and see how far I can get :).
     
    IanCun, Apr 20, 2015
    #4
  5. IanCun

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,521
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Sending commands to the PAC via RS232 is quite simple because you can just make up a protocol like L012,034 to say set group address 12 to level 34. In the PAC the logic just pulls out the sub-strings and issues a SetCBusLevel command. The difficulty is going the other way as you can't get a notification on every ga change, you have to test them all separately which is a bit tedious. CIS really needs to add a wildcard option to the ONCE statement.

    What I do these days is buy a CBus sim module (they are around AU$150) which hook up to TTL lines and talk the full Cbus protocol. Since you have Cgate already running this would save you a huge amount of work for relatively little outlay.
     
    Ashley, Apr 20, 2015
    #5
  6. IanCun

    IanCun

    Joined:
    Sep 6, 2012
    Messages:
    71
    Likes Received:
    0
    Location:
    UK
    I'd love to do that, but I can't see these for sale in the UK unfortunately. I had a good luck for one, but can't see where to get one. Perhaps I should make a new thread on that, as that would enable me to build what I'm after.
     
    IanCun, Apr 20, 2015
    #6
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.