RPi PLC WiFi boost with an external USB antenna

July 8, 2024 by
RPi PLC WiFi boost with an external USB antenna
Boot & Work Corp. S.L., Martí Schnabel

WiFi Signal Challenges with Raspberry PLCs

In certain scenarios, the WiFi signal of a Raspberry PLC might prove inadequate for specific tasks, such as real-time data streaming, remote monitoring of critical processes, or large file transfers.

In this blog post, we will explore a solution to this challenge: the use of an external antenna to enhance the WiFi signal strength of Raspberry Pi PLCs. We will delve into the benefits of this approach, the considerations to keep in mind, and a step-by-step guide on how to implement it effectively.

The antenna that will be used in this blog is the BrosTrend AC650 AC5L. It is an external dual band long range USB antenna compatible for Windows, MAC and Linux.

Requirements

The requirements to follow this post are:

  • Raspberry PLC from Industrial Shields
  • BrosTrend AC650 AC5L Wi-Fi antenna
  • 12-24V power supply

Guide

Installation

The BrosTrend antenna needs some drivers to work with the Raspberry PLC. Following their installation guide, you will need to:

1. Update and reboot your system:

sudo apt update
sudo apt upgrade
sudo reboot

2. After rebooting the system, insert the Wi-Fi adapter into a USB slot.

3. Execute this command to install the drivers:

sh -c "wget -O /tmp/install && sh /tmp/install"

4. If the driver installation was unsuccessful, it might be due to the Raspberry Pi image change of March 2023, where the 64-bit kernel is loaded by default instead of 32-bit. You can resolve this by executing the following commands:

sudo -i
sed "/arm_64bit/d" -i /boot/config.txt
printf "[pi4]\narm_64bit=0\n" >>/boot/config.txt

And reboot the device to make sure that the changes are applied.

Wi-Fi Signal Comparison

Once the drivers are installed and the antenna is plugged into the PLC, you should be able to view the configurations of the connected antenna and compare them with the internal PLC antenna.

Use the command iwconfig to display the parameters of the network interface specific to wireless operation. You will see wlan0, which is the internal PLC antenna interface, and wlan1, which refers to the external USB antenna.

In a test done with a Raspberry PLC 50RRA+, this were the results:

lo        no wireless extensions.


eth0      no wireless extensions.


wlan0     IEEE 802.11  ESSID:"BOOT&WORK"  

          Mode:Managed  Frequency:5.18 GHz  Access Point: 00:4E:35:D7:5C:10   

          Bit Rate=351 Mb/s   Tx-Power=31 dBm   

          Retry short limit:7   RTS thr:off   Fragment thr:off

          Power Management:on

          Link Quality=46/70  Signal level=-64 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


eth1      no wireless extensions.


wlan1     IEEE 802.11AC  ESSID:"BOOT&WORK"  Nickname:"<WIFI@REALTEK>"

          Mode:Managed  Frequency:5.18 GHz  Access Point: 00:4E:35:D7:5C:10   

          Bit Rate:434 Mb/s   Sensitivity:0/0  

          Retry:off   RTS thr:off   Fragment thr:off

          Power Management:off

          Link Quality=76/100  Signal level=39/100  Noise level=0/100

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

As observed, both wlan0 and wlan1 are connected to the same network, but there are some differences:

  • Bit Rate: ​wlan0 has a bit rate of 351 Mb/s, while wlan1 has a bit rate of 434 Mb/s. This indicates that wlan1 has a higher data transfer rate capability.
  • Link Quality: wlan0 has a link quality of 46/70, while wlan1 has a link quality of 76/100. Higher link quality indicates a stronger and more stable connection.
  • Signal Level: Signal level for wlan0 is -64 dBm, and for wlan1 is -39 dBm. A lower signal level (closer to 0) indicates a stronger signal.

Overall, the external antenna provides superior signal strength, link quality, and data transfer rate compared to the internal PLC antenna.

​Search in our Blog

RPi PLC WiFi boost with an external USB antenna
Boot & Work Corp. S.L., Martí Schnabel July 8, 2024
Share this post

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>