Wifi adapter from android phone via usb. How to use an Android smartphone as an external USB modem, a Wi-Fi adapter for a computer, and a Wi-Fi router

Many happy owners of Android smartphones do not even suspect that their high-tech devices can be used as a full replacement for a standard USB modem, an external Wi-Fi adapter for a computer, or a Wi-Fi router. As a rule, smartphone buyers only use 3G or 4G Internet on the phone itself, completely wasting a great opportunity to enjoy all the benefits of high-speed broadband mobile access to the global web, for example, on a laptop.

In order not to miss the opportunity to use 100% free mobile Internet traffic, which is provided as a gift in most mobile phone stores to all buyers of more or less expensive gadgets, let's look at all the ways to connect an Android smartphone to a computer, both using a USB data cable and and without it.

How to connect a smartphone running Android OS as a Wi-Fi router

Perhaps the most interesting use of a smartphone is a portable Wi-Fi access point, which provides the ability to wirelessly connect other smartphones, tablets, laptops, as well as desktop computers for sharing the mobile Internet. To enable the wireless router mode, you must do the following:

  1. go to the network connections settings, and also turn the Wi-Fi toggle switch to the “on” position;
  2. Find the “Data Usage” item and activate “Mobile Data”. To make everything work, we simply set the icon in the form of a green checkmark in the advice window;
  3. go back one step to select "Other Networks". Then you need to find the line “Modem and mobile access point” and turn the switch icon to the “on” position. You can then configure the SSID, encryption type, and Wi-Fi password.

How to connect a smartphone to a computer as a 3G (4G) modem

As a rule, any smartphone comes with a charger, which consists of the charger itself and a data cable. It is this cable that we will need to use this Android smartphone as a USB modem. The use of any non-original USB - micro USB cables made in China is not recommended, as unstable operation may occur. Therefore, we find the original charger, disconnect the data cable from it and connect the USB to the computer, and the micro USB to the smartphone. After the smartphone is detected by the Windows system, you need to make a rather trivial setup. So, in Android 6, to do this, in the “Wireless Networks” menu, select “Modem Mode” and turn on the “USB modem” function.

How to connect a smartphone as a Wi-Fi adapter

Using a smartphone's Wi-Fi adapter, as well as using the built-in usb modem module, allows the end user to fully appreciate all the functions of wired and wireless communication of an Android device. It is especially interesting to use an Android smartphone as a Wi-Fi adapter on a desktop computer, since this will allow you to connect the computer not only to the mobile Internet, but to a full-fledged Wi-Fi router with an ADSL modem. This kind of idea can be implemented extremely simply. We connect the smartphone to the computer with a data cable and configure the phone.

Algorithm for setting up a Wi-Fi adapter (using the example of Samsung Galaxy S4 mini)

  1. Switch the Wi-Fi switch to the on position.
  2. Connect to your Wi-Fi router.
  3. Go to "Data Usage" and turn off "Mobile Data" by unchecking the green checkmark.
  4. Let's go back to the settings.
  5. Select the item “Other networks”.
  6. Find the line “USB modem” and check the box.

In fact, everything is simple. The main thing is that you do not forget to turn off Mobile Data.

28.02.2017 14:44:00

In one of the articles we looked at the question of how to format a Fly phone on Android.

A telephone is a multifunctional means of communication; a mobile gadget can be used as an intermediate link between the World Wide Web and a desktop computer or laptop. The smartphone can be turned into a real modem for accessing the Internet. The connection is inferior in speed to fiber optic communication, however, it will be a great help if the provider turns off the Internet during technical work. To use the gadget as a modem for a computer, there are three connection methods:

Let's define the basic concepts on the topic: modem, router and access point.

A modem is a device designed to interface a signal with its receiving point. Ten years ago, to connect a computer to the Internet, the signal via a modem came from a wired telephone line. Now the modem has shrunk to the size of a flash drive. You can turn any Android phone into a pairing device.


A router is a device for parallel connection to the Internet of several devices: phone, laptop, PC, tablet. You can use the same phone as a router, turning it into a modem.


An access point is a base station for wireless access to an existing network, such as wifi, or creating a new one.


Let's look at how you can set up a modem in your phone and use it as a router.

Method 1: Make a USB modem out of your phone

To do this you need to do the following:

  • Connect your phone to your computer using a USB cable.
  • Go to Settings, find the Wireless networks section, select “More”.
  • Here click on the line Modem mode.
  • Click the USB tethering button.

