Introduction
Bluetooth is an industry specification for wireless personal area networks created by the Bluetooth Special Interest Group, Inc. that enables voice and data transmission between different devices using a radio frequency link in the 2.4 GHz ISM band.Â
Industrial Shields Raspberry PLC has BLE wireless communication by default. It uses the 5.0 BLE version.
In this blog, you are going to learn how to setup the Bluetooth of your Raspberry industrial PLC.
 Related links
 Requirements
- Raspberry PLC >>
- Power supply >>
- HDMI cable and external monitor or Ethernet cable to connect to your Raspberry.
 Pairing mode on industrial Raspberry PLC
Once you have everything you need, let's test the bluetooth between your industrial Raspberry Pi PLC and an Android phone!
First of all, let’s set pairing mode on your Raspberry Pi industrial PLC.
sudo bluetoothctl
At the [bluetooth]# prompt, enter the following commands:Â
discoverable on
pairable on
agent on
default-agent
scan on
Wait for a message to appear showing the Android phone has been found:
[NEW] Device 12:23:34:45:56:67 devicename
Type pair with the mac address of your Android phone:
pair 12:23:34:45:56:67
On your Android phone and Raspberry Pi, confirm the passcode. Then run the following command in order to exit the bluetooth prompt:
quit
 Connecting mode on your Raspberry Pi PLC controller
To be able to get data from your Android phone, you must install a text-based modem control and terminal emulator program called minicom following the next instructions:
sudo apt update
sudo apt install minicom
Once minicom is installed, you will need to open the serial port using an Android app on your mobile phone:
- Go to the Play Store and install the "Serial Bluetooth Terminal" app.
- Tab on Devices and select the Raspberry Pi device.Â
If everything went fine, you will finally be able to establish communication between your Raspberry Pi based PLC and your Android smartphone!
Raspberry PLC & Android: How to set communication using Bluetooth