Raspberry PLC & Android: How to set communication using Bluetooth
Take the most out of your open-source hardware by using Bluetooth communication!
20 September, 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 the transmission of voice and data between different devices using a radio frequency link in the 2.4 GHz ISM band. 
Raspberry PLC has BLE wireless communication by default. It uses the 5.0 BLE version.
In this blog, we are going to learn how to setup the Bluetooth of our Raspberry PLC

 RELATED LINKS

How to

Connect Raspberry PLC to Wi-Fi


Raspberry PLC

Family products


Basics about

Raspberry Pi PLC
Analog Outputs


Touchberry Pi

Family products


 REQUIREMENTS

 PAIRING MODE ON RASPBERRY PLC

Once we have everything we need, let's test the bluetooth between Raspberry PLC and an Android phone!

First of all, let’s set pairing mode on your Raspberry Pi based 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 PLC

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 have 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 PLC and your Android smartphone!

Odoo • Image and Text
Raspberry PLC & Android: How to set communication using Bluetooth
Boot & Work Corp. S.L., Fernandez Queralt Martinez
20 September, 2021
Share this post
Archive

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

Do you want more information?

Just fill the form!

Tell me more!