Setting up IR Commands Manually

From iRidium Mobile Wiki
Jump to: navigation, search

<< back (AV & Custom Systems: Control via IR through Global Cache)


Preparing IR Commands for Their Use in iRidium

Commands, which can be used for controlling equipment with IR, can be received from different sources:

  • Commands can be received with the help of IR Learner which can read IR codes from remote controls. IR Learner recodes the received commands in the format used for sending the commands to Global Cache converters.
  • The list of commands can be downloaded from the web site of the equipment manufacturer. In this case the commands are stored in the HEX coding. They have to be adapted for Global Cache using iConvert (download).
  • The list of commands can be found on information resources and forums of integrators, for example remotecentral.com. Here they are also stores in the HEX coding and they have to be adapted using iConvert.

You can see the example of storing IR commands for Panasonic TV here. The commands have the special format PRONTO CCF and they are stored in the HEX coding. To use such commands in iRidium it is required to select the converter of data to the IR format. This format will be used for sending control IR commands via the IR emitter (LED). There are a lot of such converters but the most complete integration is accomplished with Global Cache converters.

To use commands stored in the HEX coding (downloaded from web sites of equipment manufacturers or opened resources), they should be recoded from HEX to the format for working with Global Cache converters: (iTach IP2IR, iTach WF2IR or GC-100-06, GC-100-12).

To recode commands from HEX to the Global Cache format use iConvert (download):

IConvert.png

Initial command (HEX):

0000 0071 0000 0032 0080 003F 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010  
0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010
0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010
0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0030
0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0010 0010 0030 0010 0030 0010 0030 0010
0030 0010 0030 0010 0010 0010 0030 0010 0A98

After conversion (Global Cache):

sendir,<mod-addr>:<conn-addr>,1,37000,<repeatcount>,1,
128,63,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,48,16,48,16,48,16,48,16,48,16,16,16,16,16,16,16,48,16,48,16,48,
16,48,16,48,16,16,16,48,16,2712

The first part (heading) in the Global Cache coding defines the parameters which will be used when sending the command. In ready iRidium modules for working with Global Cache (you can find them in the database of DB Editor of iRidium GUI Editor). Headings are formed automatically. They are set up by the user in the properties of IR outputs of ready modules. See more information about it below.

