Onkyo Media plugin

@Ned,
Ok, I’ll need a copy of your Log file to diagnose further. Please do the following things:

a) Enable Verbose logging through the UI
b) i[/i] this config
c) Try an action on one of the UI Buttons like On or Off
d) Login to Vera using SSH (http://wiki.micasaverde.com/index.php/Logon_Vera_SSH)
e) make a copy of the [tt]/var/log/LuaUPnP.log[/tt] file
f) Email that log file to me using an Email address that I will PM to you shortly.

Thanks for providing the logs. I’ve looked over them and, for some reason, your Receiver doesn’t appear to be responding to the commands being sent.

I can see Vera connecting to it (successfully), and the commands being sent to your device, but there’s nothing coming back from it.

Here’s a partial trace from mine where I’m initiating a Change in Volume (via the Dashboard widget). I tried this under UI4 (1.1.1337) and UI5 (1.5.346) and both give the same result. Basically you’ll see a line of command data sent (“ISCP…”) and then a character-by-character echo of it back (more or less).

In your Vera, we’re not getting the response back. The only thing I can think of is that the Amp doesn’t have the functionality fully enabled… but then I’d expect it to reject my connection requests.

Here’s the valid log sequence…

08 03/21/12 19:57:38.553 JobHandler_LuaUPnP::HandleActionRequest device: 62 service: urn:onkyo-com:serviceId:Receiver1 action: SetVolumeTarget <0x9c13> 08 03/21/12 19:57:38.554 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=62 <0x9c13> 08 03/21/12 19:57:38.555 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:onkyo-com:serviceId:Receiver1 <0x9c13> 08 03/21/12 19:57:38.556 JobHandler_LuaUPnP::HandleActionRequest argument action=SetVolumeTarget <0x9c13> 08 03/21/12 19:57:38.556 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=49 <0x9c13> 08 03/21/12 19:57:38.557 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.15393373612018846 <0x9c13> 06 03/21/12 19:57:38.665 Device_Variable::m_szValue_set device: 62 service: urn:onkyo-com:serviceId:Receiver1 variable: VolumeTarget was: 55 now: 49 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x9c13> 10 03/21/12 19:57:38.666 UserData::m_iDataVersion_Variables_incr VolumeTarget user data 383062002 variables 383062893 <0x9c13> 10 03/21/12 19:57:38.751 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 383062002 variables 383062893 <0x9c13> 25 03/21/12 19:57:38.753 luup_io_write 62 size: 24 <0x9c13> 51 03/21/12 19:57:38.755 0x49 0x53 0x43 0x50 0x0 0x0 0x0 0x10 0x0 0x0 0x0 0x8 0x1 0x0 0x0 0x0 0x21 0x31 0x4d 0x56 0x4c 0x33 0x31 0xd (ISCP############!1MVL31\r) <0x9c13> 25 03/21/12 19:57:38.756 luup_io_write 62 result: 1 <0x9c13> 50 03/21/12 19:57:38.758 luup_log:62: OnkyoReceiver: debug: ISCP request returned in 0ms <0x9c13> 10 03/21/12 19:57:38.760 luvd_get_info_data_request creating file buffer /data_request?id=lu_action&output_format=json&DeviceNum=62&serviceId=urn:onkyo-com:serviceId:Receiver1&action=SetVolumeTarget&newTargetValue=49&rand=0.15393373612018846 pMem 0x111e000/17948672 diff: 10309632 <0x9c13> 10 03/21/12 19:57:38.763 luvd_get_info_data_request done /data_request?id=lu_action&output_format=json&DeviceNum=62&serviceId=urn:onkyo-com:serviceId:Receiver1&action=SetVolumeTarget&newTargetValue=49&rand=0.15393373612018846 ret 0 size 47 pMem 0x111e000/17948672 diff: 10309632 took 0 info (nil) <0x9c13> 0x111e000/17948672 diff: 10309632 <0x9c13> 52 03/21/12 19:57:39.015 0x49 (I) <0x4409> 52 03/21/12 19:57:39.021 0x53 (S) <0x4409> 52 03/21/12 19:57:39.022 0x43 (C) <0x4409> 52 03/21/12 19:57:39.023 0x50 (P) <0x4409> 52 03/21/12 19:57:39.025 0x0 (#) <0x4409> 52 03/21/12 19:57:39.026 0x0 (#) <0x4409> 52 03/21/12 19:57:39.027 0x0 (#) <0x4409> 52 03/21/12 19:57:39.029 0x10 (#) <0x4409> 52 03/21/12 19:57:39.031 0x0 (#) <0x4409> 52 03/21/12 19:57:39.032 0x0 (#) <0x4409> 52 03/21/12 19:57:39.033 0x0 (#) <0x4409> 52 03/21/12 19:57:39.035 0xa (\n) <0x4409> 52 03/21/12 19:57:39.036 0x1 (#) <0x4409> 52 03/21/12 19:57:39.037 0x0 (#) <0x4409> 52 03/21/12 19:57:39.038 0x0 (#) <0x4409> 52 03/21/12 19:57:39.040 0x0 (#) <0x4409> 52 03/21/12 19:57:39.041 0x21 (!) <0x4409> 52 03/21/12 19:57:39.042 0x31 (1) <0x4409> 52 03/21/12 19:57:39.044 0x4d (M) <0x4409> 52 03/21/12 19:57:39.045 0x56 (V) <0x4409> 52 03/21/12 19:57:39.046 0x4c (L) <0x4409> 52 03/21/12 19:57:39.048 0x33 (3) <0x4409> 52 03/21/12 19:57:39.049 0x31 (1) <0x4409> 52 03/21/12 19:57:39.050 0x1a (#) <0x4409> 50 03/21/12 19:57:39.052 luup_log:62: OnkyoReceiver: debug: Received Full Buffer from Receiver via Ethernet MVL31 <0x4409> 50 03/21/12 19:57:39.053 luup_log:62: OnkyoReceiver: debug: Master Volume 31 <0x4409> 06 03/21/12 19:57:39.054 Device_Variable::m_szValue_set device: 62 service: urn:onkyo-com:serviceId:Receiver1 variable: Volume was: 58 now: 49 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x4409> 10 03/21/12 19:57:39.055 UserData::m_iDataVersion_Variables_incr Volume user data 383062002 variables 383062894 <0x4409>

@gussed

Thanks for taking the time to look at them. It is truly appreciated and really helps my state of mind. I thought I was going crazy because I did expect an error of some type. :o

Is it possible that there is something wrong with Vera or my settings? The reason I am asking is that I was trying to use uPnP to control a Samsung TV but I am having problems with that too. I checked the box to scan for devices and when it does see items (routers, PCs, TVs, etc.) the TV and Onkyo receiver that I want to control is in the list, but when I click add on either of them nothing happens. :frowning:

Sorry if I am hijacking the thread. I will take it somewhere else if needed, and please let me know if anyone sees any other avenues I could pursue.

Ned

@Ned,
If you can, get ahold of another control program that can operate the Onkyo (iPhone app maybe?) and see if you can control it with that. It’ll isolate which piece isn’t working. Technically you can do this with a terminal program if you know the right sequences to send.

Also, check for firmware updates for the box. I had to go through several to get mine functional, and it still has quirks. If you haven’t, then I’d pull the plug out of the back and fully power-cycle it (“just in case”)

You might want to check this while you’re at it:
http://www.cepro.com/article/onkyo_fixing_faulty_components_for_free/

Sorry it took me so long to reply, work was frantic and I have been trying everything under the sun to get this to work… even starting to learn Lup. I think it is knowing which XML tag to use when that is really throwing me for a loop, but I digress. I GOT IT WORKING! ;D

The issue is with my network configuration. Since Vera is sitting on my network and nothing is plugged directly into it. The best I can come up with is things were getting confused with two different NAT in the same subnet domain range. It was close when I was talking about turning off the firewall in Vera2 that causes it to perform as a hub, but in Vera3 what you need to do is disable the firewall and turn off DNS. As soon as I did this, the status was correct and the receiver responded to commands!

Any possibilities that the plugin can change sources? I’m new to programing but will look into copying similar function from the Denton plugin. Any pointers for a beginner?

Thanks to all for having this forum! Now to go push for TrickTV for my Samsung TV.
Ned

@Ned,
Glad to hear you got it sorted out in the long run.

If you want it on your TV, you might also consider nabbing a GoogleTV box (like a used Logitech Revue) and putting AutHomation on it. The developer for that application is @garrettwp, and is very active in developing/evolving the application.

It works well on the big screen, is very functional and is quite stable.

Thanks a lot for this plugin!
After 2 days of tests, I managed to make it work with the onkyo nr609.
The device seemed to have some problems with the network, I had to unplug the power several time until I could use the plugin on the vera lite. (And same problem with the onkyo for android app…)

Now that it’s working I adapted the plugin to activate the zone 2 from the vera. I have followed the advice you gave in the first page, created an additional D_ and I_ file for the zone 2. I created the device successfuly using thoses conf files. It has somehow erased the previous device
I suppose this is due to a name/ID conflict?

It’s working fine, but when I’m sending the command of power on and volume within the vera web page, I receive the following logs.

luup_log:25: OnkyoReceiver: debug: Received Full Buffer from Receiver via Ethernet ZPW00 <0x2e3b7680>
luup_log:25: OnkyoReceiver: debug: Unknown Command, Value ZPW,00 <0x2e3b7680>
Is it normal?

Thx again for this really cool plugin!
Next step, I’ll try to adapt the Json file to include more command (too bad we don’t have SQ remote on android…)

Typically you only have one [tt]I_xxxx.xml[/tt] file, and it has the [tt][/tt] element set to 1 in the parent device file ([tt]D_xxxxx.xml[/tt]).

So multiple implementation files should work, but I’ve run into a large number of issues trying to get these to work in practice (and some really odd/inconsistent behaviors)

Anyhow, with this setup, any “event” that happens in the Child UI will be processed by the Parent [tt]I_xxxxx.xml[/tt] file (see the Denon, Alarm Plugins etc for examples of this in action)

It's working fine, but when I'm sending the command of power on and volume within the vera web page, I receive the following logs.
The plugin sends commands as a "request-to-change", and uses the corresponding responses (from the Receiver) as an indication that "it's-actually-changed".

If you operate the Amp manually, you only get the latter parts, so it’ll update the Vera state, and the UI correctly.

In this case, you’re sending a new message that I’ve not handled before… mostly because I never did Zones. This is where you’d add a little extra code to update the relevant UI element (Child Device)

PS: The code is quite old now, and could probably do with a few jump tables instead of the big-old-if-ladder style I was using when I knocked this together.

Thanks for the further tips. I’ll have a look at the other plugins to see how it’s implemented. Though I don’t have a really good understanding of the structure/code at the moment, and not sure I really want to spend much time on it if I can make it work by just tweaking it :wink:
At the moment both devices are shown ok (Except for the volume of the zone2, guess I ran into one of the odd behaviour)

Ok, I did not understood that this response was used to update the UI, I’ll have a look next weekend to add this.

I recently picked up an Onkyo RC 360 that is network compatible. I’ve got it working with my nas devices using DLNA but for some reason I cannot get the Onkyo media plug-in to work… And I’m also having problems getting the Onkyo troller and other android apps for the Onkyo remote working. I can telnet to the device and it seems to answer on the port yet no luck with the plug-in or other apps. I can also go to the receiver on the static IP I set and get to the webpage on the receiver - although that’s a port 80 page inside the device.

Anyway any ideas? somewhere I read that a factory reset may clear this up… Any help would be great guys

Thanks again

@myhomeserver,
Typically when that happens, there are network topology issues at play. These will need to be sorted out before the Plugin itself will work.

A few questions though:
a) What Vera hardware and Firmware versions
b) What Network port do you use to connect up the Vera to your Network (WAN or LAN)
c) Is there anything in common between the [logical] network path that your Android devices use, and the path Vera would be using
d) Can you telnet to the Onkyo from Vera itself, or are you using another box when you run your test

