Posts tagged: RedEye

Roomie: A RedEye Alternative

While dealing with some RedEye quirks, I stumbled across iRule. It occurred to me that there have been some significant changes in the home A/V control landscape since I first install ThinkFlood’s RedEye a few years ago.

After a little Google research, I decided to give Roomie Remote a tryout. The required App is currently available only for iPhone/iPad (iOS 5) through the  Roomie Remote - Cyphersoft, LLC. It costs $9.99 and allows for control of two Internet Protocol (IP) devices. To be really useful, the Home Theater Pack is required. This is an in-app purchase ($19.99) and allows for an unlimited number of rooms and IP controlled devices. So far, the cost is $29.98.

To control devices via Infrared (IR) two additional items are required: One software and one hardware. The software is again an in-app-purchase of the Infrared Control Pack for $9.99. The hardware is an iTach IR Adapter ($89.99-$99.99) which allows for IR control over IP. Depending on the installed A/V equipment, additional hardware may be required to connect everything to your local network. Since many of us have A/V equipment more than a couple years old, the IR setup is probably required. The cost is now up to $39.97 plus the iTach. About $150 with shipping.

There is one remaining in-app-purchase available: HD Guide Pack. With this pack installed, the single-day viewing guide is expanded to seven days.

It appears that Roomie may be a reasonable alternative to RedEye for iPhone/iPad users. Even with a total cost of nearly $160, it compares favorably with $199 for RedEye ($167.38 on Amazon, as of this writing). The look of Roomie on the iPad is a definite change from RedEye, and one for the better. At least that’s my initial impression.

RedEye #0: Notes

Things learned about RedEye.

 

RedEye IP Stops Responding or Slows Down

If the Port Script is edited, there may be an error in the script. There is no way for RedEye to gracefully accommodate errors, which normally involve syntax.
To help avoid scripting errors, test your code in an IDE outside of RedEye.
If the IP address or Port number is changed and saved within RedEye’s Devices Edit Port Settings, click Edit Port Script and click Apply Changes. Even if no changes are made to the script, the link between the script and port must be re-established, apparently.
If you find the RedEye isn’t as snappy as expected, try resetting it.
From the RedEye Maintenance page

  1. Backup Data
  2. Factory Reset
  3. Restore Data

If this doesn’t seem to help…
Download the latest firmware update from ThinkFlood
From the RedEye Maintenance page

  1. Backup Data (if needed)
  2. Upgrade Software (using the downloaded update)
  3. Restore Data (after RedEye restarts)

If RedEye continues to act-up, search the ThinkFlood Forums for advice on reseting.

Lua Script Testing For RedEye

To help develop error free code, use an IDE like ZeroBrane Studio. Of course, there are other options.

Finding IP Control Codes

Try searching google for your device and ip rs232 or custom install. Here’s a list for Pioneer, Pioneer AV Receivers
And specifically for the VSX-1121-K

Lua Block Comment Error

A block comment is fine …

--[[this is a
comment]]

 