There is a possibility of manual setting up of IR command heading (it is described in the section Adding IR Commands to the iRidium Database. It can be used when it is required to from unique settings of one or several commands of an IR device.

You can see detailed information about forming IR commands in the Global Cache coding in iTach API or GC-100 API

You can check the work of commands in the Global Cache coding with the help of iTest (download)

When working with iTest the command should be sent with the heading (sendir,1:3,1,38000,1,1, etc.). But when sending the IR command via the preset Global Cache module from the iRidium database, you do not need to set up the heading manually as it will be included in the command body automatically (see below).

↑ Back

Adding IR Commands to the iRidium Database

To store controlled IR devices with commands it is required to create a database in iRidium GUI Editor. It will allow you to use the devices in any iRidium projects.

To add devices controlled via IR and commands for them in the iRidium database use DB Editor – the database editor. You can add a new device only to your own database as standard databases contain ready, preset modules of Global Cache converters, editing of which is forbidden (you can only take modules from the standard databases).


Creating a New Database File

AV Database New.png

To store your own devices use your own databases (created manually), not standard databases which can update with releases of new iRidium GUI Editor versions. The names of the database file and folder for storing are indicated when you create the file.


Creating a New IR Device

AV Add IR Device.png

Tools for creating new devices in the iRidium database are available in the right-click menu. The type of the created device - IR (IR Device). Set up its characteristics. IR devices do not have connection properties as they are always associated with Global Cache converters. For IR devices you can set up information about the manufacturer, comments and commands.

Description of a New IR Device

AV IR Device Settings.png

Description of devices is not obligatory but it might help you later with their identification:

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


Forming the List of IR Commands for the Device

AV IR Device Commands.png

At this stage it is required to set up only the command name corresponding to its application (for example, Power On, Power Off). The rest will be set up later. It is NOT recommended to use special symbols (especially points) in the names of commands.


Creating the Command Body for Sending to the IR Device

It can be done in two ways:

  1. Use GC-IRL IR Learner to learn IR commands of the IR remote control you have and add them to the database. You can communicate with IR Learner directly from GUI Editor.
  2. Copy commands in the Global Cache format from iConvert manually (commands cannot be copied from iConvert fully, read about the command format below)


Creating IR Commands with the Help of IR Learner

Select the first command from the list of commands created for an IR device and click "Learn ..." in the toolbox of DB Editor. The window for communication with IR Learner – the device for reading IR commands from remote controls - will open. GUI Editor can establish connection with IR Learner connected to the СОМ port of the Global Cache device of the СОМ port of PC with running GUI Editor:

AV IR Device Learning.png

  • TCP/IP – it should be selected if IR Learner is connected to the Global Cache converter. Indicate the IP-address of the converter and port 4999 (when connecting to the 1st СОМ port of the converter) or 5000 (when connecting to the 2nd СОМ port of the converter)
  • RS232 - it should be selected if IR Learner is connected directly to PC. Indicate the number of СОМ port in the settings (the rest settings are by default).

After the setting up press OK and the learning window will open. There you will see the name of the current command. Press the corresponding button on the remote control of the device which commands we want to receive. The remote control should be directed to the IR LED of IR Learner. If the command is received the LED flashes and the command name in DB Editor is substituted by the next in the list. Press all remote control buttons from the list one by one. After finishing the list of commands the learning session will be disconnected automatically. The commands which are successfully read are written in DB Editor with the semi-bold font:

AV IR Device Learning Press Button.png


Creating IR Commands Manually

Commands which have to be sent by Global Cache converters have special coding described in Preparing IR Commands for Their Use in iRidium. As a result of actions described there we receive the command in the Global Cache format which looks as follows:

sendir,<mod-addr>:<conn-addr>,1,37000,<repeatcount>,1,
128,63,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16...

But when working with ready Global Cache modules in iRidium you do not need to form the command heading as it is automatically formed for IR outputs of the ready Global Cache modules in iRidium. Heading properties are written in the settings of IR outputs of the modules.

It means that for correct adding of an IR command in the Global Cache coding to the database you need to DELETE the heading of the IR command when copying it from the iConvert application. You need to copy only the part you see in the picture:

AV IR iConvert Command Copy.png

The crossed out heading containing the properties sendir,<mod-addr>:<conn-addr>,1,37000,<repeatcount>,1, is NOT copied from iConvert. The correctly copied command looks as follows:

AV IR Commands Adding Manually.png

Command properties in the iRidium database:

  • Name Read Only – if this property is activated, the name of such command cannot be changed when working with the project
  • Use Sequence – the command with active Use Sequence uses ready headings of Global Cache modules. If you want to form command headings manually deactivate this property.


If it is required to form a unique command heading, you can create it manually after deactivating 'Use Sequence' in the command settings and following rules for forming headings of IR commands in the Global Cache format:

You can see detailed information about forming IR commands in the Global Cache coding in iTach API or GC-100 API

Properties of IR command heading are formed as follows (information from API):

sendir,<connectoraddress>,<ID>,<frequency>,<repeat>,<offset>,<on1>,<off1>,...,<onN>,<offN> 
  • <connectoraddress> – the address of the device network module. It consists of 2 parts: [module number]:[output number]. For example, 1:3 (module 1, output 3)
  • <ID> - |0|1|2|...|65535| - the command identifier (it is used in the response of the module "completeir", which comes as a confirmation of IR command sending)
  • <frequency> - |15000|15001|...|500000| (Hz) – the frequency of command sending
  • <repeat> - |1|2|...|50| - the number of times the command is sent
  • <offset> - |1|3|5|….|383|- it is used if <repeat> is more than 1. It means the shift from the beginning of the IR command which separates its heading. If <offset> is indicated the command heading will be sent only once. The second and further cycles of <repeat> will send only the command body after the indicated <offset>. The value of <offset> is always odd as it starts with <on> and ends with <off>.
  • <onN> - |1|2|…|65635| - the number of pulses. N – less than 260 or in total 520 values.
  • <offN> - |1|2|…|65635| - the number of pauses on the carrier frequency.


The command formed in correspondence with the rules looks as follows:

sendir,1:3,1,38000,1,1,
128,63,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,48,16,48,16,48,16,48,16,48,16,16,16,16,16,16,16,48,16,48,16,48,
16,48,16,48,16,16,16,48,16,2712

To add the command in the iRidium database as a ASCII string (it is required to indicate the data format) and to be able to send it via ТСР, it is necessary to use special iRidium syntax. The syntax defines the rules of presenting data in decimal (DEC), hexadecimal (HEX) or string (ASCII) format.

The IR command with the ready heading should be in 'single quotes' so the bas could identify it as an ASCII string. After the quotes the end string symbol (<CR>) should be indicated, for example, in the decimal format (,13) required for ТСР commands (Global Cache receives the command via ТСР and converts it to the IR format). Thus the IR command with the heading and string end which is correctly added in the editor looks as follows:

'sendir,1:3,1,38000,1,1,
128,63,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,48,16,48,16,48,16,48,16,48,16,16,16,16,16,16,16,48,16,48,16,48,
16,48,16,48,16,16,16,48,16,2712',13


In the DB Editor window the command which does not use the standard heading of the ready Global Cache module looks as follows:

AV IR iConvert Command No Header.png

↑ Back

<< back (AV & Custom Systems: Control via IR through Global Cache)