Bleuio Firmware Update V2.0.8 with Indication and Notification

BleuIO released a new firmware version 2.0.8 on October 22, 2021, introducing new features and enhancements to improve productivity. You can download the updated firmware from

https://www.bleuio.com/getting_started/docs/firmware/

Following features has been added to this release 

  • Added support for indication type notifications.
  • You now have more control over indications and notifications. Notifications and indications will only show if you have enabled them. An exception is when connecting to another BleuIO Dongle; it will still enable the required notifications used by the SPS service. You can manually disable them if you want with the AT+CLEARNOTI command.
  • Added a new command AT+SETINDI that will allow you to enable indications.
  • Added a new command AT+CLEARINDI that will allow you to disable indications.
  • Added a new command AT+NOTI that will show a list of enabled notifications and their connection.
  • Added a new command AT+INDI that will show a list of enabled indications and their connection.

Indications and Notifications

Indications and Notifications are a way for a GATT Client to subscribe to data provided by a GATT Server. A client has to configure Indications and Notifications for a characteristic’s value through its client characteristic configuration descriptor to get notified every time a characteristic’s value gets updated on the server.

  • Indications need to be acknowledged by the client. The server does not send the following indication until it gets the acknowledgement back from the client. The client sent a confirmation message back to the server; this way server knows that message reached the client. Hence communication via indications is slower.
  • Notifications don’t need to be acknowledged, so they are faster. Hence, the server does not know if the message reaches the client.

Indications and Notifications are essential mechanisms for receiving server-side data because they are the only and fastest mechanisms for receiving asynchronous server-side updates. Since Bluetooth Low Energy was designed to be energy efficient, this asynchronous method of receiving updates prevents continuous polling of the server by the client and, hence, is a huge energy saver too.

Share this post on :

Build your own firmware for BleuIO – An advertising example

The BleuIO is Bluetooth low energy USB dongle that can be used to create new BLE 5.0 applications in the fastest and easiest way. The BleuIO comes with a bootloader that allows you to update the firmware or flash your own application to the dongle. 

This guide will show you how to get started with making your own firmware for the BleuIO Dongle by importing our advertising example project and running it on the BleuIO dongle.

Introduction

This project has both USB CDC and BLE in Peripheral Mode. This allows you to create your own command interpreter that takes in commands to the Dongle via a serial terminal. You can then use this to execute BLE tasks such as start set advertsing or response data, start and stop advertsing etc.

The project, like the previous, uses FreeRTOS and handles the usb cdc functions in the usb_cdc_task located in the usb_cdc.c:

USB CDC task!

And the ble functions in the ble_peripheral_task located in ble_peripheral_task.c:

The example will start advertsing and is connecteble. It also has the Device Information Service (DIS) with some default values taken from Dialog Semiconductor’s ble_peripheral example. This and the advertising data can be changed in ble_peripheral_task.c:

DIS Service and Advertising Data!

Setup

