[AppleTV2] Logitech Harmony support for ATV2?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #76
Line 131-136 of your xbmc.log shows that XBMC found your custom xml. However, it had trouble loading it.

Sounds like a file permissions issue.

When you issue the chmod and chown, make sure to be logged in as root. As the root user, you have power to change permissions (chmod) and ownership(chown) of the files.

I would start with using a terminal. (Windows users can download and use the putty.exe)

ssh root@ip_of_atv2_here
enter alpine as the password

then the following commands:

Code:
chmod -R 755 /var/mobile/Library/Preferences/XBMC

chown -R mobile:mobile /var/mobile/Library/Preferences/XBMC
The first line resets the permissions to what it should be.

The second line gives the mobile user ownership.

The reason is because all apps launched by the ATV2 runs as the mobile users. So if the permission/ownership isn't set properly. XBMC will not be able to make changes to the user directory or read things from it. The result is weird errors and issue occurs.
find quote
seth.feinberg Offline
Donor
Posts: 231
Joined: May 2011
Reputation: 2
Post: #77
dazex Wrote:Line 131-136 of your xbmc.log shows that XBMC found your custom xml. However, it had trouble loading it.

Sounds like a file permissions issue.

When you issue the chmod and chown, make sure to be logged in as root. As the root user, you have power to change permissions (chmod) and ownership(chown) of the files.

I would start with using a terminal. (Windows users can download and use the putty.exe)

ssh root@ip_of_atv2_here
enter alpine as the password

then the following commands:

Code:
chmod -R 755 /var/mobile/Library/Preferences/XBMC

chown -R mobile:mobile /var/mobile/Library/Preferences/XBMC
The first line resets the permissions to what it should be.

The second line gives the mobile user ownership.

The reason is because all apps launched by the ATV2 runs as the mobile users. So if the permission/ownership isn't set properly. XBMC will not be able to make changes to the user directory or read things from it. The result is weird errors and issue occurs.

Thanks so much for the info @dazex, I'm at work but I'll try it the minute I get home and post the results.

On a somewhat unrelated rant: damn permissions are the bane of my existence! That was the issue when I had an issue with ember media manager as well. I could change things but after applying the old nfo's/fanart.jpg's would still be there. AND I'm getting CP Server Thread-4 :: Failed to set permission for /volume1/Video/TV Shows/<TV Show>.mkv to 666 in Sickbeard (even though it seems to work fine). I know this isn't the place to ask/talk about that, and I'm really not, just venting. But do you by any chance know a good resource for me to learn more about this issue that keeps biting me in the a$$. I'm assuming the commands are different for Linux and its probably not advisable to reapply the chmod -R 755 or 777 to my NAS and I'm further assuming these permissions issues happened when I moved my files from my HTPC to my Synology. Anyways, feel free to ignore this section, just had to get it off my chestSmile
find quote
n1ng Offline
Junior Member
Posts: 3
Joined: Sep 2011
Reputation: 0
Post: #78
dazex Wrote:@n1ng,
There's a couple of buttons that are in conflict if you have the BTStack installed. Specifically, the SMFramework. The conflict was resolved at one time, but newer versions of the SMFramework brought the conflict back.

I forget the two buttons, but fastforward was one of them. If you have SMFramework installed, (it installs as a part of BTStack), then XBMC will crash to LowTide when pressed.

That makes sense, and here I thought I was on to something Rolleyes I did have the BTStack installed previously. Uninstalled it, but I did read that would not necessarily fix it - and it didn't. Guess starting from scratch fixed it Frown

Could one simply remove the SMFramework without any adverse effect assuming that the BTStack is not being used?
find quote
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #79
n1ng: Yes, I have found that installing BTStack will install the required SMFramework. However, uninstalling BTStack left the SMFramework behind. If you uninstall SMFramework, the reboot problem goes away.

I forget the exact command to list all the installed packages. dpkg -l
find quote
seth.feinberg Offline
Donor
Posts: 231
Joined: May 2011
Reputation: 2
Post: #80
dazex Wrote:Line 131-136 of your xbmc.log shows that XBMC found your custom xml. However, it had trouble loading it.

Sounds like a file permissions issue.

When you issue the chmod and chown, make sure to be logged in as root. As the root user, you have power to change permissions (chmod) and ownership(chown) of the files.

I would start with using a terminal. (Windows users can download and use the putty.exe)

ssh root@ip_of_atv2_here
enter alpine as the password

then the following commands:

Code:
chmod -R 755 /var/mobile/Library/Preferences/XBMC

chown -R mobile:mobile /var/mobile/Library/Preferences/XBMC
The first line resets the permissions to what it should be.

The second line gives the mobile user ownership.