… unless it contains an embedded [[...

 

--[[this is a
[[comment]]

... which totally whacks out RedEye.

RedEye Slider Values

Slider, Show value can't be set (won't stick) in web browser setup. Changes made using an IOS device do stick.

Custom Variables Are Stored as Strings

Using RedEye's

GetVariable()

 

always returns a string.
Convert it to a number before comparing to another number in an if statement. Example:

local c = tonumber(Scripting.GetVariable("IPmsgCount"))

 

iOS Stops updating Custom Variables

If iOS stops updating variables quit and re-launch on the iGadget.

Port Script Changes

To take effect, changes to the Port Script must be saved using the Save Changes (green) button on the Devices page.

RedEye Infinite Loops

Do not send device commands from within the PortListener. It can enter an infinite loop if the sent command returns a result (always for Pioneer VSX).
Infinite loops can be terminated by editing the PortListener script and saving it to the RedEye.

Multiple RedEye Device Entries for a Single Device

There can be a device (e.g. AV Receiver) that is setup in RedEye twice. Don't use the IP address and Port combination more than once.

 

RedEye #6: Testing IP Control Codes

Knowing what a device returns after a command is received (sent by redid), helps design a control strategy.

 

Create System Variable, myInput, for the Control Code

wpid311-media_1356216853995.png
  • Point your web browser at the RedEye.
  • Click Setup
  • Click the Room
  • Click Custom Variables

 

  1. Click Add New Variable
  2. For Name enter myInput
  3. Value can remain empty
  4. Click Save

Create a New Command

wpid312-media_1356217145146.png

Click Add New Command

Create a Command to send an IP Control Code

wpid313-media_1356217761551.png
  1. For Type select Other
  2. For Name enter Send IP Cmd
  3. Click Edit Script and go to the next step – Enter Script.
  4. When the next step is complete, click OK

Enter Script

wpid314-media_1356217903583.png

Replace line 5, as indicated above, with the following script .

local c = string.upper(Scripting.GetVariable("myInput"))
local b = Scripting.GetVariable("HTMLbody")
    b = [[<tr>
    <td style="border-style: none; text-align:left;">(user)</td>
      <td style="border-style: none; text-align:left;">]]
        .. c .. " -----" ..
      [[</td>
    </tr>]] .. b
Scripting.SetVariable("HTMLbody", b)
Scripting.SetVariable("HTMLmsg", [[<table style="font-size: 80%;">]] .. b .. [[</table>]])
Scripting.SendMessage(c.."\r")

 

Click Apply Changes
Complete step 4 of the previous step.

Edit Layout

wpid315-media_1356218229698.png
  1. Click Save Changes
  2. Click Layout > Edit

Make Room on Layout

wpid316-media_1356218385482.png
  1. Click on HTML field to highlight
  2. Click and drag to make room at the top

Add Text Field

wpid317-media_1356218502735.png
  1. Select Text Field
  2. Click Add Control
  3. Position new Text Field

Link Variable to Field

wpid318-media_1356218784414.png
  1. Click to highlight Text Field
  2. Click Text Field Values
  3. Select Text Variable, myInput

Add Button

wpid319-media_1356218971952.png
  1. Select Button
  2. Click Add Control
  3. Drag to reposition button

Set Button Action

wpid320-media_1356219135686.png
  1. Select button
  2. Click Actions / Toggles
  3. Select Type as Normal
  4. Select Action Type as Command
  5. Select VSX A/V Receiver (your device)
  6. Select Send IP Cmd
  7. Click green, Save Changes button

Test Changes

wpid321-media_1356302898862.png

Return to Devices page and click (Exit)
Select the device (VSX A/V Receiver)

  1. Enter a command
  2. Click outside of the text box (so the entered text is stored in the System Variable)
  3. Click Send IP Cmd

After a short delay, the sent command should display, followed by the response sent by the VSX.

 

RedEye #5: Receive a Message from VSX via IP

After completing RedEye: Connect to Pioneer VSX via IP, the RedEye is already receiving messages from the VSX.
Unfortunately, the VSX sends messages that may be longer than expected. This makes using the received messages more complicated than might otherwise be expected.
The issue addressed here is how to display what the VSX is sending out. This will give a better idea as to how to proceed using using the received messages.
The technique outlined here is generic in that it can be used to monitor any IP port via RedEye.

 

Add Required Custom Variables

wpid268-media_1356207214681.png
  • Point your web browser at the RedEye.
  • Click Setup
  • Click the Room
  • Click Custom Variables

 

  1. Click Add New Variable
  2. For Name enter IPmsgCount
  3. Value can remain empty
  4. Click Save
  5. Repeat for variable HTMLbody
  6. REpeat for variable HTMLmsg

Edit Port Script

wpid269-media_1356207752888.png

From the RedEye Room, click Devices
Select your device.
Click Edit Port Script

Modify the script

wpid270-media_1356208017067.png

Add the following functions to the Port Script as indicated:

function string:split(sep) -- split (parse) string --> table
    local sep, fields = sep or ":", {}
    local pattern = string.format("([^%s]+)", sep)
    self:gsub(pattern, function(c) fields[#fields+1] = c end)
    return fields
end

function buildHTML(ipMsg)
    local c = tonumber(Scripting.GetVariable("IPmsgCount"))
    local b = Scripting.GetVariable("HTMLbody")
    if c > 90 then
        c = 0
        b = ""
    end
    c = c + 1
    b = [[<tr>
      <td style="border-style: none; text-align:left;">]]
        .. c .. "/" .. #ipMsg ..
      [[</td>
      <td style="border-style: none; text-align:left;">]]
        .. table.concat(ipMsg,"<br>") ..
      [[</td>
    </tr>]] .. b

 

 

    Scripting.SetVariable("IPmsgCount", c)
    Scripting.SetVariable("HTMLbody", b)
    return 
[[<table style="font-size: 80%;">]]
    .. b ..
[[</table>]]
end

Click Apply Changes

Process Input

wpid271-media_1356208260215.png

Add the following to the Port Script as indicated.

 

    local t = inputData:split("\r\n") -- store message elements in table "t"
    Scripting.SetVariable("HTMLmsg", buildHTML(t))

 

Click Apply Changes

Final Script

wpid272-media_1356208513090.png

At this point, the Port Script will accumulate all messages received from the VSX and store it in the State Variable named HTMLmsg.
Building the html code in this way, isn’t very efficient. Using a table would no doubt improve the speed.
All that remains is to display the HTML.

wpid273-media_1356208750185.png

Return to the VSX device page.
Click Layout Edit

Add HTML Control to the Layout

wpid274-media_1356208986432.png

The default buttons won’t be use right now, so they may be deleted or moved down the layout to make room.

  1. Select HTML
  2. Click Add Control

Connect the HTML received message variable to the display control

wpid275-media_1356209107124.png
  1. Click the HTML control in the Layout (indicated by the yellow #1 and blue line)
  2. Within the Device Remote Layout > HTML Values > HTML Content Variable, select the variable HTMLmsg
  3. Click Save Changes
  4. Return the the Devices page and click Save Changes
  5. Click (Exit) to return to the RedEye home screen
wpid276-media_1356209887281.png

From the RedEye home page:

  • Click Devices
  • Click the device VSX A/V Receiver

The control pane should appears as shown above.

  1. The left column indicates: message number / number of distinct elements in this message
  2. The right column shows the list of messages.

When the number of received messages exceeds 90, the storage variable (HTMLbody) is cleared. See line 16 of the final script.
As shown in the screen shot, there are frequently multiple elements in any given message. This explains why control is unreliable when this fact is ignored.

 

RedEye #4: Connect to Pioneer VSX via IP

To proceed, you must have the following for the VSX:

  • IP address (192.168.0.121)
  • Port number (23)

Pioneer Receiver Network Settings
Reserving an IP address for a client on your local network

 

Add the VSX

wpid279-media_1356203660265.png
  1. Select the desired Manufacturer
  2. And Type
  3. Change the Port to Add New IP Port
  4. Enter your desired Display Name
  5. Click Find Codes

Select a Codeset

wpid280-media_1356203775074.png

At the time of this tutorial, there was just a single codeset for the VSX. It doesn’t quite match the VSX-1121-K, but the commands can be edited later as needed.
If you device doesn’t have a codeset, save the device without.

  1. Click the Codeset desired
  2. Click Save This Device

Port Settings

wpid281-media_1356203987459.png
  1. Click Edit Port Settings

IP Settings

wpid282-media_1356204060017.png
  1. Ensure the Protocol is set to TCP
  2. Enter the IP address as the Host Name
  3. Enter the Port Number
  4. Click OK

Test the IP Connection: Mute Toggle

wpid283-media_1356204573048.png

With your VSX reveiver turned on, test the IP control from RedEye.

  1. Click Mute On/OFF
  2. Click Save Changes

 

RedEye #3: AirPort Utility 5.x – Reserving an IP address for a client on your local network

Over time, a device’s Internet Protocol (IP) address can change unless you establish a reserved address within your router. With a reserved IP address, RedEye can maintain a reliable communications link with the device (client).

 

Log onto the AirPort Extreme

wpid221-media_1355849628476.png

Launch AirPort Utility 5.x.

  1. Select your router.
  2. Click Manual Setup

Navigate to the Internet options

wpid222-media_1355849768547.png

Click Internet.

View the current DHCP settings

wpid223-media_1355849856513.png

Click DHCP.

Add a new DHCP Reservation

wpid224-media_1355849937154.png

Click plus to add a DHCP Reservation.

Name your new device

wpid225-media_1355850624061.png
  1. Enter a Description.
  2. Ensure that MAC Address is selected
  3. Click Continue.

Reserve the IP address

wpid226-media_1355850655009.png
  1. Enter your client’s MAC Address.
  2. Enter your desired IPv4 Address.
  3. Click Done.

Update the AirPort Extreme

wpid227-media_1355850715027.png
  1. Your newly added IP client will be in the DHCP Reservations list.
  2. Click Update. The router will go off-line for a minute or so while it saves your changes.

Done!

wpid228-media_1355850813489.png

The router’s icon will disappear while being updated. Quit AirPort Utility.

 

RedEye #2: AirPort Utility 6.x – Reserving an IP address for a client on your local network

Over time, a device’s Internet Protocol (IP) address can change unless you establish a reserved address within your router. With a reserved IP address, RedEye can maintain a reliable communications link with the device (client).

Before you continue, determine your device’s MAC address. That may be as simple as reading it from a printed label on the outside of the device. In the case of a Pioneer VSX receiver, use the VSX remote to navigate to the it’s setup menu.

 

Log onto the AirPort Extreme

wpid233-media_1355852741468.png

Launch AirPort Utility 6.x.

  1. Click your router.
  2. Click Edit.

Navigate to the Network options

wpid234-media_1355852893911.png

Click Network.

Add a new DHCP Reservation

wpid235-media_1355853096189.png

Click plus to add a DHCP Reservation.

Reserve the IP address

wpid236-media_1355853572977.png
  1. Enter a Description.
  2. Ensure that MAC Address is selected
  3. Enter your client’s MAC Address.
  4. Enter your desired IPv4 Address.
  5. Click Save.

Update the AirPort Extreme

wpid237-media_1355853774411.png
  1. Your newly added IP client will be in the DHCP Reservations list.
  2. Click Update. The router will go off-line for a minute or so while it saves your changes.

 

RedEye #1: Pioneer Receiver Network Settings (VSX-1121-K)

For the VSX to be controlled externally via IP, you must turn on Network Standby and determine the port number and MAC address.

VSX Home Menu

wpid256-media_1355860257831.png
  1. Press RECEIVER.
  2. Press HOME MENU.

VSX System Setup

wpid257-P1020270.png

Down-arrow to 4. System Setup
Press ENTER

VSX Network Setup

wpid259-P1020271.png

Down-arrow to d. Network Setup
Press ENTER

VSX Network Standby

wpid260-P1020273.png

Down-arrow to 2. Network Standby
Press ENTER

Activate Network Standby

wpid262-P1020274.png

Use right-arrow to turn on Network Standby
Press RETURN

VSX Port Number Setting

wpid261-P1020273_1.png

Down-arrow to 5. Port Number Setting
Press ENTER

VSX Port Number Setting – Determine the Port Number

wpid263-P1020275.png

Use default port (23) or add your own. In either case, record the value. Port values can be from 1 to 65535.
Down-arrow to OK
Press ENTER
When asked to accept and save changes:
Arrow to Yes
Press ENTER
Wait a minute or so for changes to be set.
Press RETURN twice, to return to the HOME MENU screen.

VSX Network information

wpid258-P1020270_1.png

Down-arrow to 5. Network Information
Press ENTER

Get MAC Address

wpid264-P1020276.png

Record the MAC Address.
Press HOME MENU to exit.
You’re done!