[AppleTV] HOW-TO get a Sitecom 802.11n external USB WiFi adapter to work on a AppleTV

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Thumbs Up  [AppleTV] HOW-TO get a Sitecom 802.11n external USB WiFi adapter to work on a AppleTV
Post: #1
You will need:

a) USB Hub
b) USB Mouse
c) USB Keyboard
d) Sitecom "W353" USB 802.11n Wireless Card
e) Realtek RTL8188S drivers for 10.4 Intel from the Realtek website
f) Tiger 10.4.11 Combo Updater Image
g) Pacifist (to extract sw from installer images)

First, You only need an interest in this mod if you lost wireless when you removed the internal Wifi card to replace it with a Broadcom CrystalHD card.

Second, Your AppleTV is already moderately hacked and I assume that you already have SSH access, nitoTV installed (including the 'software setup' that adds a bunch of useful/essential stuff back into the OS) and XBMC (of course!). You will be competent at copying files to the right places on an AppleTV.

Third, I'm writing this up after several extended 'fiddling' sessions to get everything working and there has been enough trial and error involved that I probably glossed over a few small details in the write-up, but the core information is here.

Fourth, I know there are other ways to extract stuff from installer files without Pacifist (e.g. install it on another Mac, copy the files, then uninstall) but I have Pacifist and I used it. End of discussion..

Fifth, this exact process isn't going to work with every flavour of WiFi card out there. It works with THIS ONE. End of discussion..

Here goes:

Use Pacifist to extract the RTL8192SUt.kext and "Wireless Network Utility.app" files from the Realtek installer package. Copy the kext to /System/Library/Extensions on the AppleTV and the utility app to /Users/frontrow/Applications. Extract a version of IONetworkingFamily.kext from the 10.4.11 combo updater and copy it to /System/Library/Extensions. Other 10.4.9 and 10.4.10 combo images may also work, but I used 10.4.11.

Set permissions on the files you copied:

PHP Code:
sudo chown -R root:wheel /System/Library/Extensions/RTL8192SUt.kext
sudo chmod 
-R 755 /System/Library/Extensions/RTL8192SUt.kext
sudo chown 
-R root:wheel /System/Library/Extensions/IONetworkingFamily.kext
sudo chmod 
-R 755 /System/Library/Extensions/IONetworkingFamily.kext 

edit /etc/rc.local to include a new line that loads the RTL8192SUt.kext and IONetworkingFamily.kext file on future reboots. nitoTV will have set Turbo's kextloader as the first line in the file. I've appended the RTL kext to the end of the file and placed the IONetworking kext after other IOXxxxx kexts mid-way in the load list.

Manually load the RTL8192SUt.kext; in the command below -v shows verbose output:

PHP Code:
sudo kextload -/System/Library/Extensions/RTL8192SUt.kext 

You should see the kext checked for dependencies and assuming all is good the kext will load and you'll see a long on-screen list of device "personalitites" that are now available to the kernel. The Sitecom W353 USB 80211.n card is burried somewhere in the list. It's worth noting that although this is a wireless USB card the driver adds it as a standard NIC so none of the wireless utilities in the OS that arre designed for official Apple hardware, e.g. the 'airport' cli command, will work.

Using nitoTV's software add-ons function install the "MouseLocator" software ..this is essential for being able to see the mouse on-screen for the rest of the config. Now plug the mouse, keyboard, and USB wireless card into the hub, and plug the hub into the single USB port on the back of the AppleTV.

Using nitoTV open "System Preferences.app" and click on the Network icon. On opening it should announce a new network interface, and depending on what else you've done to your AppleTV recently it will probably be named en2 (by default en0 is fixed ethernet and en1 was the original wifi card). Use the show: drop-down to display network port configurations and make sure en2 is selected. Now drag/drop en2 to the top of the list so "Built-in Ethernet" is below it in the list. If you need to manually set an IP address, configure en2 with the relevant information, otherwise leave it set for DHCP.

Navigate back to the main System Preferences menu. Now go to Accounts > Select 'frontrow' > Login Items. Create a new login item for "Wireless Network Utility.app" in /Users/frontrow/Applications/ and tick the box to 'hide' the application. This ensures the wireless utility is run on startup - if it is not run on startup, the wireless card does not join the network and the wireless interface is not "up" and nothing works. Once done, quit System Preferences. If it doesn't quit (possibly) use the remote to get back.

Using nitoTV open "Wireless Network Utility.app" and create a profile for the WLAN you want to use - use the mouse and keyboard to navigate and enter details as required. You may see an error message about ensuring the device is enabled in Network Control Panel, click okay if you see it. Once you have the profile created the card should join the WLAN and you'll see signal strength and other values. Close the app - if it doesn't quit (probably) use the menu button the on the Apple remote to navigate back to the nitoTV applications menu.

Edit /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist on the AppleTV to swap en2 to en0 (and vice versa). You're looking for the following lines:

