USB-type Wi-Fi adapter (dongle) LM808 and LM842 settings and why you dare to choose them

In addition to the built-in Wi-Fi function, computers can communicate wirelessly via a Wi-Fi adapter (also known as a dongle) that connects via USB.
In this issue, we will introduce an example of using a non-wireless model “PL-R4” with a USB-type Wi-Fi adapter attached.

The PL-R4 series of industrial-use Raspis includes a model that incorporates the Raspberry Pi Compute Module 4 with Wi-Fi as usual, as well as a model that is not wireless-compatible.

Non-wireless models are also in demand. This is because there are some industrial sites where Wi-Fi is not or cannot be used depending on the application. The PL-R4 is wired as standard, and Wi-Fi is an optional extra.

Originally, the Raspberry Pi ComputeModule (CM) series is a lineup of products that can be selected with or without Wi-Fi, eMMC, and memory capacity.

*Non-wireless models of the PL-R4 are shipped with WiFi set to disabled and the antenna unmounted.

Possibility of not being bound by technical compliance issues

The situation where you dare not use the Raspberry Pi built-in Wi-Fi function may be special because the commercially available Pi 4 and Pi 5 cannot remove the Wi-Fi function.

In Japan, wireless communications such as Wi-Fi and Bluetooth must comply with the Radio Law, which is called Technical Regulations Conformity Certification (GITEKI). This law exists in every country, although the name differs.

The Raspberry Pi itself has also been certified as compliant in many countries and regions, but there is a time lag until certification in some countries. Japan is also very slow.
Depending on your business, you may want to use the Raspberry Pi in a country or region that has not been certified as compliant in the first place.

This is where the need for a USB-based Wi-Fi adapter comes in.

The two products presented here are products that have been certified as compliant in many countries and regions.

Regardless of the Raspberry Pi’s wireless compatibility certification, the Raspberry Pi CM, which does not have Wi-Fi functionality, can also be made wireless by adding the USB Wi-Fi adapter.

For example, if the Raspberry Pi CM5 has just been released, it is not immediately certified for technical compliance in Japan. However, the Raspberry Pi CM5 without Wi-Fi can be used without any problem. In fact, the CM5 without Wi-Fi functionality was immediately available in Japan.

Conversely, even if the technical compliance in Japan has been certified, there will be situations where the product is not certified overseas where you actually want to use it.
If the USB Wi-Fi adapter is a compliant product, it can be used overseas without modification after Wi-Fi setup and verification in Japan.

There may be other situations where an industrial Raspi was introduced as an environment that does not require Wi-Fi, but circumstances have changed and a Wi-Fi communication environment is temporarily needed. The simplicity of retrofitting is one of the reasons why Raspi is chosen.

Advantages of USB-based Wi-Fi Adapters

There are other advantages to using this Wi-Fi adapter product with the industrial Raspberry Pi.

  • Low additional cost
  • Available by simply plugging in the driver
  • Works well on LinuxOS

LM808 and LM842 Wi-Fi adapters from LM Technologies Ltd.

In this case, we tested the LM808 and LM842 from LM Technologies.

The major difference between the LM808 and LM842 is that the LM842 has Bluetooth capability.
The operating temperature is safe for industrial use, and the wide range of supported operating systems is also helpful.

See the manufacturer’s page for details.
Here is a brief introduction to the specifications.

LM808LM842
Wireless methodac/a/b/g/nac/b/g/n
BluetoothNone5.0/4.2/4.1/4.0/3.0/2.1
frequency band2.4GHz/5GHz2.4GHz/5GHz
Operating temperature0°C to 70°C-20°C to 85°C
Supported OSLinux
OSX
Win10
Win7
Win8
WinVista
WinXP
Android
Linux
Win10
Win7
Conformancecompatibility1compatibility1

The company is trusted as a manufacturer with a proven track record worldwide, as its products are widely legalized in many countries.
I see that the Japanese technical certification mark is also listed.

Countries and regions with conformity certification

*Please check directly with the manufacturer regarding the application and renewal status of certification in each country.

