Android to linux bluetooth

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Example of Bluetooth communitcation between Android and Linux

denisigo/android-linux-bluetooth

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Example of Bluetooth communitcation between Android and Linux

It shows how to create server Bluetooth socket on Android using SPP service and how to discover, connect and send/receive data from that service from Linux desktop using Python.

Client Python script is located on BluetoothClient.py.

About

Example of Bluetooth communitcation between Android and Linux

Источник

Use Bluetooth Tethering to Connect Ubuntu to Android’s WiFi

There are those times when for one reason or the other (e.g electricity shortage and expired data plan,) one needs to access the internet urgently to do work especially one that requires a laptop.

I, for example, need to be online when I write my articles so I can research properly and sometimes my mobile router isn’t with me. Such an emergency can be handled if you’ve got a smartphone with internet access and so today, we will show you how to tether WiFi from your Android device to your Ubuntu desktop.

Читайте также:  Linux create new user command

Connecting Ubuntu to Android’s WiFi via Bluetooth

1. First switch on Bluetooth on both devices, next on Ubuntu – Go to Bluetooth settings and click ‘+’ to connect to your phone.

2. Select your Android device and click ‘Next‘ to continue.

Select Android Device

3. A dialogue box will pop up asking you to confirm that the pin displayed on your Android device matches the one one showing on your Ubuntu screen. If it does, click the ‘Matches‘ button.

Confirm Matching Pins

4. Now both devices will proceed to pair and when that is complete you can now share your phone’s WiFi with your Ubuntu system by enabling Bluetooth tethering on your Android device following these steps:

Activate Bluetooth Tethering

  • Settings ->Wireless & networks -> Tethering & portable hotspot -> Bluetooth tethering
  • Launch Network Connections from your WiFi dropdown and select to ‘Edit Connections
  • Double-click to enable the Bluetooth submenu
  • Select your Andriod phone’s network from your WiFi list and you’re good to go

You should know, that you can browse anything you want, but the connection will not be as fast as typical WiFi speeds. Use this as a fall-back method in case you need to access the internet when you’re offline.

I hope this walk through was simple enough? Please feel free to ask questions in the comments section and to also add tips if you have any.

Источник

Bluetooth Serial Communication Between Linux & Android

Most laptops and smart phones(Android/iPhone) have builtin Bluetooth modules. We can use this bluetooth module to communicate with other devices or with other bluetooth modules like HC-05 or HM-10.

In this article, we will learn how to send data between laptop and android bluetooth.

First, we need to pair with a bluetooth device to send information. From Ubuntu, we can pair to a Bluetooth device from Bluetooth settings. Alternatively, we can also use CLI to do the same.

