Raspberry PLC & Android: How to set communication using Bluetooth

Take the most out of your open-source hardware by using Bluetooth communication!
September 20, 2021 by
Raspberry PLC & Android: How to set communication using Bluetooth
Boot & Work Corp. S.L., Fernandez Queralt Martinez

 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

How to

Connect Raspberry PLC to Wi-Fi


Read >


Basics about

Raspberry Pi PLC Analog Outputs


Read >


Raspberry PLC

Family products


Read >


Touchberry Pi

Family products


Read >

 Requirements


 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:
  1. Go to the Play Store and install the "Serial Bluetooth Terminal" app.
  2. 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

​Search in our Blog

Raspberry PLC & Android: How to set communication using Bluetooth
Boot & Work Corp. S.L., Fernandez Queralt Martinez September 20, 2021

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 >>>