AV & Custom Systems: Control via RS232 through Global Cache

From iRidium Mobile Wiki
Jump to: navigation, search

<< back (Global Cache: Working with RS232 Devices)

If it is necessary to control AV equipment or other systems in the installation via the COM-port (the RS232 protocol),you are required to use format converter from TCP to RS232. We recommend using equipment of the Global Cache company.

iTach IP2SL converters support up to 4 clients online simultaneously. In this mode the converter can receive data from 4 TCP connected clients to the COM-port and send data back. The received data is sent to the COM-port sequentially. Data from the СОМ-port is sent to all open ТСР sockets allowing each panl to update the status of the controlled device. The mode of iTach multiple connections can be activated or deactivated only through the iTach web-interface.


Principles of Controlling Equipment via RS232

To control Smart Home systems via RS232 commands (СОМ-port) iRidium uses the freely customizable "AV & Custom Systems" driver and format converter which enables you to convert the command send via TCP by iRidium to the RS232 format. Thus the scheme of communication between an iRidium control panel and controlled equipment looks as follows:

HowItWorksGCRS232.png

Commands can be sent to the Global Cache converter in the ASCII, HEX or DEC formats. When sending commands use special iRidium syntax to define the data format.

↑ Back

Adding RS232 Commands to iRidium Data Base

To store RS232 controlled devices with commands it is required to create their data base in iRidium GUI Editor. It will enable you to use the devices in any iRidium project.

DB Editor is used for adding devices controlled via RS232 and their commands to iRidium base. New devices can be added only to custom data bases as standard bases contain ready preconfigured modules of Global Cache converters which cannot be edited (you can only take modules from the ready bases).

Creating New Files of iRidium Data Base

AV Database New.png

Use your own data bases (created manually) for storing your devices not standard data bases which can be updated with releases of new versions of iRidium GUI Editor. The names of the base file and folder for storing are indicated when creating the file.


Creating New RS232 Devices

AV Add IR Device.png

Tools for creating new devices in iRidium data base are available in the right-click menu. The type of the created device - RS232 Device – defines its characteristics. For RS232 devices you can indicate information about the manufacturer, type of the controlled equipment, comments and commands.


Setting Up RS232 Devices

Creation of description for new devices is not compulsory but it can help with their further identification

RS232 2.png

  • Device Type – a type of the controlled device (TV, DVD, Blu Ray, ...)
  • Manufacturer – the name of the device manufacturer
  • Description – description of the device, it can include hyper links
  • Date – the date of creating the driver

In general, RS232 devices are controlled through converters (not directly) as it enables multiple connection of control devices and operation via the Internet. In our case the converter is Global Cache. That is why all properties - Host, Port, etc. are not required. It is recommended to hide them:

RS232 3.png

  • Click two times on each property to open the window for settings and select Hidden.


To add the command in the list of the created device go to the Commands & Feedback tab and use tools of the Editor base:

RS232 4.png


The command is created empty by default. The instruction the command should send is indicated in the Command Properties windows. Click two times on the created command to open the Command Properties window.

RS232 5.png


  • Write the instruction for the command in the Command field of the opened window. In our case for the change IR to 100 msec command (setting up the interval of receiving IR commands for 100 ms) there is the 'e4',13, where ,13 is a symbol of the string end and e4 in single quotes is the instruction content (quotes define the command format - ASCII string).
  • Mark the Name Read Only field if you do not want to change the command name in the future (it is used when the driver works with scripts which refer to the command identifying it by its name).


RS232 6.png
  • Now you can close the DB Editor window.


↑ Back

Syntax of RS232 Commands

Commands for sending via the RS232 protocol cannot be added to DB Editor without checking them for compliance with the syntax accepted in iRidium. It allows you to identify the command data format and form the command correctly so it could be read by the controlled equipment.

The syntax of data sending via RS232 (COM-port) defines the rules for sending data in one of the formats selected by the user - ASCII, HEX, DEC.


Sending Commands in the ASCII (Strings) Format

To indicate a string in the ASCII format in the "Data" window write the string in ‘single quotes’. In the end of the string it is required to use the symbol of «string end»:

Syntax ‘ + string + ‘ + end
End ,13 (,$0D or ,0x0D)
Data ‘string’,13 (‘string’,$0D or ‘string’,0x0D)
  • all suggested variants of writing are equivalent