$ bluetoothctl [NEW] Controller 24:0A:64:D7:99:AC asus [default] [NEW] Device 94:E9:79:BB:F8:3A DESKTOP-C4ECO3K [NEW] Device 88:79:7E:7B:4C:87 athene [NEW] Device 94:65:2D:8C:2E:10 OnePlus 5 [NEW] Device 98:0C:A5:61:D5:64 Lenovo VIBE K5 Plus [NEW] Device AC:C3:3A:A0:CE:EF Galaxy J2 [NEW] Device 98:D3:35:71:02:B3 HC-05 [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent Default agent request successful [bluetooth]# scan on Discovery started [CHG] Controller 24:0A:64:D7:99:AC Discovering: yes [CHG] Device 94:E9:79:BB:F8:3A RSSI: -88 [CHG] Device 88:79:7E:7B:4C:87 RSSI: -66 [bluetooth]# pair 88:79:7E:7B:4C:87 Attempting to pair with 88:79:7E:7B:4C:87 [CHG] Device 88:79:7E:7B:4C:87 Paired: yes Pairing successful 

To communicate with paired devices, we will use RFCOMM protocol. RFCOMM is just a serial port emulation and provides reliable data tranfer like TCP.

Читайте также:  Linux сменить шелл пользователя

From ubuntu, lets open a port for communication.

$ sudo rfcomm listen /dev/rfcomm0 3 

From Android, we have to connect to ubuntu. For this, we can use Roboremo app which supports RFCOMM.

$ sudo rfcomm listen /dev/rfcomm0 3 Waiting for connection on channel 3 Connection from 88:79:7E:7B:4C:87 to /dev/rfcomm0 Press CTRL-C for hangup

Once the connection is established, we can communicate between devices.

In Unix like systems, OS provides a device file as an interface for device driver. To send and read messages from Linux or Mac is as easy as reading and writing to a file.

# to send message to bluetooth $ echo 'hello from ubuntu' > /dev/rfcomm0

We can see the received messages on Android

We can also send messages from android and read from ubuntu.

# to read messages from bluetooth $ cat /dev/rfcomm0 hello from android

This way, we can communicate with any bluetooth module using a laptop or a smart phone.

Chillar Anand
A blog about python, careers & life.
To contact me, send a message here.

Источник

How to access to internet on Linux using Android Tethering

It’s been over 30 years since the World Wide Web was introduced to the world. Over time, the internet took its toll and now has roughly around 45 million web pages compared to 10,000 websites earlier. We really do have come a long way.

Emerging from the primitive world of 2G signals we are now living in the era where mostly every device has an internet connection and if not of its own, gets one from another system. The technical term for sharing your phone’s internet connection to another phone or system is known as Tethering.

Tethering on Linux

Tethering the internet through your phone to your Linux desktop can be done mainly via three simple ways.

USB Tethering

Connection over USB is just as simple as connecting your phone to a charger point. However, just like electricity is essential to charge your phone, internet connection in your phone is necessary to share it with others. Rare is the case when your charging cable is not suitable to be used as a data-transfer wire and you need to buy an apt one separately.

Читайте также:  Python windows linux mac

The connection is automatically established by plugging in your USB cable to both your computer and phone. A dialog box of confirmation highlighting the name of your device pops up.

usb tether connect device

Now, Under the Settings in your phone select Wireless and Network (or Network and Internet ). Click on the More tab and choose Tethering & Portable Hotspot and Enable USB Tethering . On the top right corner of your Linux machine, bring down the Network Connections toolbar as shown, where a tab Ethernet Connected is visible.

usb tether Ethernet Connected

Your system’s internet connection is ready!

However, in a few cases you might have to further enable the Wired Settings window, where you can add a new connection and also view the IP address of your attached device. Here in this case, it is named Profile 1 .

usb tether Profile 1

usb tether IP address

Wifi Tethering

Following the same process as mentioned above, in your Android phone, open Settings and go to Network & Internet . Next, select Mobile Hotspot and Tethering and turn on the Mobile Hotspot . In your Linux system, again under the Network Connections , turn Wifi On

wifi tether turn on wifi

wifi tether settings

Here you can view all the available networks and connect with anyone by just entering the password available in your phone under Mobile Hotspot .

wifi tether settings connect

The Wi-Fi symbol in the top panel will now indicate that it’s connected.

Bluetooth Tethering

Yes! The bluetooth connection can be used not only to transfer data files but for passing on your phone’s internet connection to your Linux machine. Navigating through the Network Connections tab, switch on the Bluetooth on your Linux distro and go to Bluetooth Settings .

bluetooth tether turn on

Make sure you have turned on Bluetooth in your phone too. Both of your devices will discover each other so click on the device’s name and a confirmation pin message will show up on both of the devices. If the pin matches, click confirm and Bluetooth pairing will be established.

bluetooth tether pairing code

Now, again go to the Network Connections tab and under the paired device, here e9b7c69c , select the option to Connect to Internet .

bluetooth tether connect internet

The Bluetooth symbol in the top panel will now indicate that it’s connected.

Go ahead and explore the unlimited boundaries of the internet on your Linux system! Thanks to the unimaginable scope of technology, without a doubt, your cellphone will always be at your rescue whenever a sudden need of an internet connection is required to your system.

Help us improve this content by editing this page on GitHub

Источник

Оцените статью
Adblock
detector