Showing posts with label wi-fi. Show all posts
Showing posts with label wi-fi. Show all posts

2017-05-13

Wi-Fi and Bluetooth USB dongles for Raspberry Pi 1 model B with Raspbian Jessie

Things got really improved since last time I've been trying to expand my Raspberry Pi 1 model B by Wi-Fi and Bluetooth.

I am still using cheap Chinese USB dongles. This time my Raspberry is running Raspbian Jessie.

  • 802.11n Wi-Fi dongle with Realtek's RTL8188EUS chipset
  • Bluetooth adapter compatible with Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) adapter.

Wi-Fi

To make Wi-Fi work, just add information about your network to /etc/wpa_supplicant/wpa_supplicant.conf file. Actually, you can add multiple networks. Raspberry will try to connect to the first available.

network={
    ssid="The_ESSID_from_earlier"
    psk="Your_wifi_password"
}

Maybe you will need to restart the interface by sudo wpa_cli reconfigure. Check out the official documentation.

Bluetooth

First of all, start the bluetooth console by typing bluetoothctl. Everything else will be done in the console.

agent on

default-agent

scan on
    ...here you should see the list of "pairable" devices
pair XX:XX:XX:XX:XX:XX

connect XX:XX:XX:XX:XX:XX
    ...in case you get following error Access denied: org.bluez.Error.Rejected in syslog,
       you need to "trust" the device.
trust XX:XX:XX:XX:XX:XX

2016-01-31

Wi-Fi and Bluetooth USB dongles for Raspberry Pi 1 model B

I wanted to expand my Raspberry Pi with Wi-Fi and Bluetooth capabilities. For this task I bought two cheap USB dongles on the AliExpress website. A 802.11n Wi-Fi dongle with Realtek's RTL8188EUS chipset and a USB Bluetooth adapter compatible with Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) adapter.

Both of these devices can be used with the latest version of Raspbian. Check out list of Raspberry compilant hardware:

First of all I had to upgrade Raspbian to latest version.

$ rpi-update

# Check out Raspbian's version
$ uname -a
Linux raspberrypi 4.1.16+ #833 Wed Jan 27 14:29:11 GMT 2016 armv61 GNU/Linux

$ sudo apt-get update & sudo apt-get upgrade

After upgrading I checked connected hardware:

$ lsusb
Bus 001 Device 004 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 005 ID 0bda:0179 Realtek Semiconductor Corp.

Then I configured configured connection to my Wi-Fi router guided by Oliver's article.

#/etc/wpa.config
network={
    ssid=""
    proto=RSM
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk=""
}

#/etc/network/interfaces
allow-hotplug wlan0
auto wlan0

iface wlan0 inet dhcp
wpa-conf /etc/wpa.config

Wi-Fi started working on reboot of Raspbian.

Installation of Bluetooth keyboard was quite easy as well. I followed steps described in Tyler's article. First I've installed bluetooth support into my Raspbian and then connected wireless keyboard via bluez tools.

# To scan nearby Bluetooth hardware ready to be paired
$ hcitool scan
Scanning ...
  7C:1E:52:AA:0B:E3 Microsoft Sculpt Wireless Keyboard
# To connect keyboard and to 
$ sudo bluez-simple-agent hci0 7C:1E:52:AA:0B:E3
$ sudo bluez-test-device trusted 7C:1E:52:AA:0B:E3 yes 
$ sudo bluez-test-input connect 7C:1E:52:AA:0B:E3