In some cases besides the symbol of «string end» it is required to indicate the symbol of «carriage shift» as follows: ,10 or ,$0A or ,0x0A. In this case the command string (the content of the Data window) will look as follows:

‘string’,13,10	
‘string’,$0D,$0A	
‘string’,0x0D,0x0A


Sending Commands in the HEX (Hexadecimal) Format

To send a string in the HEX format write $ or 0x before each HEX symbol in the "Data" window. In the end of the string it is required to use the symbol of «string end»:

Syntax $HEX + ,end
End ,$0D или ,0x0D
Data 0x01,0x02,0x03,0x0D ($01,$02,$03,$0D)
  • all suggested variants of writing are equivalent

Besides the symbol of «string end» you can indicate the symbol of «carriage shift»: ,10 or ,$0A or ,0x0A. In this case the command string (the content of the Data window) will look as follows:

$01,$02,$03,$0D,$0A
0x01,0x02,0x03,$0D,$0A
0x01,0x02,0x03,0x0D,0x0A


Sending Commands in the DEC (Decimal) Format

To indicate a string in the DEC format in the "Data" window write data in the decimal format separated by commas. In the end of the string it is required to use the symbol of «string end»:

Syntax DEC,DEC,DEC + end
End ,13 (,$0D или ,0x0D)
Data 1,2,3,13
  • all suggested variants of writing are equivalent

Besides the symbol of «string end» you can indicate the symbol of «carriage shift»: ,10 or ,$0A or ,0x0A. In this case the command string (the content of the Data window) will look as follows:

1,2,3,13,10	

Examples of using the syntax (ASCII, HEX, DEC):

AV Syntax Examples.png


↑ Back

Adding RS232 Devices to iRidium Projects

Create a new project. New projects can be created with the help of the button on Tool Box or through the menu File > New Project.

UseDriver 0.png

You can find more information about project creating in the section Creating the Graphic Part of iRidium Projects


Select the GC.db data base in the Device Base panel and add the Global Cache device you have in Project Device Panel of your project using the Drag&Drop method.


RS232 7.png


To connect iRidium to the Global Cache converter, indicate the local IP-address of the converter in general settings of the converter in the PROPERTIES window of the Project Device Panel:


RS232 9.png

Host – an IP-address of the controlled Global Cache converter.

To learn the local (private) address of the Global Cache converter for working within the local IP network use iHelp (download) or see "Quick Start Guides" at the first launch of the converter.


To work with the Global Cache converter via the Internet indicate the public IP-address of the router the converter is connected to. Set up the Port Forwarding Service for the router which enables possibility of referring to the local address of the controlled converter from the Internet (remote control).


You can learn the external (public) IP-address of your router with the help of external resources, for example [1]


Select your userdatabase.db data base in the Device Base panel and add the GC-IRL device on the serial port of the Global Cache device in Project Device Panel using the Drag&Drop method.


RS232 8.png


Select the Draw Item tool and create a new item.


RS232 10.png


Open commands of the GC-IRL device and drag the change IR to 100 msec command on the item. Select send command in the appeared window.


RS232 11.png


In the Send Command dialog window select the type of the event which will activate command sending to the device.

  • Press – pressing on the item
  • Release – releasing the item
  • Hold – holding the item
  • Move – moving on the item (it it mainly used for the Level item type)

The Press event is indicated by default as the most commonly used.


RS232 12.png


The commands added on the item can be seen in the Programming tab of the Object Properties panel.


RS232 13.png


Launch Emulator to check how the command works.


RS232 14.png


↑ Back

Setting Up the Serial Port of Global Cache

To set up the properties of the СОМ-port connected to the equipment controlled through iRidium and Global Cache indicate IP-address of your Global Cache in the browser address line and go to its web-interface. Select the serial section.

To learn the local (private) address of the Global Cache converter for referring to the web-interface and working within the local IP network use iHelp (download) or see "Quick Start Guides" at the first launch of the converter.


RS232 24.png


  • On this page you can see and set up different properties of the serial port.


Downloads

Download: Example of a project (2 Mb)


<< back (Global Cache: Working with RS232 Devices

↑ Back