Batch details

Repository: ir, Batch ID: -92

Batch header

Batch IDIP AddressDateComments
-9270.128.47.2092011-06-19 03:57:18TRAC Ticket #1119 - IMON Ultrabay (Pad and Panel)

Batch details

PKTablenameNewDeletedModifiedbathdr_origbathdr_authbathdr_unauth
866InfraredGroup1004680-92
867InfraredGroup_Command89004680-92

Batch contents

Table InfraredGroup

select * from InfraredGroup where psc_batch=-92

Table history InfraredGroup

select * from InfraredGroup_pschist where psc_batch=-92
PK_InfraredGroupFK_DeviceCategoryFK_ManufacturerDescriptionFK_CommMethodpsc_idpsc_batchpsc_userpsc_frozenpsc_modpsc_tocpsc_restrict
103133Kenwood Sovereign RS232 protocol26104-92391762011-06-19 03:57:180

Table InfraredGroup_Command

select * from InfraredGroup_Command where psc_batch=-92

Table history InfraredGroup_Command

select * from InfraredGroup_Command_pschist where psc_batch=-92
PK_InfraredGroup_CommandFK_InfraredGroupFK_CommandFK_DeviceTemplateIRDataOriginalKeypsc_idpsc_batchpsc_userpsc_frozenpsc_modpsc_tocpsc_restrict
6056373def SendUserCommand(command) log("Sending Command Prefix and Command ID to STB.") conn_.Send("\xFA\xA5") reply = conn_.Recv(1,65) if( !reply.nil? && reply[0] = "\xF0") log("STB reply: Command Acknowledged.") # Got Command Acknowledge from STB log("Sending Command '" + command[0].to_s + "' to STB") conn_.Send("\x00\x01" + command) conn_.Recv(1,64) # if \xF2 then STB received correct number of parameters log("STB reply: Received the correct number of parameters.") conn_.Recv(1,64) # if \xF4 then command completed successfully log("STB reply: Service command completed successfully.") else return end end def log(word) logTime = Time.now timeStr = logTime.strftime("%d-%m-%Y %H:%M:%S ") $logFile.print( timeStr + word + "\n" ) $logFile.flush() print(word + "\n") end169404-92391762011-06-19 03:57:190
6056351169405-92391762011-06-19 03:57:200
6056350169406-92391762011-06-19 03:57:200
6056355# DirecTV STB initialization $logFile = File.new("/var/log/pluto/DirecTV_STB.log", "w") for iRetry in 0...4 log("Initializing DirecTV STB...") # send GetCurrentChannel (0x87) command to STB conn_.Send("\xFA") conn_.Send("\x87") buf = conn_.Recv(1,64) if( !buf.nil? && !buf.index("\xF0").nil? ) log("Command Acknowledge from STB.") # STB sending current channel information buf = conn_.Recv(10,1000) if ( !buf.nil? ) cur_channel = (buf[0].to_s(16).hex) * 256 + buf[1].to_s(16).hex log("Current Channel on STB: " + cur_channel.to_s ) log("Initialized ok.\n") return end else log("Failed to initialize. Wait 1 secs and try again.\n") sleep(1) end end #DisableDevice( device_.devid_, true ) log("The device wouldn't respond. Disabling it.\n")169407-92391762011-06-19 03:57:210
6056384169408-92391762011-06-19 03:57:220
6056356169409-92391762011-06-19 03:57:220
6056240SendUserCommand("\xA4")169410-92391762011-06-19 03:57:230
6056225169411-92391762011-06-19 03:57:230
6056190SendUserCommand("\xA0")169412-92391762011-06-19 03:57:240
605686SendUserCommand("\xF7")169413-92391762011-06-19 03:57:240
6056201SendUserCommand("\x9D")169414-92391762011-06-19 03:57:250
6056202SendUserCommand("\x9B")169415-92391762011-06-19 03:57:250
6056203SendUserCommand("\x9A")169416-92391762011-06-19 03:57:260
6056200SendUserCommand("\x9C")169417-92391762011-06-19 03:57:260
6056192SendUserCommand("\xC5")169418-92391762011-06-19 03:57:270
6056193SendUserCommand("\xD0")169419-92391762011-06-19 03:57:270
6056364SendUserCommand("\xA5")169420-92391762011-06-19 03:57:280
6056204SendUserCommand("\xE0")169421-92391762011-06-19 03:57:280
6056205SendUserCommand("\xE1")169422-92391762011-06-19 03:57:290
6056206SendUserCommand("\xE2")169423-92391762011-06-19 03:57:290
6056207SendUserCommand("\xE3")169424-92391762011-06-19 03:57:300
6056208SendUserCommand("\xE4")169425-92391762011-06-19 03:57:300
6056209SendUserCommand("\xE5")169426-92391762011-06-19 03:57:310
6056210SendUserCommand("\xE6")169427-92391762011-06-19 03:57:310
6056211SendUserCommand("\xE7")169428-92391762011-06-19 03:57:320
6056212SendUserCommand("\xE8")169429-92391762011-06-19 03:57:320
6056213SendUserCommand("\xE9")169430-92391762011-06-19 03:57:330
6056763SendUserCommand("\xD4")169431-92391762011-06-19 03:57:330
6056126SendUserCommand("\xD3")169432-92391762011-06-19 03:57:340
6056123SendUserCommand("\xA1")169433-92391762011-06-19 03:57:340
6056528SendUserCommand("\xB6")169434-92391762011-06-19 03:57:350
60561099SendUserCommand("0xA2")169435-92391762011-06-19 03:57:350
6056455SendUserCommand("\xED")169436-92391762011-06-19 03:57:360
6056518SendUserCommand("\xEC")169437-92391762011-06-19 03:57:360
60561100SendUserCommand("0xA3")169438-92391762011-06-19 03:57:370
6056682SendUserCommand("\xEB")169439-92391762011-06-19 03:57:370
6056605SendUserCommand("\xEA")169440-92391762011-06-19 03:57:380
6056965SendUserCommand("\xD2")169441-92391762011-06-19 03:57:380
6056964SendUserCommand("\xD1")169442-92391762011-06-19 03:57:390
6056136SendUserCommand("\xD6")169443-92391762011-06-19 03:57:390
6056512SendUserCommand("\xF8")169444-92391762011-06-19 03:57:400
6056954SendUserCommand("\xC3")169445-92391762011-06-19 03:57:410
192169446-92391762011-06-19 03:57:410
193169447-92391762011-06-19 03:57:420
6097192# Power On SendCmd("PWR1") 169448-92391762011-06-19 03:57:420
6097193SendCmd("PWR0")169449-92391762011-06-19 03:57:430
6097373# Private - Date: 2011-01-17 def SendCmd(command) log("Sending Command code '" + command.strip + "' to the Receiver.") conn_.Send("\x01" + command + "\x02\x0D\x0D\x0A") reply = conn_.RecvDelimited("\x04", 2000) if ( !reply.nil? && reply.length() > 4 ) return reply else log("****ERROR**** : No reply from Receiver") return nil end end def log(word) logTime = Time.now timeStr = logTime.strftime("%d-%m-%Y %H:%M:%S -- ") $logFile.print( timeStr + word + "\n") $logFile.flush() print(word + "\n") end def GetRadioStations() # would like to implement reading from a table in pluto_media that # is populated from a screen in web admin... that queries a website for # local radio stations based on latitude & longitude or zip code. # for now.. populate an array manually $stations[0] = ["KARN", "FM", 102.9, "Sheridan, AR", "News/Talk"] $stations[1] = ["KKPT", "FM", 94.1, "Little Rock, AR", "Classic Rock"] $stations[2] = ["KHKN", "FM", 94.9, "Maumelle, AR", "Adult Hits"] $stations[3] = ["KOLL", "FM", 106.7, "Lonoke, AR", "Oldied"] $stations[4] = ["KARN", "AM", 920, "Little Rock, AR", "Sports"] $stations[5] = ["KAAY", "AM", 1090, "Little Rock, AR", "Religious"] end #def GetRadioStations() # begin # db_stations = Mysql.real_connect(\\\"dcerouter\\\", \\\"root\\\", \\\"\\\", \\\"pluto_media\\\") # log(\\\"Server version: \\\" + db_stations.get_server_info) # rescue Mysql::Error => e # log(\\\"Error code: #[e.errno]\\\") # ensure # db_stations.close if db_stations # end #end169450-92391762011-06-19 03:57:430
6097351169451-92391762011-06-19 03:57:440
6097350buf = conn_.RecvDelimited("\x04", 64) if !(buf.empty?) msg = buf.strip case msg[1,3] when "PWR" log("Receiver sent PWR Status - " + msg) when "INP" # INPUT log("Receiver sent INPUTS Status - " + msg) when "MUT" # MUTE log("Receiver sent MUTE Status - " + msg) when "VOL" $Current_Volume = msg[4,2].hex log("Receiver Volume is " + $Current_Volume.to_s + " (" + ($Current_Volume - 83).to_s + "dB).") when "SEL" log("Receiver sent SEL Status - " + msg) when "FRE" # FREQ log("Receiver sent FREQ Status - " + msg) when "LST" # LSTN log("Receiver sent LSTN Status - " + msg) else log("Receiver sent '" + msg + "' Status") end end169452-92391762011-06-19 03:57:440
6097355# Kenwood VR5x00 Receiver initialization $logFile = File.new("/var/log/pluto/VR5x00.log", "w") @cmd = Command.new(device_.devid_, device_.devid_, 1, 2, 158) for iRetry in 0...4 log("Initializing unit, Try " + (iRetry + 1).to_s + " of 4") conn_.Send("\x01PWR?\x02\x0D\x0D\x0A") buf = conn_.RecvDelimited("\x04", 2000) if( !buf.empty? && !buf.index("PWR").nil? ) log("Receiver Power State is " + buf.strip) conn_.Send("\x01VOL?\x02\x0D\x0D\x0A") receiver_vol = conn_.RecvDelimited("\x04", 2000) log("Receiver Volume Level is " + receiver_vol + ".") $Current_Volume = receiver_vol[4,2].hex log("Receiver Volume is " + $Current_Volume.to_s + " (" + ($Current_Volume - 83).to_s + "dB).") @cmd.params_[30] = $Current_Volume.to_s SendCommand(@cmd) log("Initialized ok.\n") return end log("Failed to initialize. Wait 1 secs and try again.\n") sleep(1) end DisableDevice( device_.devid_, true ) log("The device wouldn't respond. Disabling it.\n")169453-92391762011-06-19 03:57:450
6097384169454-92391762011-06-19 03:57:450
6097356169455-92391762011-06-19 03:57:460
6097316SendCmd("SEL0A")169456-92391762011-06-19 03:57:460
6097162SendCmd("SEL02")169457-92391762011-06-19 03:57:470
6097420SendCmd("SEL04")169458-92391762011-06-19 03:57:470
6097165SendCmd("SEL05")169459-92391762011-06-19 03:57:480
6097163SendCmd("SEL00")169460-92391762011-06-19 03:57:480
6097873SendCmd("SEL01")169461-92391762011-06-19 03:57:490
6097160SendCmd("SEL03")169462-92391762011-06-19 03:57:490
6097155SendCmd("SEL05")169463-92391762011-06-19 03:57:500
6097156SendCmd("SEL06")169464-92391762011-06-19 03:57:500
6097157SendCmd("SEL07")169465-92391762011-06-19 03:57:510
60971098SendCmd("LSTN05")169466-92391762011-06-19 03:57:510
6097148SendCmd("LSTN08")169467-92391762011-06-19 03:57:520
60971102SendCmd("LSTN0A")169468-92391762011-06-19 03:57:520
6097292SendCmd("LSTN02")169469-92391762011-06-19 03:57:530
6097149SendCmd("LSTN07")169470-92391762011-06-19 03:57:530
60971097SendCmd("LSTN11")169471-92391762011-06-19 03:57:540
60971007SendCmd("LSTN0F")169472-92391762011-06-19 03:57:540
60971008SendCmd("LSTN10")169473-92391762011-06-19 03:57:550
60971006SendCmd("LSTN01")169474-92391762011-06-19 03:57:560
60971000SendCmd("LSTN0D")169475-92391762011-06-19 03:57:570
60971002SendCmd("LSTN0E")169476-92391762011-06-19 03:57:570
6097312SendCmd("LSTN06")169477-92391762011-06-19 03:57:580
60971099SendCmd("LSTN0B")169478-92391762011-06-19 03:57:580
6097311SendCmd("LSTN00")169479-92391762011-06-19 03:57:590
60971101SendCmd("LSTN09")169480-92391762011-06-19 03:57:590
60971100SendCmd("LSTN0C")169481-92391762011-06-19 03:58:000
609797# Mute mute_state = SendCmd("MUTE?") case mute_state[5] when 48 SendCmd("MUTE1") log("Mute is On.") when 49 SendCmd("MUTE0") log("Mute is OFF.") else log("Did not receive proper response for MUTE change command") end169482-92391762011-06-19 03:58:000
609790# Volume Down if $Current_Volume > 0 $Current_Volume -= 1 newvol = ("VOL" + "%02x" % $Current_Volume.to_s).upcase log("Requesting decrease of VOLUME to: " + ($Current_Volume - 83).to_s + "dB.") log("Receiver confirms VOLUME at " + (SendCmd(newvol).strip[4,2].hex - 83).to_s + "dB.") else log("Volume at Minimum!") end169483-92391762011-06-19 03:58:010
609789# Volume Up if $Current_Volume < 96 #(maximum for receiver, this is +13db) $Current_Volume += 1 newvol = ("VOL" + "%02x" % $Current_Volume.to_s).upcase log("Requesting increase of VOLUME to: " + ($Current_Volume - 83).to_s + "dB.") log("Receiver confirms VOLUME at " + (SendCmd(newvol).strip[4,2].hex -83).to_s + "dB.") else log("Volume at Maximum!") end169484-92391762011-06-19 03:58:010
60971103SendCmd("INPUTM3")169485-92391762011-06-19 03:58:020
60971104SendCmd("INPUTM2")169486-92391762011-06-19 03:58:020
60971105SendCmd("INPUTM1")169487-92391762011-06-19 03:58:030
60971096SendCmd("INPUTM0")169488-92391762011-06-19 03:58:030
6097296SendCmd("LSTN03")169489-92391762011-06-19 03:58:040
6097297SendCmd("LSTN14")169490-92391762011-06-19 03:58:040
6071192169491-92391762011-06-19 03:58:050
6071193169492-92391762011-06-19 03:58:050