BTW, @sirde above seemed to have similar(ish) problems…

Hi Guessed, went out and bought an onkyo today based on the plugin already existing, have had lots of issues trying to get the network element working and seems to be working for now but my router is more open than i would like. I bought a NR509 so obviously not all the inputs of some but i have tried a few of the inputs on the advanced tab but nothing seems to be responding. the volume works as does turning the device off, on doesnt seem to be working but only tried a couple of times.

Cheers
Stu

EDIT- ok so i found the latest files and am making some progress with this now. now i just need a good squezebox and XBMC plugin.

just a bit of feedback, i have been struggling most of the day trying to get vera to change to BD/DVD as I thought the trick would be sending “input10” as according to the standard ONKYO CMDS.

I have just realised that actually this is what im sending and is the reason i am getting port, I thought that maybe my ONKYO had different numbers so have been trying every number as thought this was directly flowing through but obviously its not,

urn:micasaverde-com:serviceId:InputSelection1
Input10

– Main picture Input Select - UNIVERSAL PORT sendCommand(“SLI40”)

any reason why you didnt just match up the onkyo commands?
The input number 10 is the correct number. Here’s the list:

“00” sets VIDEO1 VCR/DVR STB/DVR
“01” sets VIDEO2 CBL/SAT
“02” sets VIDEO3 GAME/TV GAME GAME1
“03” sets VIDEO4 AUX1(AUX)
“04” sets VIDEO5 AUX2 GAME2
“05” sets VIDEO6 PC
“06” sets VIDEO7
“07” Hidden1 EXTRA1
“08” Hidden2 EXTRA2
“09” Hidden3 EXTRA3
“10” sets DVD BD/DVD
“20” sets TAPE(1) TV/TAPE
“21” sets TAPE2
“22” sets PHONO
“23” sets CD TV/CD
“24” sets FM
“25” sets AM
“26” sets TUNER
“27” sets MUSIC SERVER P4S DLNA2
“28” sets INTERNET RADIO iRadio Favorite
3
“29” sets USB/USB(Front)
“2A” sets USB(Rear)
“2B” sets NETWORK NET
“2C” sets USB(toggle)
“40” sets Universal PORT
“30” sets MULTI CH
“31” sets XM1
“32” sets SIRIUS
1
“UP” sets Selector Position Wrap-Around Up
“DOWN” sets Selector Position Wrap-Around Down
“QSTN” gets The Selector Position