Don't forget to turn on mobile data. You can do this by lowering the notification shade on your phone's desktop and clicking on the corresponding icon.

Other Fly smartphones
On our website you can find a catalog with other Fly smartphones on Android.

Method 2: Turn your phone into a wireless wifi router

In order for your phone to distribute a wifi signal, including to several devices, you need to make an access point out of it. You can do this by following these steps:

  • Go to Phone Settings.
  • Click on the "More" section
  • Here select Modem Mode.
  • Click on the line “Wi-Fi access point”
  • Turn on the hotspot button
  • Rewrite or remember the access point name and password

Your phone is now sending out a wifi signal. You can catch it on any device that has the corresponding module.

Advanced users can also change the access point settings. Here you can change the following parameters:

  • Network name. By default, this is the phone model name.
  • Protection. By default, it is WPA2 PSK. It is better not to change it, since this program provides maximum protection and access control.
  • Password. Here you can set your password of 8 characters
  • Restore all factory settings
  • Set the number of connected users from 1 to 8 people.

Method 3: Use Bluetooth to connect your phone and other devices

The method is considered somewhat outdated, however, it works great for devices with a Bluetooth module installed. Using the “bluetooth” you can connect your phone and laptop. Turning a mobile gadget into a Bluetooth modem is very simple:

  • Make sure your laptop or PC has a Bluetooth module installed. You can use an external Bluetooth adapter.
  • Go to your phone settings.
  • Press the Bluetooth power button
  • Your PC, laptop or other device will appear among the available devices.
  • Select the device you need to pair.

Now your phone has turned into a Bluetooth modem.

A similar procedure can be carried out vice versa - from the computer to the phone:

  • Turn on Bluetooth on your phone
  • Go to PC Control Panel
  • Click on View devices and printers
  • Click on the "Add device" button


When the system finds your phone, click “Add” and enter the received code on your phone.

The best way to use your phone as a modem is through a wireless connection. The user does not depend on the cable, and the wifi signal is stable. In the end, it's up to you.

If you are interested, you can read the article about.

Our goal was to connect a Wi-Fi adapter to a smartphone based on Android OS. To achieve it, it is necessary to solve two problems. First, assemble the driver modules for the corresponding Wi-Fi adapter. Secondly, connect the assembled modules to the operating system kernel.

The work was carried out on the following equipment:

  • Personal computer with Ubuntu 14.04 OS
  • Huawei Ascend Mate 7 Premium smartphone with Android 4.4.2 OS (with root rights and BusyBox and Linux Deploy programs installed)
  • Wi-Fi adapter TP-Link TLWN-7200ND based on Ralink RT3070 chip

1 Preparing for assembly

Before proceeding directly to assembling the modules, it is necessary to properly prepare the system. The PC on which we will assemble the modules runs on a processor with x86 architecture, while the smartphone has an ARM architecture processor. Therefore, to compile modules, you need to install a special set of packages and programs.

$ sudo apt-get install gcc-arm-linux-androideabi binutils ncurses-devel

Next, you need to download the source codes of the Android operating system installed on your Huawei smartphone. this can be done in two ways. Source codes can be downloaded from the official Huawei website. To do this, follow the link and find the appropriate device in the Downloads section. The second way is to download source codes from a repository on github. It is recommended to use the second method, because... source codes posted on the official website may become unavailable after some time.

To download source codes from the github repository, enter the command:

$ git clone https://github.com/gabry3795/android_kernel_huawei_mt7_l09

Once the download is complete, you can find the source codes in the android_kernel_huawei_mt7_109 directory located in the user's home directory.

Before compiling modules, you also need to specify the architecture of the target processor and the path to the compiler files:

$ export ARCH=arm $ export CROSS_COMPILE=/usr/bin/arm-linux-androideabi-

It should be noted that the set variables will be reset after a reboot, so they will need to be set again. In order to check the environment variables in the system, you need to enter the command:

$export

2 Assembly of modules

Next you need to set the kernel configuration. This can be done manually, but the source codes already have ready-made configurations for various processors. In order to view the entire list of configurations, you need to go to the directory with the source codes (further all actions will be performed in it) and enter the command

$ make help

The result will display various information about compilation settings and various configurations. An example of such output can be seen in the following figure

The Huawei Ascend Mate 7 Premium smartphone is equipped with a KIRIN 925 (HiSi 3830) processor. This particular processor model is not in the list that appears, but the merge_hisi3630_defconfig configuration is suitable. This configuration is loaded with the command