LM808

  • Turkey
  • Sint Maarten (Dutch part)
  • Honduras
  • Dominican Republic
  • Indonesia
  • Paraguay
  • El Salvador
  • Guatemala
  • Bahama
  • Brazil
  • European Union
  • Saudi Arabia
  • Bahrain
  • Eurasian Economic Union
    (Russia, Belarus, Kazakhstan, Armenia, Kyrgyzstan)
  • Argentina
  • United States of America
  • Canada
  • South Africa
  • Singapore
  • Korea
  • India
  • Israel
  • Morocco
  • Thailand
  • Taiwan
  • Mexico
  • Australia and New Zealand
  • China
  • Costa Rica
  • Japan

LM842

  • Turkey
  • Indonesia
  • Pakistan
  • Brazil
  • United Kingdom
  • European Union
  • Eurasian Economic Union
    (Russia, Belarus, Kazakhstan, Armenia, Kyrgyzstan)
  • Argentina
  • United States of America
  • Canada
  • South Africa
  • Singapore
  • Korea
  • India
  • Thailand
  • Taiwan
  • Mexico
  • Philippines
  • Malaysia
  • Australia and New Zealand
  • China
  • Japan
  • United Arab Emirates
  • Vietnam

Prepare device drivers

I immediately tried it from LM808.

Environment: Raspberry Pi CM4 64bit Bookworm

These devices require drivers to be installed first.

Try running the lsusbcommand after inserting the LM808 into the USB port.

The USB Wi-Fi adapter is recognized just by plugging it in.
The manufacturer of the product is LM Technologies, but we found that the chip on board is the RTL8811AU made by Realtek.

Bus 001 Device 008: ID 0bda:a811 Realtek Semiconductor Corp. RTL8811AU 802.11a/b/g/n/ac WLAN Adapter

The driver is on the manufacturer’s website, and I found that it is compatible with Windows/Linux/Android/MacOS.

Do not use drivers from the manufacturer’s site

As a conclusion, the driver was old and could not be installed properly on Raspi.
This driver is a 2019 release and the install script is out of date as of 11/21/2011 and gives compile errors.
This is not surprising since ARM 64-bit was not released for the Raspberry Pi OS at that time.

Install RTL8811AU driver

Realtek 802.11ac (rtl8812au) on github. The update is in 2022. There is also an option for Raspi (ARM64).
I compiled and installed this one and it works.

github: https://github.com/gnab/rtl8812au

First, update apt and install the necessary modules.

sudo apt update
sudo apt install raspberrypi-kernel-headers build-essential bc dkms git

The build-essentialand bcrequired for compilation were already up-to-date with the Raspberry Pi OS. (At the time of writing)

git clone in working directory

This time, I created a directory as lm808 and git clone inside.

mkdir lm808
cd lm808
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au

Modified for Raspi

This repository is made after the Makefile in the contents of the git cloned directory is modified for Raspi.

Kconfig    core       hal          install.sh    project        runwpa
Makefile   debian     ifcfg-wlan0  module.clean  repoTest1.js   wlan0dhcp
README.md  dkms.conf  include      os_dep        repoTest2.htm

This time it is 64bit, so the edited part is line 57 and 64 of Makefile. 32bit version is ARM_RPI and it is line 63.
Change I386_PC to n and ARM_RPI_64 to y.
For Linux means general Linux, so it is set as i386 PC. Because it is configured as an i386 PC.

Contents of MakeFile

CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI_64 = y

It can be opened and edited with the command sudo nano Makefileor rewritten with the sed command.

To rewrite the relevant section using the sed command, do the following

sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM_RPI_64 = n/CONFIG_PLATFORM_ARM_RPI_64 = y/g' Makefile

Driver Installation

Once the modifications are complete, install the software; instead of using the make command, there is a script file for installation. You can run the script as it is, since you have been granted execute permission.

sudo ./install.sh

At the end you will be asked for Do you wish to activate the module now? (y/n)and you can activate it with y or just reboot it.
After rebooting you will see wlan0 (Wi-Fi/Wireless).

Installation with dkms