also as this may help others, here are a few of my LUA fragments

– volume control
luup.call_action(“urn:onkyo-com:serviceId:Receiver1”, “SetVolumeTarget”, {newTargetValue = “20”}, 77)

– power off
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “0”}, 77)

– power on
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = "1 "}, 77)

– SET TO TIVO (CBL/SAT)
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input2”,{}, 77)

– SET TO SQUEEZEBOX (AUX)
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input4”,{}, 77)

–PORT
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input10”,{}, 77)

– Game
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input3”,{}, 77)

– NET
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input8”,{}, 77)
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input9”,{}, 77)

– BD/DVD
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“DiscreteinputDVD”,{}, 77)

[quote=“trouty00, post:54, topic:168197”]any reason why you didnt just match up the onkyo commands?
The input number 10 is the correct number. Here’s the list:[/quote]
In general, the [tt]ACTION[/tt] names that are used are defined by a standardized/fixed list from MCV. This list is defined in [tt]S_InputSelection1.xml[/tt], and can’t be changed.

As a result of this fixed list, each implementor needs to “map” the commands from their AV Gear over to this standardized list. In many cases there’s going to be an impedance mismatch in either the name(s) of, or in the number(s) of, inputs permitted.

When I did this I chose something that was near-enough, and probably should have documented exactly what the mapping was. At the time my primary agenda was on getting On/Off functionality, then Volume control, then everything else came last.