$ make merge_hisi3630_defconfig

We determine the full name of the OS kernel version installed on the smartphone. For the Huawei Ascend Mate 7 Premium smartphone (Android 4.4.2), kernel version 3.10.30-00001-g57d8d0a-dirty. The kernel being assembled must have the same version, otherwise the modules will not be connected. Let's open the Makefile configuration file in some text editor and find the following lines there

VERSION = 3 PATCHLEVEL = 10 SUBLEVEL = 30 EXTRAVERSION =

We see that the version of the loaded kernel is the same up to EXTRAVERSION. In order for the versions to completely match, add -00001-g57d8d0a-dirty to this line.

EXTRAVERSION = -00001-g57d8d0a-dirty

You also need to set the CFLAGS_MODULE flag to -fno-pic.

CFLAGS_MODULE = -fno-pic

To select those modules that will be compiled, it is convenient to use the menuconfig graphical interface. To do this, enter the command:

$ make menuconfig

The following figure shows the menuconfig program window.

For the TLWN-7200ND adapter on the Ralink RT3070 chip, you must connect the following modules.

Networking Support --> Wireless --> Generic IEEE Networking Stack (mac80211)

The letter M means that the driver will be built as a separate module.

Device Drivers --> Network Device Support --> Wireless LAN

Set the Ralink Drivers Support option to M and then move on

Ralink Drivers Support -->

Set the options as shown in the following figure.

It is recommended to remove flags from modules in menuconfig that do not require drivers to be connected. This will speed up compilation time, because extra modules will not be collected. After the above operations, you can exit the graphical shell before saving the changes. The assembly of modules is started with the command

$ make modules

After some time, if there are no errors, the compilation will complete successfully. Paths to compiled modules:

Net/wireless/mac80211/mac80211.ko drivers/net/wireless/rt2x00/rt2x00lib.ko drivers/net/wireless/rt2x00/rt2x00usb.ko drivers/net/wireless/rt2x00/rt2800lib.ko drivers/net/wireless/rt2x00/ rt2800usb.ko

You can check information about compiled modules with the following command

$ modinfo rt2x00usb.ko

The following image shows the output of this command

You should pay attention to the vermagic line, which shows for which kernel version the module is built. It must completely match the OS kernel version of the smartphone. You should also pay attention to the depends line, which indicates the module dependencies, i.e. other modules that must first be loaded into the kernel for the module to work correctly.

For proper operation of this module, the firmware file rt2870.bin is required. You can download it from the official Ralink website.

Let's copy the assembled modules to the internal memory of the smartphone. On the Huawei Ascend Mate 7 Premium smartphone, copy the modules to the directory

/system/lib/modules

On other smartphones, such a directory may not exist, so the modules can be copied to another directory or, which is more preferable, create the above directory and transfer the module files to it.

The firmware file rt2870.bin must be copied to the directory with the firmware. On a Huawei smartphone

/system/vendor/firmware

After we have copied the modules and firmware, we launch any terminal emulator application on the smartphone. Commands are entered into the terminal window (explanations for the commands are given in parentheses; they do not need to be entered).

$ su (enter superuser mode) # cd /system/lib/modules (go to the directory with modules) # chmod 644 MODULE_NAME (change rights to a module) # insmod MODULE_NAME (load a module into the OS kernel)

Instead of MODULE_NAME we substitute the name of a specific module. For a Wi-Fi adapter running on the Ralink RT3070 chip, the modules must be loaded in the following order:

1. mac80211.ko 2. rt2x00lib.ko 3. rt2x00usb.ko 4. rt2800lib.ko 5. rt2800usb.ko

An archive of all these modules can be downloaded

You can check the list of modules connected to the kernel with the command

This method of loading modules is not very convenient, because... After rebooting the smartphone, you need to reconnect them to the kernel. To automate this process, you can create an executable script and use standard applications from the Google Play app store. For example, the Universal init.d application allows you to create executable scripts and place them in startup. Another application that can be used to automatically load modules is Tasker. It allows you to execute any commands in response to any event.

Not all smartphones support autoloading scripts from init.d. In particular, Huawei Ascend Mate 7 Premium does not have this feature. When you launch the application, you can run a test to determine whether your smartphone supports this option.

If your smartphone allows loading scripts from init.d, then you can do the following. On a PC we will create a script with the following content

#!/system/bin/sh insmod /system/lib/modules/mac80211.ko insmod /system/lib/modules/rt2x00lib.ko insmod /system/lib/modules/rt2x00usb.ko insmod /system/lib/modules/rt2800lib .ko insmod /system/lib/modules/rt2800usb.ko