This install.sh did not install using dkms. when I ran dkms, I was warned, probably because I did not have the original module originally. (WARNING! Diff between built and installed module!).

Run in the directory where you github clone.

sudo make dkms_install

Status check command

sudo dkms status

Driver removal commands

sudo make dkms_remove

It looks fine for now, so I’m leaving it as is, but I don’t know if it will be when the kernel is upgraded.
Installing with dkms makes driver management easier. It works even if you don’t use it.
This is the end of driver installation for now.

New connection type and connection settings

As it is, there is no Wi-Fi entry in the connection type. Only a wired connection.

In order to connect as a Wi-Fi network with the LM808, a new connection type destination must be created.
While creating the new connection destination, you will also set up the Wi-Fi connection.

The command is as follows.
 The three locations are optional and should be changed according to the environment.

  • con-name “LM808”
  • wifi.ssid “SSID you want to connect to”
  • 802-11-wireless-security.psk “SSID connection password”

The current Raspberry Pi OS uses NetworkManager, which is configured with the nmcli command.

nmcli command example

sudo nmcli connection add con-name "LM808" \
type wifi \
ifname wlan0 \
connection.autoconnect yes \
wifi.mode infrastructure \
wifi.ssid "SSID to connect" \
802-11-wireless-security.auth-alg open \
802-11-wireless-security.key-mgmt wpa-psk \
802-11-wireless-security.psk "SSID connection password" \
ipv4.method auto \
ipv4.never-default no \
ipv6.method disabled

If your Raspberry Pi has a desktop environment, you can also create an additional one from the network icon in the menu bar.
(Advanced Options — > Edit Connections — > Select Wi-Fi from the Plus icon)

However, the command seemed easier because it was surprisingly difficult to know where to fill in what.

Confirmation

If you look at the nmcli device command, you will see that it is in the process of acquiring the device, and then it will be connected. Now you can see the IP address is assigned with the ip command.

nmcli device command

DEVICE  TYPE      STATE            CONNECTION 
wlan0   wifi      Connecting (getting IP configuration)  LM808
↓
wlan0   wifi      connected         LM808

ip a command

4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 34:c9:f0:90:6f:90 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.73/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0
       valid_lft 86157sec preferred_lft 86157sec

This completes all the Wi-Fi connection settings for the LM808.
I think you are already connected to Wi-Fi.

For LM842

LM842 is almost the same as the method we have described so far.
I checked with lsusb and looked up the pro-facto & vendor ID (0bda:c82c) and it was apparently RTL8821cu.
Since the chips are different, it is not convenient for the drivers to be the same.

Bus 001 Device 004: ID 0bda:c82c Realtek Semiconductor Corp. 802.11ac NIC

I checked the drivers available from the manufacturer and they were from 2020; if you want to use the LM842 with Android, you should install the manufacturer’s drivers.
In this case, it is a special Raspberry Pi, even though it is Linux, so I will have to find another driver. (*We have not tried the manufacturer’s driver for LM842)

Here are a few repositories from which we have had no problems installing some of the drivers.

I used the following github repository:
github: https://github.com/morrownr/8821cu-20210916

git clone https://github.com/morrownr/8821cu-20210916.git

This was a different repository than the previous one, and here, too, the install-driver.sh was given execution rights, so it was OK to run it as is.

The Makefile had AUTO_DETECT=y, and github also stated that it was confirmed to work with Raspberry Pi OS 64-bit bookworm, so it was safe to run it as is.
As with LM808, if the necessary modules are installed first, the sh file alone can be installed without problems.

Install necessary modules

sudo apt update
sudo apt install raspberrypi-kernel-headers build-essential bc dkms git

Continue by executing the sh file and you are good to go.

sudo ./install-driver.sh

This installation script will ask you at the end, “Do you want to edit the driver options? You will be asked, “Do you want to edit the driver options at the end of the script?
Do you want to edit the driver options file now? (recommended) [Y/n]

