, How Tos
Mar 14th, 2012 |
This is a guest post by Rajnish Jain. Rajnish is a product development enthusiast having around 12.5 years of experience. He enjoys solving complex technical problems and has worked on wide range of technologies including Open Source frameworks, Unix (shell scripting) & embedded device programming.
When you purchase a Samsung Smart TV (UA40D5500RR, for example), depending on the model, it may or may not support inbuilt Wi-Fi function. If it doesn’t, then Samsung recommends using WIS09ABGN USB WiFi adapter to let your TV connect to a Wireless router. Samsung has priced this USB adapter at a very huge cost (around INR 6,000) and any other adapter is not recognized by the TV. WTF?
I tried not to fall prey to this monopolistic approach by the company and put myself on work to find out a hack so that any Wi-Fi USB adapter is accepted by the TV. I found this wonderful link which helped a lot.
DISCLAIMER: The author of this article & woikr are not responsible for any damage/malfunction caused to the TV by following the instructions written below. Please continue at your own risk.
Few facts first:
- WIS09ABGN uses a chipset which is RT2870. This manufacturer of this chipset is Ralink Technologies.
- The Samsung Smart TVs internally run Linux OS (which version, which variant is immaterial for this post here).
Every USB device has these two properties (apart from many others):
- VID – vendor identification
- PID – product identification
- Samsung TVs have built-in intelligence that if the Wi-Fi adapter that’s plugged in doesn’t have Samsung specific VID/PID values, the TV will reject it.
Samsung specific VID/PID values that the TV is expecting are:
- I found this info (and the chipset info) here.
- The same page (http://wikidevi.com/wiki/Samsung_WIS09ABGN) tells us that the WIS09ABGN is running rt2870sta driver based on Linux.
- To be able to use any Wi-Fi USB adapter with Samsung TV, all you need to do is change that USB device’s VID/PID values to 04E8 : 2018 (Values assigned to Samsung Electronics Co.)
So, to begin with, we need a USB adapter which is based on Ralink’s RT2870 chipset. A quick search on Google and Ifound this one: Edimax EW-7718Un. I could find this one on ebay.in for INR 999/- and quickly ordered it.
Upon receiving the Edimax dongle, I started towards modifying the required values. These values reside on EEPROM (e2p) of the chipset, so changing them means you need to issue commands that modify the values on e2p. However, e2p ioctl is generally not available by default, so you will need to modify the driver code, compile it, and then change the values. This is explained below.
We now already know that we need to deal with Linux OS. So, we need a Linux box wherein our USB adapter can be plugged in and its properties can be seen and modified.
For this, instead of looking for a Linux based box, or creating a new partition in my laptop’s hard drive, I chose to go in for USB flash drive based environment. That is, without changing any configuration of my Windows XP based laptop, I can get a new OS to play around with.
- Start your Windows based computer.
- Plugin a USB flash drive into it.
- Follow the instructions at http://www.ubuntu.com/download/ubuntu/download and make your USB drive bootable with ubuntu, preferably version 10.04.
- Once the flash drive is ready, restart your computer, change the boot sequence in BIOS so that it boots from the USB drive and you will get into a new world of ubuntu.
Once the system comes up, plug in your USB adapter, open the command terminal and type:
- # lsusb
You should be able to figure out this string for your Edimax EW-7718Un adapter:
- These are the VID/PID values assigned to this USB device. And this is the task in hand – to replace these values with 04E8:2018.
- Plug out the adapter.
Now is the time to first download the relevant driver. Open Mozilla Firefox browser (which comes installed by default with ubuntu), and download the driver from this location:
You can enter any name and e-mail address in the boxes that appear on this link. Why are we downloading the driver? Because, to change the VID/PID values on EEPROM of the USB adapter, we will need to issue the following commands:
- # iwpriv ra0 e2p 208=04E8
- # iwpriv ra0 e2p 20A=2018
But by default the e2p ioctl is missing for us. So, we will customize the driver code to introduce e2p ioctl and then the above command will do us the trick.
NOTE: If the above sequence of commands (with USB adapter plugged-in) works for you then you are done. You don’t need to follow the rest of the tutorial.
Un-package the driver in a folder, say DRIVER_ROOT. Make the following changes to driver code:
# cd <DRIVER_ROOT>/os/linux and open config.mk file.
Make these changes:
# Support ATE function
# Support Wpa_Supplicant
# Support Native WpaSupplicant for Network Maganger
While in the same folder, open usb_main_dev.c file and add this code:
It should now look like this:
MODULE_AUTHOR(“Paul Lin <firstname.lastname@example.org>”);
MODULE_DESCRIPTION(“RT2870 Wireless Lan Linux Driver”);
#endif // CONFIG_STA_SUPPORT //
Now we are ready to compile the driver code. You need the relevant compiler and helper tools and libraries for doing so. On the command terminal, issue these commands:
- # sudo apt-get update
- # sudo apt-get upgrade
- # sudo apt-get install build-essential
- # sudo apt-get install linux-headers-$(uname -r)
While in DRIVER_ROOT, issue the following commands:
- # sudo make
- # sudo make install
- # sudo rmmod rt2870sta
- # sudo rmmod rt2800usb
- # sudo rmmod rt2x00usb
- # sudo rmmod rt2800lib
- It may happen that the last 4 commands don’t do anything, or print a warning like “driver not found”. I don’t remember the exact warning message, but this means that we are trying to remove a module (rmmod) that doesn’t exist. Double check that no ralink specific module is now in the memory:
- # lsmod | grep rt
- You shouldn’t see any of the modules mentioned in the last 4 commands above.
Now, load your custom driver module in the kernel:
- # sudo su
- # insmod <DRIVER_ROOT>/os/linux/rt3070sta.ko
- At this stage, if you insert your USB adapter and watch, the e2p specific ioctl will be listed.
Now, plugin your USB adapter (Edimax EW-7718Un, for example) and issue the following commands from the command terminal:
- # sudo su
- # iwpriv ra0 e2p 208=04E8
- # iwpriv ra0 e2p 20A=2018
- You may need to plug out and plug back in your adapter for the above commands to be successful.
- We are now done. You can verify the modified values by using the lsusb command. Plugin your Wi-Fi adapter into your Samsung Smart TV and it will fool the TV to think that a Samsung specific stick has been plugged in. Enjoy!
Please note that the driver code doesn’t compile on version of ubuntu later than 10.04. If you have a reason to use a later version of ubuntu, you will need to make changes to some more .c files of the driver code because some of the libraries used have been renamed in the newer versions of ubuntu.
Liked this article? Like us on Facebook!