Download the example project HERE (bleuio_advertising_example.zip or you can clone it from Github at https://github.com/smart-sensor-devices-ab/bleuio_ble_advertising_example.git

Follow the guide for Build Your Own Firmware to import and build the project.

Running the Application

  • When running the example it will, just like the previous example, open a com port that will echo what every you type into the terminal. It will also start advertising with the name “BleuIO Example”.
  • You can scan for it using another dongle with the BleuIO firmware or download a BLE scanning App like ‘BLE Scanner’ or ‘LightBlue”.BLE Scanner!
Share this post on :

Build your own firmware for BleuIO

Introduction

The BleuIO is Bluetooth low energy USB dongle that can be used to create new BLE 5.0 applications in the fastest and easiest way. The BleuIO comes with a bootloader that allows you to update the firmware or flash your own application to the dongle. 

This guide will show you how to get started with making your own firmware for the BleuIO Dongle by importing our example project and running it on the BleuIO dongle.

The project itself is a modified version of Dialog Semiconductor’s ‘usb_cdc’ example project made to work on the BleuIO Dongle.

The ‘usb_cdc’ example will echo anything typed in the terminal back.

Setup

Importing project

  • Open Smart Snippet Studio and when prompted, select the SDK you just downloaded: 

    Selecting SDK in Smart Snippet Studio!
  • Now click the IDE: 

    Open IDE in Smart Snippet Studio!
  • Right-Click in the Project Explorer window and select import: 

    Import project  in Smart Snippet Studio!
  • Select ‘Projects from Folder or Archive’ under the ‘General’ tab: 

    Import Projects from Folder!
  • Click the ‘Directory…’ button and find the ‘bleuio_own_application_example’ project folder inside your SDK folder: 

    Select bleuio_own_application_example!
  • Finally, click ‘Finish’. You have now imported the project!

Building project and creating an image file

  • To create an image file that you can use to flash to the BleuIO Dongle via the bootloader, you must first build the project to create a bin file. To do that, click the ‘Hammer’ icon in the toolbar. Be sure to build the project for DA14683. Build Project!
  • Dialog Semiconductor has a file called mkimage.exe included in the SDK for generating image files. It can be run using the mkimage.bat file located at [SDK_Root]\utilities\scripts\suota\v11. It needs to point to the bin file you want to generate an image file from.
  • You can open up the command prompt in the same folder and run mkimage.bat like this:
mkimage.bat ..\..\..\..\bleuio_own_application_example\DA14683-00-Release_QSPI\bleuio_own_application_example.bin
Copy

You should now have an image file inside your build folder DA14683-00-Release_QSPI named bleuioown_application_example.1.0.0.1.img that can be flashed to the BleuIO Dongle using the ‘_host_usb_updater.exe‘ (More info about updating the firmware: [Firmware Update](../firmware#How to update your firmware)).

Running the Application

  • After you flashed the firmware to a BleuIO Dongle, open up a Serial Communication program (like TeraTerm, Putty or CoolTerm etc.), just like you would with the BleuIO Firmware. When first started you should be greeted by this: 

    Running Example!
  • If you type any text, the application will now echo what you type in the terminal.
Share this post on :

Bleuio Firmware Update V2.0.7

A new firmware update v 2.0.7 has been released for BleuIO and Smart USB Dongle 2.0. You can download the updated firmware from
 https://www.bleuio.com/getting_started/docs/firmware/

Bugfixes:

  • Problem sending over 99 bytes using AT-commands “AT+GATTCWRITEB” and “AT+GATTCWRITEWRB” resulted in an unexpected behaviour. 

To meet the demands of users, the BleuIO team will continue to update and add new features. To find out more about the updates of the dongles new firmware 2.0.7, please visit our Getting Started Guide

Share this post on :

A faster way to new Bluetooth® applications

Swedish IoT company Smart Sensor Devices AB believes developing new Bluetooth applications should be as easy as using them. That’s why they created the BleuIO Bluetooth Low Energy USB dongle – a smart, highly integrated device that lets developers create new BLE 5.0 applications with minimal effort.

Founded in 2016, Smart Sensor Devices provides products and data services for indoor and outdoor applications, mainly in the business-to-business (B2B) sector. This offering is built around its own Internet of Things (IoT) sensor platform, using connectivity based on industry standards such as Bluetooth, Wi-Fi and LTE-M/NB-IoT.

“Our full stack approach gives our customers a complete plug-and-play solution so they can easily start collecting and analyzing sensor data. Thanks to this ease of use, we have been able to establish ourselves as an IoT connected sensor supplier worldwide during the last year,” says CEO Axel Hammar.

Plug-and-play applications

That commitment to ease of use is perfectly demonstrated in the company’s BleuIO Bluetooth Low Energy USB dongle. It offers a quick and easy way to create new BLE 5.0 applications with minimal development effort.

Targeting both B2B and B2C markets, the BleuIO dongle can be used to create peripherals, central applications or both. It offers the latest in Bluetooth security, and is suitable for secured identity and payment applications. With integrated Flash memory and a bootloader, it supports in-field firmware and application upgrades – while custom settings can be stored in Flash or one-time programmable (OTP) memory for greater integrity.

An easy-to-use solution

At the heart of the BleuIO dongle is Dialog’s SmartBond DA14683 high-security, single-chip Bluetooth solution. This combines an ARM microcontroller and Bluetooth 5.0 radio in one energy efficient chip.

“We created a quick, innovative and user-friendly Bluetooth USB dongle based on Dialog’s DA14683 Bluetooth chip and AT commands example. The DA14683 provided a real advantage in power consumption and bill of materials component count while also delivering excellent performance,” Hammar explains.

The use of Smart Sensor Devices’ version of the Dialog AT commands, greatly simplifies development for BleuIO customers. They can develop complete Bluetooth applications without writing a single line of code. Developers can also take advantage of Smart Sensor Devices’ own Python / JavaScript libraries.

Growing market success

This ease of use has already generated market interest in the BleuIO dongle, leading to its use in a range of applications. For example, Swedish air conditioning expert InventiAir is using the dongle in its InventiAir Digital program to digitalize its products and services for even greater energy savings. Within this program, the dongle allows data to be exchanged between ventilation systems and an app on the user’s portable device to control ventilation across multiple units.

Elsewhere, Ipoxo is using the BleuIO dongle as hardware platform for its Phrase Lock USB key password manager. By adding its own software application on top of the dongle’s hardware, Ipoxo has created a brand new product that its own customers can further customize to deliver secure login keys that protect data, people’s identities and IT systems.

Building on such early successes, Smart Sensor Devices is now ready to scale up business in selected sales regions and transition to a stable higher level of business.

“Dialog have always given us outstanding support from all parts of their organization, bringing innovative solutions to our market challenges that help our business move forward and grow. Our company wouldn’t be in as strong a position today without Dialog’s support,” Hammar adds.

BleuIO:
BleuIO is Bluetooth low energy (BLE) USB dongle that can be used to create new BLE 5.0 applications in the fastest and easiest way.
Just use the AT Commands available on the device or use our Python/Javascript libraries for faster development.


InventiAir:

InventiAir´s unique, well-proven ventilation technology and solutions offer a range of benefits.
Our system provides better air circulation, cleaner air and an ideal indoor climate.
At the same time, it´s possible to reduce the power consumption of your property’s ventilation system, increasing efficiency and lowering costs.

iPoxo IT GmbH:
IPoxo provides Phrase-Lock USB-Keys which enables entering passwords into your computer with the mobile phone with strong security.
Integrate Phrase-Lock USB-Keys into your own app following our API. To make integration easier for you, we provide libraries for iOS and Android.

Share this post on :

Update BlueIO firmware using RaspberryPi

The BleuIO comes with a bootloader to allow you to update the firmware or flash your own application to the dongle. To flash the dongle, you will need an image file containing the new firmware or your own application and a host USB loader application.

You can download the latest firmware, and host USB loader from our getting started guide.

This article will explain how to update a BleuIO dongle using a RaspberryPi.

Connect the BleuIO dongle to your Linux / RaspberryPi.

Dongle

To identify which device name the dongle is connected to, you will need to run ls /dev on the terminal.
You might need to do it twice, once before you connect the dongle and once after, to be able to identify which one is the device name.

The following screenshot shows devices list before and after connecting the dongle.

The BleuIO includes a bootloader that allows you to update the firmware easily. When starting up, the dongle will open up a COM port for the bootloader for 10 seconds to allow you to update the firmware (or flash your own application). Afterwards, it will close that port and open a new port for the BleuIO application. 

Now that you know the device name, you can run the following command to update the dongle. 

sudo ./host_usb_updater /dev/ttyACM0 ./example_firmware.img -verbose 

The /dev/ttyACM0 means USB-CDC driver of Linux.

NOTE: The device name may vary and may not be the same as in the picture above.

After running this command successfully, you will see Result: Pass on your terminal.  

Share this post on :

Location analysis using Bluetooth Low Energy

Distance to a Bluetooth device can be measured using RSSI value. The following script will help you locate nearby unique BLE devices within a selected range.

This script scans for nearby unique Bluetooth devices within the given range using a well-known RSSI to distance formula. 

Requirments

Instructions

git clone https://github.com/smart-sensor-devices-ab/device_within_range.git

Go inside the folder type in terminal

parcel index.html

The script will scan for five seconds for nearby devices within range. You can update the value based on your requirements.

You can also run this script from online at

https://smart-sensor-devices-ab.github.io/device_within_range/dist/index.html

**Make sure your BleuIO dongle is connected

Read more about how to calculate the distanceHow to Calculate Distance from the RSSI value of the BLE Beacon

Share this post on :

UC awards Smart Sensor Devices the Nordic Growth Company award

Smart Sensor Devices was awarded the Nordic Growth Company award from UC for success in the financial year 2019/2020. The company is doing steady and robust development and growth. The award was given for efforts during the previous financial year. The company sees a continued positive development and sales have increased compared with the previous financial year.

“The development is very positive with steady growth during the current financial year. Demand for our products and services has increased in the recent period for all our offerings,
We are very gratefully for all our new customers” says Axel Hammar, Founder & CEO of Smart Sensor Devices.

Share this post on :

Bleuio Firmware Update V2.0.6

A new firmware update v 2.0.6 has been released for BleuIO and Smart USB Dongle 2.0. You can download the updated firmware from
 https://www.bleuio.com/getting_started/docs/firmware/

Added features:

  • Added a new command AT+CLEARNOTI that will clear notification for the selected handle. For example AT+CLEARNOTI=0012
  • Updated command for AT+GAPCONNECT. Now you can set Connection interval,Slave latency,Connection supervision timeout while connecting to a peripheral. 

Understand BLE connection parameters

For a BLE connection, The connection parameters determine when and how the Central and a Peripheral in a link transmits data. The Central always sets the connection parameters; however, the Peripheral can send a Connection Parameter Update Request that the Central can accept or reject.

There are basically three different parameters:

Connection interval: Defines how often the Central will ask for data from the Peripheral. It contains minimum and maximum connection interval values. 

The parameter value has to be chosen with a balance of throughput and power consumption in mind. A high connection interval value (e.g. 4 seconds) will decrease power consumption and reduce data throughput, and vice versa.

Therefore, if you want to increase the data throughput, you can decrease the connection interval value, but keep in mind that this will also increase power consumption.

Slave latency: slave latency can be applied to help the peripheral (slave) device reduce power consumption further. This parameter is useful to avoid changing connection parameters frequently to achieve both high-speed data transfer and low power consumption when idle.

For example, suppose there is a 30 ms connection interval with a slave latency of 4. In that case, the connection can handle data transfers with 30 ms connection intervals, and when idle, it sends empty packets to keep the connection only once every 150 ms (on the slave side).

Connection supervision timeout: This timeout is determined from the last data exchange until a link is considered lost. A Central will not start trying to reconnect before the timeout has passed, so if you have a device that goes in and out of range often, and you need to notice when that happens, it might make sense to have a short timeout.

To meet the demands of users, the BleuIO team will continue to update and add new features. To find out more about the updates of the dongles new firmware 2.0.6, please visit our Getting Started Guide

Share this post on :

Get Bluetooth Device Distance in meter Using Javascript

Bluetooth ranging technology is very popular. There are many localization systems that exist based on beacons. Beacon technology usually estimates the distance between devices using the received signal strength (RSSI). 

Bluetooth can be an excellent way to narrow down a search area at close distances when tracking something. This feature can be used in several fields. such as Secure Locks for Buildings and Automotive, Asset localization & tracking, Indoor navigation etc

GPS tracking isn’t excellent at giving accurate measurements of the close distance, especially in the indoor environment. On the other hand, Bluetooth is excellent in short ranges because the waves can go through walls. This might fill the gap that GPS tracking has when tracking devices in indoor spaces.

However, most calculations of the distance between two Bluetooth devices are estimates. It’s hard to determine the exact distance between two Bluetooth devices because many factors affect the calculations. Despite the challenges, there are methods to determine the distance between two Bluetooth devices with an accuracy of at least 60-80%.

The ranging method is simple to implement, and it has the formula to calculate the distance between two Bluetooth devices. As the name suggests, both devices need to be within Bluetooth range to estimate the distance. 

This article will share a simple script written in JavaScript to determine nearby Bluetooth devices and their distance in meters.

This script scans for nearby Bluetooth devices and gets an approximation of the distance by using the well-known RSSI to distance formula.

Read more about how to calculate the distance

How to Calculate Distance from the RSSI value of the BLE Beacon

Requirments

Instructions

git clone https://github.com/smart-sensor-devices-ab/ble_distance_measure.git

The script will an index.html and script.js file. Index.html is just has a connect and scan for device button. upon connecting we will be able to scan for nearby devices and. Once the scanning is completed we will be able to see a list of devices and their distance from my computer.

Here is the index.html file

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

    <title>Get Device Distance Using BleuIO</title>
  </head>
  <body>
    <div class="container"> <br>
    <a href="https://www.bleuio.com/"> <img src="https://www.bleuio.com/images/logo.png" alt="BleuIO get device distance"></a>
    <h1>Get Device Distance Using BleuIO</h1>
<br>
    <button id="connect" class="btn btn-success">Connect</button>
<button id="scan" class="btn btn-warning">Scan Devices</button> &nbsp; &nbsp;  <span id="scanning" class="d-none"> scanning ...</span>  <br><br><br>
<div id="deviceList"></div>
</div>
<br><br>
<script src="./script.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>


  </body>
</html>

The script.js file uses bleuio javascript library to connect and scan for BLE devices. Once we get the device list, we try to sort it out by RSSI value and convert RSSI value to distance. Finally we print the result into a table.

Here is the script.js file

import * as my_dongle from 'bleuio'
document.getElementById('connect').addEventListener('click', function(){
  my_dongle.at_connect()
})

/*
Functions to converts rssi to distance 
read more at 
https://iotandelectronics.wordpress.com/2016/10/07/how-to-calculate-distance-from-the-rssi-value-of-the-ble-beacon/
*/
const getDistance =(rssi=>{
  let n=2
  let mp=-69
  return 10 ** ((mp - (rssi))/(10 * n))
})
document.getElementById('scan').addEventListener('click', function(){
  var element = document.getElementById("scanning");
  element.classList.remove("d-none");
  my_dongle.at_central().then((data)=>{    
    my_dongle.at_gapscan(4,false).then((dev)=>{
      //convert array string to array of object with key value
      const formated = dev.map((item) => {
        const [ id, dev,devid,none,rssi,rssival,devname ] = item.split(' ');
        return { id, dev,devid,none,rssi,rssival,devname};
      });
      //array list unique
      let uniqueArr= formated.filter(y=>y.devname!=undefined)
      //sort based on rssi value
      uniqueArr.sort((a, b) => a.rssival > b.rssival && 1 || -1)
      
      let withDistance= uniqueArr.map(r=>{
        r.distance=getDistance(r.rssival).toFixed(2)+' meter'
        return r 
      })
      //generate output
      let mytable = `<h2>Device List</h2>
      <table class='table table-striped table-bordered'>
      <tr>
      <th>Device</th>
      <th>RSSI</th>
      <th>Distance</th>
      </tr>`;
      withDistance.map(j=>{
        mytable += "<tr><td>" +j.devid+" - "+ j.devname + "</td><td>"+ j.rssival+"</td><td>"+j.distance+"</td></tr>";
      })
      mytable += "</table>";
      document.getElementById("deviceList").innerHTML = mytable;
      element.classList.add("d-none");
    })
  })
})

To run this script , we can use a web bundler called parcel. https://parceljs.org/

lets go inside the folder and in terminal type.

parcel index.html

The script will scan for five seconds for nearby devices. You can update the value based on your requirements.

You can also run this script from online at
https://smart-sensor-devices-ab.github.io/ble_distance_measure/dist/

**Make sure your BleuIO dongle is connected

Output

Share this post on :