You can open /etc/modprobe.d/8821cu.confwith a “y” and edit it, or skip it with an “n”.
You will then be asked if you want to reboot. You will then be asked if you want to restart.
Do you want to apply the new options by rebooting now? (recommended) [Y/n]
y to restart and you are good to go.

Note that as a precaution, it indicated that if the OS or kernel (kernel) is upgraded, git pull and re-install. That is very kind.

Update this driver with the following commands as needed:

$ git pull
$ sudo sh install-driver.sh

This repository was installed in one shot with a script without any configuration changes for Raspi.
It will end without a hitch.

Since dkms was used in the installation of the LM842 driver, it shows up neatly when examined with the status command.

sudo dkms status 

rtl8821cu/5.12.0.4, 6.6.62+rpt-rpi-v8, aarch64: installed

With this, the driver can be removed with the dkms command.

LM842 bluetooth communication

The LM842 has Bluetooth as well as Wi-Fi.
Unlike Wi-Fi, this one is a bit more complicated.

I tried several connections using Bluetooth.

Is Bluetooth locked?

First of all, Bluetooth cannot be used if it is locked.

Let’s check it with the rfkill list command.

rfkill list

0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: hci1: Bluetooth
    Soft blocked: yes
    Hard blocked: no
2: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

Bluetooth in hci1 is soft blocked. This time LM842 is hci1.
I have to unblock this.
Otherwise, you will get org.bluez.Error.Failedat sudo bluetoothctland nothing will work.

Unblock with the following command

rfkill unblock bluetooth

This is OK.

Try Bluetooth connection (1) – Mouse

The first was tested with a mouse.
The Logitech “Pebble” mouse can be connected via a Wi-Fi dongle, but it also has Bluetooth.
In this case, I used the Bluetooth connection. This eliminates the need for a USB receiver, freeing up one USB port.

Logitech Pebble mouse
Flashing green for Wi-Fi, flashing blue for Bluetooth

Since the GUI screen did not work well, we still proceeded on a command basis.

Pairing with the bluetoothctl command.

sudo bluetoothctl

When the command prompt changes to [bluetooth]#, run the commands in order from the top.

power on
discoverable on
scan on
trust MAC address of the mouse

Scanning detects a Logitech mouse.
You will find a Pebble notation in the zoo list. Copy this MAC address.
Here, the MAC address was ED:53:18:B3:42:B4.

Next, connect and pair it with the mouse and trust (Trust) it so that you do not have to pair it every time.

connect ED:53:18:B3:42:B4 
pair ED:53:18:B3:42:B4 
trust ED:53:18:B3:42:B4 

It can now already be used as a Bluetooth-connected mouse.

Let’s check the information.
The prompt changes to [Logi Pebble]#when you connect, so if you hit info, you can see the Pebble information and check the details.

[Logi Pebble]# info
Device ED:53:18:B3:42:B4 (random)
    Name: Logi Pebble
    Alias: Logi Pebble
    Appearance: 0x03c2
    Icon: input-mouse
    Paired: yes
    Bonded: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    LegacyPairing: no
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
    UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
    UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
    Modalias: usb:v046DpB021d0007
    RSSI: -41
    TxPower: 4
    Battery Percentage: 0x64 (100)

This was easy because of the mouse connection.

Try Bluetooth connection (2) – Tethering with iPhone

The next thing I tried was internet sharing tethering.
If you allow internet sharing on your iPhone, you can connect to the internet through your iPhone’s line from a Raspberry Pi paired via Bluetooth. Android works the same way. Please read it as a replacement.

Configuration Flow

The LM842 driver is discussed after installation as shown in the first half of the article.
Furthermore, it is assumed that a Bluetooth connection is available, which was done before the mouse was connected to the Bluetooth connection mentioned earlier.

  1. Pairing on the Raspberry Pi side (bluetoothctl command)
  2. Disconnect from Wi-Fi
  3. Connect to iPhone with nmcli command

XX:XX:XX:XX:XX:XX:XX:XX:XX is the MAC address of the iPhone but is only hidden.
The MAC address of the iPhone can be found in Settings– > General– > Information


It is not disclosed, but the Bluetooth MAC address is required.