If I were to do it again, I believe these interfaces need to be made more generic, and I’d push MCV to change them. Instead of parameter-less ACTIONS, they should be more generic in nature (like the Alarm Panel ones) where you’d pass in strings.

Then you could create a 100% mapping to the inputs of the specific AV device in question. For some time now, the MCV team have indicated they’re re-doing some of this work, so I’ve not put effort into revising this. It would be worthwhile waiting to see what they do before any large overhauls are performed.

How do you control Zone2.
I basically thought I could take the original files D_OnkyoReceiver1 etc. and change them the D_OnkyoReceiver2 etc.
in the files i replaced all instances of Receiver1 to Receiver2 and changed PWR to ZPW and MVL to ZVL uploaded them, but i’m getting no where.
Also how do i add more functionality to the GUI control, IE more than just power and volume…

Onkyo TX-NR 1010 control over TCPIP
Vera 3 1.5.408

The existing plugin would need a few code mods:

a) Create a child device for each Zone
b) Add code within the INCOMING sections to “handle” the Zone2…n events coming in
c) Add ACTION sections to handle any Zone-specific commands
d) Make some of the ACTION Blocks “aware” of Zones 2…n (eg. SetVolumeTarget, Volume Up/Down & Mute, etc)

This would all be done within the existing files. The lads that built the Denon plugin went on to do those things, but I never needed them so they weren’t added to the Onkyo.

If you look at the Denon, you should be able to see how it was done there and replicate that logic.

From the UI, the Dashboard is minimalist since there’s almost no room on the UI for anything else. You can build more advanced Dialogs, and I think they Denon lads did that also, but I ever use Vera’s UI since it’s too primitive.

I’m using SQRemote to do any real interaction with the IR/AV components.

On the incoming block would i just copy the existing code in the and just replace the main unite (PWR etc) references with ZPW etc. If you could check here Onkyo zone2 - Pastebin.com and let me know if I’m right.

You don’t need to clone the entire incoming code section. Instead, you just add more [tt]elseif[/tt] sections to the existing if-elseif ladder.

                    -- Existing code handling Zone 1...
                    ...
                    elseif (cmd == "SLI") then
                        debug("Master Input " .. (value or "Not Available"))
 
                        luup.variable_set("urn:onkyo-com:serviceId:Receiver1", "Input", value, lul_device)
                    -- New code to handle Zone 2...
                    elseif (cmd == "ZPW") then
                        if (value == "01") then
                            luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", "1", lul_device)
                        elseif (value == "00") then
                            luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", "0", lul_device)
                        else
                            debug("Power " .. (value or "Not Available"))
                        end
                    elseif (cmd == "ZVL") then
                        debug("Master Volume " .. (value or "Not Available"))
 
                        -- Convert to Decimal, range 0..100
                        value = tonumber(value, 16)
                        luup.variable_set("urn:onkyo-com:serviceId:Receiver1", "Volume", value, lul_device)
                    elseif (cmd == "SLZ") then
                        debug("Master Input " .. (value or "Not Available"))
 
                        luup.variable_set("urn:onkyo-com:serviceId:Receiver1", "Input", value, lul_device)
                    else
                        debug("Unknown Command, Value " .. cmd .. "," .. (value or "Not Available"))
                    end