The reason is because all apps launched by the ATV2 runs as the mobile users. So if the permission/ownership isn't set properly. XBMC will not be able to make changes to the user directory or read things from it. The result is weird errors and issue occurs.

SUCCESS!! It took a couple of tries and for some reason the custom keymap in my userdata directory reverted back to the stock state, but all is working wonderfully now. @dazex, I cannot thank you enough. You sir, are the man.
find quote
akevit Offline
Donor
Posts: 126
Joined: May 2011
Reputation: 2
Location: Seattle
Post: #81
dazex Wrote:Not if you understand that XBMC runs as the user mobile. And you reset your user directories' ownership when you make any changes to it. Else, you'll encounter varying issues depending on which file you have touch.

Run the following command as root to reset the directory back to default.

Code:
chown -R mobile:mobile /var/mobile/Library/Preferences/XBMC/

I had posted best practice guide on how to sFTP into your ATV2 by creating two separate bookmarks, depending on which directory you are gonna modify if you want to look for that post.

I've been looking around for this guide, do you have any links to it? I've been using root for everything on my ATV2 and haven't noticed any issues, this is the first time I've seen someone mention I need to be doing things using the mobile account, I didn't even realize there was another account.

Why not add to the ATV2 wiki that after jailbreaking and installing XBMC they should install sudo and setup the mobile user with sudo privileges requiring a password and from hereon to use the mobile account whenever messing around with XBMC.