PHP Code:
<key>BSD Name</key>
<
string>en2</string>   <=change
<key>IOBuiltin</key>
<
false/>
<
key>IOInterfaceType</key>
<
integer>6</integer>
<
key>IOInterfaceUnit</key>
<
integer>2</integer>   <=change 

and you're going to change it to:

PHP Code:
<key>BSD Name</key>
<
string>en0</string> <=changed
<key>IOBuiltin</key>
<
false/>
<
key>IOInterfaceType</key>
<
integer>6</integer>
<
key>IOInterfaceUnit</key>
<
integer>0</integer>  <=changed 

Perform the reverse to the other interface, so en0 becomes en2 and en2 becomes en0. The Apple GUI is hardcoded to see en0 as the internet fixed network interface and if en0 is down it defaults to the wireless interface on en1 (which is missing). By editing this file to make the USB wireless card en0 the Settings > General > Network screen will show the "ethernet" IP address information correctly.

reboot the AppleTV

If all is well you will see the Wireless Network Utility open early in the boot process, and you'll see it join the network you configured a profile for, and then you'll see Apple's fancy opening video sequence. Once the AppleTV GUI has loaded you can check Settings > General > Network and you should see a "fixed network" with IP address information. In the top level of the Apple GUI you should be able to see Yahoo, Flickr, iTMS links etc. listed, i.e. networking is working. If you don't.. something didn't go okay ..start by using the Wireless Utility to ensure the card is active.

For bonus credit: Fiddling with the network configuration appears to bork the original Bonjour/ZeroConf name for the AppleTV and "AppleTV" gets changed to "AppleTV-<MAC_ADDRESS>" for the new en0 interface. This can be reset by opening "System Preferences.app" via nitoTV, clicking on "Sharing" and then entering "AppleTV" as the computer name again. Once that's done you can unplug the Keyboard and Mouse from the hub. On the next reboot you can unplug the hub and insert the wireless card directly into the AppleTV.

So far watching 720p and the limited amount of 1080p content I posess in XBMC streamed from a elderly JBOD NAS has been okay, no network issues and only a small number of "buffering..." instances, which is something I see over Ethernet occasionally as well. Time will tell if it's a successful mod, but for now all appears okay and I'm a happy camper Smile

Christian
(This post was last modified: 2011-01-09 10:10 by chewitt.)
find quote
pooh Offline
Senior Member
Posts: 194
Joined: May 2007
Reputation: 0
Post: #2
Thanks, you solved the puzzle. Now it's time to buy the crystal HD.
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #3
Couple of observations:

a) The AppleFileServer process for AFP file sharing appears to stop working after a while. The process is still running but file shares on the ATV are not accessible. I'm not 100% convinced this is related to the card, but it didn't do this before with the factory ethernet card paired with an Airport Express as a network bridge. The USB network interface is not going down/up as I have SSH connections to the ATV that remain working throughout and these would fail with the interface going down. More digging is required later in the week when I have some time.

b) The card prefers to connect at 802.11g rates to my WLAN access point even though 802.11n is available on the 2.4GHz channel. I'm wondering if the presence of other 802.11g devices (Wii, Blackberry, Wife's laptop) on the same WLAN are causing the network to step-down to 802.11g ..I think I read about that behaviour somewhere before (some RTFM required). The access point (Apple TimeCapsule) creates two WLAN's; one at 2.4GHz and one at 5GHz. I've noticed that Sitecom have a "300MB/s" version of this USB card and I'm wondering it that may be a better option as I'd be able to run this on the 5GHz 802.11n 'wide' channels for faster throughput. The sitecom drivers for the W352 card are the same Realtek package as the W353 one I've got now so the cards should be interchangeable.

UPDATE: After posting this I realised the WLAN router was only configured for 802.11b/g in the 2.4GHz band - 802.11n was only active in the 5GHz band. This explains why the card was only connecting at 49MB/s.