Pairing

Do scan onwith sudo bluetoothctlas you did with the mouse. If you can’t, then do the same as before, starting with power on.

[bluetooth]# pair XX:XX:XX:XX:XX:XX
Attempting to pair with XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
Request confirmation
[agent] Confirm passkey 214271 (yes/no): yes

At the same time that the confirmation passkey is displayed in the terminal, the iPhone side will also display a screen asking if you want to approve it.

After pressing pairing on the iPhone side, type yes/no in the terminal yes/no and confirm with the Enter key. Pairing successfulwill appear in the terminal.
Pairing is now complete.

Disconnect from Wi-Fi

As it was still connected to the LM842 Wi-Fi connection, the Wi-Fi connection is temporarily disconnected.
This is because it is easy to tell that a Bluetooth connection is made if it is alone.

If you are on the desktop screen, you can disconnect by clicking the name of the SSID you are connected to from the top menu bar Wi-Fi icon.
command, you can use nmcli’s radio option to disconnect.

sudo nmcli radio wifi off

3. connect with nmcli command

Now that we have paired the device, let’s try to actually connect it.
Please turn on Internet sharing on your iPhone first.

Next, connect by specifying the iPhone’s MAC address in a command on the Raspberry Pi side.

sudo nmcli dev connect XX:XX:XX:XX:XX:XX

If successful, the message “~ successfully activated.
You will also see a dialog on the desktop screen of the Raspberry Pi that the connection is complete.
Connection can also be made by simply clicking on the Bluetooth icon from the top menu bar of the desktop screen and selecting the name of the iPhone.

Check with status.
You can see that the TYPE of the MAC address of the iPhone is already connected with bt.

sudo nmcli dev status

DEVICE             TYPE      STATE            CONNECTION                    
XX:XX:XX:XX:XX:XX  bt        接続済み         XX:XX:XX:XX:XX:XX 

You can see that the iPhone side also shows an Internet sharing icon, meaning that the connection is tethered. There will also be a color bar at the top.

The Wi-Fi connection is also disconnected, indicating that a tethering connection is available.
The Wi-Fi symbol has been replaced by a cell phone icon!

The green check mark indicates that the mouse and iPhone are connected to the Bluetooth device.
I tried displaying a page from Yahoo!
Tethering via Bluetooth is not suitable for regular web browsing, but for light text-based connections, it is stable and no problem.

Now we have tethering (internet sharing) via Bluetooth connection.

Feeling of LM808 and LM842

I managed to understand it because I am interested in the networking area. It is a bit difficult.
Not everything is written here, and there may still be some parts missing depending on your environment. Generally, I think you can connect as described here.
If you can’t, it is possible that the Wi-Fi adapter driver is not installed with an error.

Bluetooth tethering done with the LM842 has nothing to do with the iPhone’s Wi-Fi, but simply makes a Bluetooth connection to the Raspberry Pi.
So the Raspberry Pi is connected to the Internet via the iPhone’s functionality.
This is a bit of a complicated area.

The LM808 is a handy way to add Wi-Fi functionality and is recommended if you are satisfied with the ac/a/b/g/n specifications.
Since both products have been certified for devices in many countries and regions, you may feel that they are too good to be used only in Japan. However, since they are products of a manufacturer with a proven track record, they should be candidates for business use in the sense of security.

I found the Wi-Fi adapter convenient for the CM4/5, which does not have Wi-Fi capability.

Product page
LM808: https://www.lm-technologies.com/product/wifi-usb-adapter-433mbps-lm808/
LM842: https://www.lm-technologies.com/product/wifi-802-11ac-bluetooth-5-0-2t2r-usb-combi-adapter-lm842/

NetworkManager
Official: https://networkmanager.dev/
Reference: https://wiki.archlinux.jp/index.php/NetworkManager


Article contributed by Raspida

Raspberry Pi information site that even non-engineers can enjoy using raspida.com a Raspberry Pi information site that even non-engineers can enjoy and handle. He also contributes technical blog articles to the PiLink site on the Raspberry Pi for industrial use.