ATV2 running XBMC Eden (Skin: Quartz3)
Windows 7 running XBMC Eden (custom setup as I'm basically running it as a service)
MySQL installed on Windows 7 for sharing libraries
iOS Specific FAQ | Alternative ATV2 keymap | Default ATV2 keymap
Post log files to Pastebin

[Image: 1721571156.png]
(This post was last modified: 2012-01-16 20:24 by akevit.)
find quote
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #82
Not sure what I wrote, or where I wrote it. But perhaps this will get you on the right path:


(2011-02-28 19:28)dazex Wrote:  You can log in as user: mobile pass: alpine

Best practice to keep permissions proper is to create two bookmarks for your SFTP program.

I create one to log in as root if I need to manipulate anything in the actual XBMC installed directory: /Applications/XBMC.frappliance

For that SFTP bookmark, you can make the remote path go directly to /Applications/XBMC.frappliance/ to save the trouble of navigating there yourself.

For the second bookmark, for when I need to upload anything to the userdata directory. i.e. joystick.AppleRemote.xml, advancedsettings.xml, plugin zips, etc...

I create a bookmark with user of mobile and set the default remote path to be: /private/var/mobile/Library/Preferences/XBMC/userdata/

That way the files are correctly uploaded with the proper ownership.

In the world of linux/unix/etc....permissions and ownership is very important. So best to keep all that proper or at least be aware of them whenever one is modding any file. Or else, you can run into strange issues.
find quote
cf125 Offline
Member
Posts: 78
Joined: May 2011
Reputation: 0
Post: #83
will thee ever nbe support so if i press the number "2" button 3 times it goes to the "c" section of my movie collection
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,257
Joined: Jan 2011
Reputation: 220
Location: Arizona, USA
Post: #84
Certainly possible, but it would require someone to hack/modify the IR receiver's drivers. That would be a major endeavor, if I understand correctly.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
cf125 Offline
Member
Posts: 78
Joined: May 2011
Reputation: 0
Post: #85
(2012-04-17 19:37)Ned Scott Wrote:  Certainly possible, but it would require someone to hack/modify the IR receiver's drivers. That would be a major endeavor, if I understand correctly.

well just out of interest how many people here would like this option i know for my collection would make it a whole lot easier to navigate and most other media centers have this option
find quote
aaronb Offline
Senior Member
Posts: 169
Joined: Apr 2007
Reputation: 0
Location: Colorado
Post: #86
(2012-04-17 19:56)cf125 Wrote:  well just out of interest how many people here would like this option i know for my collection would make it a whole lot easier to navigate and most other media centers have this option

This is a limitation of the ATV2 hardware and not XBMC
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,257
Joined: Jan 2011
Reputation: 220
Location: Arizona, USA
Post: #87
(2012-04-19 04:27)aaronb Wrote:  
(2012-04-17 19:56)cf125 Wrote:  well just out of interest how many people here would like this option i know for my collection would make it a whole lot easier to navigate and most other media centers have this option

This is a limitation of the ATV2 hardware and not XBMC

Doubtful that it is an actual hardware limitation, as the ATV2 can learn just about any remote signal, and the number of signals is just based on how many commands the native ATV software uses. It's just that the only people who know how to increase that number and map it in some way is Apple. Everyone else is guessing in the dark.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
(This post was last modified: 2012-04-20 04:17 by Ned Scott.)
find quote
ctawn Offline
Senior Member
Posts: 260
Joined: May 2009
Reputation: 0
Post: #88
I moved from XBMC on a Mac to XBMC on an ATV2 just recently and wanted to share a few things I've learned, mostly a summary of what's in this thread or elsewhere.

First, unlike on a Mac, there is only a small set of buttons that the ATV2 can recognize and there's no way around this. This set has already been defined by Logitech in the Harmony Remote app under the "Apple TV" device, under Media Center PC -> Apple -> Apple TV. These are:

[Image: harmonyavailablebuttons.png]

Second, most of these buttons are reasonably well defined by the default keymap in current builds of XBMC Eden. So basically if you add the Apple TV device in Harmony and make an activity (of type "Watch TV" which you would rename "Watch Apple TV"), there's not a lot you need to do further.

Now there are a few quirks and caveats that confused me for some time:

• In the default "Apple TV" device configuration, the hard "Skip Back" button is mapped to the device "SkipBackward" button while the hard "Skip Forward" button is mapped to the device "NextChapter" button. But it turns out that it doesn't matter because each set of SkipBack/PreviousChapter and SkipForward/NextChapter buttons send out the same button ID code: 21 for SkipBackward & PreviousChapter and 20 for SkipForward & NextChapter. And these are now mapped correctly in the XBMC default keymap, whereas in previous builds they had been erroneously reversed.

• What really made me dig into this was the glaring lack of any way to access either the "Info" or the "context menu" buttons in XBMC. So I was tempted to map those skip fw/back hard buttons onto those, and still may later. But I discovered that both each be accessed with long presses of the Select Button (for "Info") and the Menu Button (for "context Menu"). I don't see this point made obvious in any FAQ I've seen, and it's really key.

• It's apparently not possible to define a button in Harmony software as a long press button, so that hard buttons could be directly mapped without the need for a long press. Not possible even by learning Raw remote codes. (I tried.) I've read in forums that Harmony support could do this, but if you're out of your original 90 day support window, they won't do this without a charge. Perhaps someone who has recently bought a Harmony One and is reading this could get them to do that. (If you do, post here!)

• The only viable option for Info and Context Menu (or any other function you might need either a hard or a soft button for), in my view, other than the skip buttons, would be to give up the Page Up/Page Down buttons. But these are needed for browsing a library.

• If you did want to remap one or more of those buttons to other functions, you would need to edit a copy of the default keymap ("joystick.AppleRemote.xml") file and put the edited version in your userdata folder. There are FAQs etc on how to do that, I just mention it here for completeness.

• There are 3 additional buttons that's not included in the default activity for Apple TV but is included in the default device. These are: Video Mode, Pair, and Unpair. I chose to map Video Mode to a soft button, in the hopes XBMC would recognize it (by looking and /var/log/syslog). However it doesn't. It is intercepted by Apple TV and does go to a video mode (resolution configuration screen). So might be handy to have as a soft button but it's not useful for XBMC. I did not experiment with Pair and Unpair but I expect similar results.

• The Play/Pause hard button on the factory remote is handled somewhat strangely (both by Harmony and by XBMC). Play and Pause are mapped separately. This seems to work in XBMC as expected. But I found that it in aTV Black's Last FM application, neither play or pause works (as mapped). Select seems to serve the function instead. Strange. I don't yet know what other issues this might cause. (Be interested in comments on that.)

So in the end, I made only a few minor modifications to the default watch Apple TV activity, and did not edit the default XBMC keymap:

• mapped the hard "Exit" button (in addition to the menu button) to "Menu"
• mapped the hard "Info" button (in addition to the select button) to "Select" (though it requires a long press still)
• added the "Video Mode" button as a soft button
• changed the map of the "Skip Forward" hard button from "PreviousChapter" to "SkipForward", just for consistency's sake. (As noted above it makes no difference).

Hope that helps.
(This post was last modified: 2012-04-20 22:48 by ctawn.)
find quote
Cantello Offline
Junior Member
Posts: 16
Joined: May 2004
Reputation: 0
Post: #89
(2012-04-20 22:43)ctawn Wrote:  Hope that helps.

It actually did quite a lot! :-)
I was coming from XBMC on a Mac Mini with a perfectly working remote configuration and was wondering how to get this to work on the atv.

I used your suggestions and it already got better, the lack of an info button, however, is still annyoing me. How do you get the OSD to display in an easy way? And do your buttons also not repeat at all (meaning lots of clicks on my Harmony for scrolling up and down if you don't remember to use the dedicated up/down buttons)?
find quote
joazito Offline
Junior Member
Posts: 34
Joined: Oct 2009
Reputation: 0
Post: #90
There is one thing that really makes me a decent amount of time everyday, the way I don't have a button to jump directly to the home screen (e.g. from browsing a video folder). How would one go about adding that?
find quote
Post Reply