Christian
(This post was last modified: 2011-01-16 12:13 by chewitt.)
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #4
I've also discovered that this mod breaks the association between your iTunes library and the AppleTV so you will need to re-pair them and then re-sync content. As the USB connection is now en0 the AppleTV's fixed ethernet connection is effectively disabled and so if your iTunes library is larger (mine is around 250GB inc. photo's) the wireless sync process is going to take many hours. At least it'll be a good test of wireless transfer resilience Big Grin
find quote
illiac4 Offline
Fan
Posts: 521
Joined: May 2009
Reputation: 3
Post: #5
Is this usb wifi also compatible with pin's image (linux)?
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #6
illiac4 Wrote:Is this usb wifi also compatible with pin's image (linux)?
I've not experimented with Linux on the AppleTV as I use the iTunes Music/Photo sync features outside of XBMC, but there are Linux drivers on the Realtek website so as long as you add them it *should* work.
(This post was last modified: 2011-01-13 14:32 by chewitt.)
find quote
nerve Offline
Junior Member
Posts: 38
Joined: May 2010
Reputation: 0
Location: France
Post: #7
Thanks for this hack.
Just buy the sitecom wireless card.
Will test as soon as it will deliver

btw : any news about the AFP break ?
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #8
nerve Wrote:btw: any news about the AFP break ?

I haven't had the time to really investigate but AFP access to the AppleTV doesn't appear to have been failing as often since I connected the NIC directly to the AppleTV's USB port - previously it was connected via a small portable hub along with a USB keyboard and mouse. That said, I've also encountered a few hard crashes of XBMC with an "error: 11" which from some googling is probably related to accessing network shares (90% of my content is on a NAS) and gut-feel says the two are different symptoms of the same underlying issue.

Otherwise the WIFI appears to be stable; iTunes re-synced 250GB+ without missing a beat and I've watched a variety of 720p content without "buffering.." hassles. The few 1080p items I tried were okay, although in my experience 1080p is never 100% smooth (even with the broadcom card) unless I reboot the AppleTV first. At some point I need to look at pruning the OS for extra stuff to disable to create more CPU/RAM headroom.

NB: I checked the Sitecom W352 card in a local retailer the other day and it's not the exact same chipset as the W353, but it uses the same driver so should be a direct swap. Sitecom claims the W352 is a 300MB/s card (the W353 is claimed to be 150MB/s) but both are 2.4GHz-only so I'm not sure how much throughput would really be gained from the more expensive W352. After fiddling with my WLAN router config to ensure 802.11n is available on the 2.4GHz band my W353 is connecting at 72MB/s and showing 99-100% on the wireless strength gauge with the router 15' away in the next room. If I can find a 5GHz USB card with a chipset that has Mac drivers I might bite and do some more experimenting, otherwise an upgrade to the W353 is $$$ that I don't need to spend.
(This post was last modified: 2011-01-16 12:15 by chewitt.)
find quote
nerve Offline
Junior Member
Posts: 38
Joined: May 2010
Reputation: 0
Location: France
Post: #9
Thanks for your reply !
find quote
illiac4 Offline
Fan
Posts: 521
Joined: May 2009
Reputation: 3
Post: #10
Can both cards work at the same time? Or. does it disables wireless when lan is in port?
I'm asking this because i'm using both cards lan for ip-tv and wi-fi for internal network and internet access on Boxee Box.

TNX
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #11
illiac4 Wrote:Can both cards work at the same time? Or. does it disables wireless when lan is in port? I'm asking this because i'm using both cards lan for ip-tv and wi-fi for internal network and internet access on Boxee Box.

The AppleTV's NIC swap behaviour is triggered when en1 becomes active by joining a wireless network. This mod puts the USB NIC on en0 where it's seen as the primary fixed interface, and en1 remains absent in the OS so the NIC swap behaviour cannot be triggered. The original ethernet NIC is now on en2 which the "AppleTV" part of the OS is effectively blind to so there's nothing stopping you from using it as second interface and it should be a simple case of configuring the NIC using System Preferences.app. As with any multi-homed setup you may need to reorder NIC's and/or set additional network routes to have things work as you want, but that's all standard networking.

NB: I'm still on the lookout for a Broadcom chipset USB Wifi dongle. I'd like to find something that can be set to impersonate an original airport card (including use of the 'airport' commands in the OS) so that the original en0/en1 appearance and behaviour is maintained. I can only find PCI based cards, but if someone spots a USB one, let me know!

Christian
(This post was last modified: 2011-01-20 07:03 by chewitt.)
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #12
illiac4 Wrote:Is this usb wifi also compatible with pin's image (linux)?

Update: I tested pin's Linux image this morning and appears to be working fine. Took me a while to figure out how to make network config survive a restart as it's been a while since I did anything in Ubuntu, but I got there. HOW-TO will follow in a couple of days.
find quote
grey Offline
Senior Member
Posts: 237
Joined: Nov 2008
Reputation: 0
Location: Chisinau, Moldova
Post: #13
can it work on a usb hub, when there is attached a USB external hdd, too?

thanks
find quote
chewitt Offline
Junior Member
Posts: 30
Joined: Jan 2011
Reputation: 0
Location: Dubai, UAE
Post: #14
grey Wrote:can it work on a usb hub, when there is attached a USB external hdd, too?

I think as long as the external drive isn't sucking loads of power (if it draws from the USB port) and you're not trying to perform huge file transfers at the same time, you're "probably" okay. I currently have the Sitecom USB NIC, a PC keyboard, 8GB SSD in an external USB-powered case and a 4GB flash drive hanging out of the back of a tiny pocket-hub while I experiment with Ubuntu on the SSD. So far so good..
find quote
grey Offline
Senior Member
Posts: 237
Joined: Nov 2008
Reputation: 0
Location: Chisinau, Moldova
Post: #15
thank you for your reply.

only issue is that it would be hard for me to find a Sitecom adapter... as i live in Europe and it's first time i hear about this company and i'm in IT business (
find quote
Post Reply