Industrial IoT meets NB-IoT: Introduction to Revolutionary Pi Connect and Dragino Bee BC95

Today we will be diving into IIoT with RevPi Connect, which is a powerful IIoT solution from KUNBUS. Hence the name, RevPi Connect is a Raspberry Pi Model 3 based box, which allows developers and end users to implement their IIoT projects with its open platform concept and full access to root rights. Thanks to Raspberry Pi, this powerful box has a quad core CPU with 1.2 GHz clock frequency, 1 GB RAM and 4GB eMMC flash memory. Interface-rich design supplies 2x ethernet, 2x USB, RJ45, RS485, 1x micro USB and 1x micro HDMI ports. Key strength of RevPi is the possibility of expansion. There are several input/output modules that can be connected directly by using a simple connector. For more information and modules, please visit the official website of KUNBUS.

After setting up our environment, we will connect our Dragino NB-IoT Bee shield, which uses Quectel BC95 for narrowband communication. So, let's start with today's shopping list:

  1. Kunbus RevPi Connect
  2. Kunbus MDR Power Supply
  3. Dragino NB-IoT Bee w/ Quectel BC95 B8
  4. Grove Xbee Adapter
  5. 1NCE IoT Sim Card
  6. USB UART Converter
  7. Optional: RevPi DIO - No function for today, only shown as expansion module.

Connecting the RevPi

Power connections need to be done first. Be careful, take your own risk and follow the instructions on Kunbus official website. After that, we connected our setup by using ethernet port to our LAN. We used the Angry IP Scanner in order to find the IP address of the RevPi.

Using the SSH protocol, we can reach the RevPi. Open the terminal and type:

$ ssh pi@<IP_ADDRESS_OF_YOUR_DEVICE>
pi@<IP_ADDRESS_OF_YOUR_DEVICE>'s password:

Let's look at the RevPi user interface. As mentioned above, this part is only given as a reference. It will not be necessary for our NB-IoT show case. If you don't have RevPi DIO or any other module, you can skip directly to the NB-IoT Showcase part of this blogpost.

On the second picture of the gallery you can see on the left side of the PiCtory interface, you can see all the modules that you can combine with your RevPi. It is done by drag & drop action, be sure that you have selected the right side of your RevPi core module. Then you can rename your device and expansion modules on bottom side. On the left bottom, you can get-set-rename all the input and outputs, play with the PWM lengths and so on. You can also do that via terminal commands:

To get the port value:
$ piTest -r <port_name>

To set the port value:
$ piTest -w <port_name> <value>

NB-IoT Showcase

After several months of prototyping with NB-IoT protocol, we gathered a valuable know-how in this field. Narrowband protocol is one of the best protocols for IoT and IIoT applications, thanks to its low power consumption and low bandwidth usage. Now, let's combine RevPi and NB-IoT!

Here is our setup:

Connect the NB-IoT module directly to the USB input of RevPi Connect by using UART converter and find the responsible ports for RX/TX and GND/5V. Then, open your terminal and install the python on your RevPi, if you still don't have it:

$ sudo apt-get install python
$ python --version
Python 2.7.15rc1

It is time to install the narrowband library by doing:

$ pip install narrowband

After navigating to the narrowband folder, let's create a sample code in order to test the attachment:

$ nano test.py

Copy and paste the given code into your new test.py file:

import narrowband
nb = narrowband.Narrowband()
nb.attach()
while 1:
time.sleep(1)

Now please run the code:

$ python ./test.py

If you see the “attached” message, then you installed the components successfully. For more details, please visit narrowband library documentation.
It is another output after some coding that shows other methods in the library.
Because of the location and the thick walls, the connection process takes a while. It is possible that this takes not so long with your setup.
After several seconds, the connection is established.

Conclusion

Here it is! One way of expanding your IIoT solution is adding a new connection bridge, which was NB-IoT today. The RevPi is a powerful solution itself, for controlling the electronic units and devices, not only in industrial setups, but also for home automation. It is always important to choose the best NB-IoT module according to your needs as location, communication bandwidth and your budget.

Seite teilen