Copy the script to the directory

/system/etc/init.d/

After this, we reassign the rights to the file

$ su # chmod 755 /system/etc/init.d/script.sh

where script.sh is the name of the script.

The following figure shows the interface of the init.d program

If your smartphone does not support autoloading scripts from init.d, you can use the Tasker application.

Launch Tasker and create a new task

In our case, we will launch the script automatically when connecting any USB device, which naturally includes a Wi-Fi adapter. Select the menu items “Status” --> “Hardware” --> “Connected via USB.”

Select the Any class

We save the task under some name. Now we need to add an action to the task.

4 Installing Kali Linux on a smartphone

To be able to use Kali Linux on an Android phone, you will need the Linux Deploy program. It can be downloaded from the Google Play app store. To install Kali Linux, you need to set the following settings in Linux Deploy.

You can also set your own username and password instead of the default values.

After completing the settings, you need to click “install” in the top menu and wait for the installation to complete. To start Kali Linux, you need to click the “Start” button on the bottom panel.

To connect to a running OS, you can use VNC (to log into the graphical shell) or SSH (to log into the console) clients. As a VNC client, we recommend using the VNC Viewer program, which can be installed from Google Play. To connect via SSH, we recommend the JuiceSSH program.

You need to create a new connection in VNC Viewer. The host IP address must be the IP address listed in the top panel of the Linux Deploy program. During the connection process, you will need to specify the previously specified password.

Need to connect your computer to the Internet, but don't have a twisted pair cable or modem nearby? Or to connect a laptop, but the password has been entered on the smartphone? Let's show you how to use an Android phone as a WiFi adapter and feed the Internet through it.

This article is suitable for all brands that produce phones on Android 9/8/7/6: Samsung, HTC, Lenovo, LG, Sony, ZTE, Huawei, Meizu, Fly, Alcatel, Xiaomi, Nokia and others. We are not responsible for your actions.

Features of Android phone operation in Wi-Fi adapter mode

Quite often, users are interested in the question of whether it is possible to use a phone running on the Android operating system as a Wi-Fi adapter for a personal computer. This means that the smartphone must be connected to a Wi-Fi network, and in modem mode the Internet is transmitted via the USB interface to a desktop computer.

At the same time, the personal computer does not have a Wi-Fi adapter, so it is not possible to connect directly to wireless networks. This connection can be made.

Modem mode has appeared on the Android operating system since the second version. Almost all tablets and phones on this operating system are capable of distributing the Internet to other devices via a USB cable, Bluetooth and Wi-Fi.

Android devices can share not only mobile Internet (4G, 3G, EDGE), but also Wi-Fi. This means that you can turn your smartphone into a real Wi-Fi adapter for a personal computer.

Increase

This feature is very useful. Situations are quite common when, after installing a router or purchasing a personal computer, it is not possible to run a network cable to the computer.

Using this function, it becomes possible to connect it to the Internet. Albeit temporarily, but until you purchase a regular Wi-Fi adapter, you will have access to the global network.

All settings in our instructions were carried out and tested on a Samsung Galaxy J5 smartphone. On other phones and tablets with a different version of the Android system, the settings may be slightly different. This is not critical in this situation; even novice users will be able to understand the essence of the settings. If you have questions or can’t complete all the settings, you can ask in the comments.

It’s also worth adding that connecting to a Wi-Fi network via a smartphone is very fast and stable. On a computer, the Internet simply flies. Manufacturers install excellent wireless modules on many phones.

Connecting a computer to a Wi-Fi network via an Android device as an adapter

First, you need to disable mobile Internet on your smartphone. Then we simply turn off the data transfer function using the cellular network. This is done just in case to know for sure that a Wi-Fi connection is being used.

We perform the following steps:

  • Connect your phone to the Wi-Fi network.
  • Increase
  • Using a USB cable, connect the gadget to the computer. It will not only function as an adapter, but will also be able to charge.

  • Increase
  • On your smartphone, you need to go to “Settings”, where we select “Connections”. Then you need to go to the “Access point and modem” menu. In this menu we activate the “USB modem” function. This is necessary for general access to the established Internet connection on the phone.

  • Increase
  • On your personal computer, you will immediately be able to access the Internet using a smartphone on the Android system.

Increase

Another network adapter will appear in the system. In our case, this is Ethernet 4. On other computers, the network adapter may be different, but this is not an important point.