BleuIO Firmware Update 2.7.2: Enhanced Security and Stability

The BleuIO Bluetooth Low Energy (BLE) USB dongle continues to set the standard for BLE application development with its latest firmware update, version 2.7.2. This update brings significant enhancements, focusing on security features and critical bug fixes, making it an essential upgrade for developers and users of BleuIO.

Key Enhancements in Firmware 2.7.2

Enhanced Security with Authentication and Encryption Permissions

One of the most notable additions in this update is the introduction of Authentication and Encryption Permission support for Custom Service attributes. This feature is a major step forward in ensuring secure BLE communications. The permissions framework allows the server (BleuIO) to determine the client’s access level to characteristic or descriptor values based on the need for an authenticated and/or encrypted connection. This means that sensitive data can now be protected more robustly, ensuring that only authorized clients can read from or write to specific attributes.

Bug Fixes and Stability Improvements

The 2.7.2 firmware update also addresses several bugs that were affecting the reliability and performance of the BleuIO dongle. Here are the key fixes:

  1. AT+GETBOND Command Bug Fixes:
    • Incorrect MAC Addresses: Previously, the AT+GETBOND command occasionally returned incorrect MAC addresses. This issue has now been resolved, ensuring accurate reporting of bonded device addresses.
    • Removal of Address Type: The address type part of the MAC address, which was always returned as PUBLIC_ADDRESS (0) and not stored with the bonding information, has been removed. This simplification helps in reducing confusion and potential errors in handling bonded device information.
  2. AT+GAPSCAN Command Stability:
    • The command AT+GAPSCAN= with an empty argument previously caused the device to reset unexpectedly. This bug has been fixed, ensuring stable and predictable behavior when scanning for devices.
  3. Connection Initiation Fixes:
    • The update resolves issues where attempting to initiate a connection using AT+GAPCONNECT while also advertising led to unpredictable behavior, such as being unable to connect or scan properly. This fix enhances the overall stability and reliability of establishing BLE connections.

For developers and users of the BleuIO dongle, updating to firmware version 2.7.2 is highly recommended. The new security features ensure that your BLE applications can enforce stringent access controls, protecting sensitive data. The bug fixes improve the overall functionality and reliability of the device, reducing the likelihood of encountering errors during development and deployment.

For more detailed information and to download the latest firmware, visit the BleuIO getting started guide.

Share this post on :

Integrating BleuIO with Adafruit Feather RP2040 for Seamless BLE Applications Part 3 (secure connection)

Introduction

Building on the steps in our previous post Integrating BleuIO with Adafruit Feather RP2040 for Seamless BLE Applications Part 2 where we showed how to use the BleuIO to advertise sensor data, we are now going to put the data in a Custom Service. Additionally, we are going to protect the data by making it only available with a secure connection that can only be established by entering a 6-digit passkey.

This example is going to show you how to start protecting your data as well as how to set up and use a custom service.

Requirements

Running the example

Make sure the BleuIO Dongle is connected to the Feather RP2040 Board. Connect the Feather RP2040 Board to your computer using the USB cable.

Make sure the Feather RP2040 Board is selected as well as the correct COM port in the drop-down menu.

(Optional) Change the passkey used for the secure connection and/or the frequency the sensors are read, in the code

/* Requires 6 digits */
#define SECURE_CONN_PASSKEY "232425"
// How often we read the sensors and update the characteristics (in
seconds)
#define READ_UPDATE_FREQUENCY   5

Click the Upload button.

Done! The dongle should now be advertising the sensor values. (If you just plugged in the Feather it may take about 10 seconds before advertising starts as the BleuIO bootloader opens and closes)

(Optional) Open Serial Monitor. You can open the Serial Monitor from the menu:

Tools>Serial Monitor

You should now see the output from the project.

Getting the data

To get the results you can use any BLE scanner app. Here we use nRF Connect:

Find the device that advertise as BleuIO Arduino Example and connect.

You will be prompted to pair.

And then to enter the passkey.
Enter the passkey/pin (default: 232425) and continue.

Go to the service with the UUID: ee6ec068-7447-4045-9fd0-593f3ba3c2ee Notice that you are now bonded.

The service has 5 characteristics, one for each of the sensor values:

1. Lux
2. Pressure
3. Temperature
4. Humidity
5. Gas resistance

Read and/or enable notification for each characteristic to see the data.
The Characteristic User Description Descriptor of each characteristic can be read to show what value it holds.

Like in the previous example, when we parse the hex into decimal values we get:

Lux: 0x0068 = 104 uW/cm2
Pressure: 0x03F8 = 1016 hPa
Temperature: 0x0017 = 23 Celcius
Humidity: 0x0017 = 23 %Rh
Gas Resistance: 0x0041 = 65 KOhms

If not bonded, the values will always show 00-00.

Share this post on :

Developing BLE Applications with BleuIO and Rust

BleuIO is a versatile Bluetooth Low Energy (BLE) USB dongle designed to simplify the development of BLE applications. With its support for AT commands and seamless integration with Rust programming language, BleuIO offers developers a straightforward and efficient way to create BLE applications. In this tutorial, we will explore how to use BleuIO and Rust to develop BLE applications easily.

About Rust Programming Language:

Rust is a modern, systems programming language that focuses on safety, performance, and concurrency. Developed by Mozilla, Rust has gained popularity for its unique features and advantages, making it an excellent choice for various application domains, including system programming, web development, and embedded systems.

Prerequisites:

Setting Up BleuIO:

  1. Connect BleuIO Dongle:
    • Connect the BleuIO dongle to an available USB port on your computer.
  2. Identify Serial Port:
    • Identify the serial port associated with BleuIO. For example, On macOS and Linux, it may look like /dev/cu.usbmodem4048FDE52DAF1. On windows it looks like COM6

Installing Rust and Cargo:

  • Windows:
    • Download and install the Rust compiler (including Cargo) from the official website: Rustup.
    • Follow the installation instructions provided on the website.
  • Mac/Linux:
    • Open a terminal and run the following command to install Rust and Cargo:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Follow the on-screen instructions to complete the installation.

Creating a Cargo Project:

  • Open Terminal/Command Prompt:
    • Windows: Open Command Prompt or PowerShell.
    • Mac/Linux: Open Terminal.
  • Navigate to Project Directory:
cd /path/to/projects
  • Create a New Cargo Project:
cargo new BleuIO

This will create a new directory named “BleuIO” containing the project files.

  • Navigate into the Project Directory:
cd BleuIO

Writing BLE Application Code:

  • Open src/main.rs in Your Code Editor:
    • Replace the default Rust code with the BLE application code. Make sure to replace the port_name with your connected BleuIO port.
  • Implement BLE Application Logic:
    • Write Rust code to interact with BleuIO using AT commands.
use std::io::{self, Write};
use std::thread::sleep;
use std::time::Duration;
use serialport;

fn main() -> io::Result<()> {
    // Open the serial port
    let port_name = "/dev/cu.usbmodem4048FDE52DAF1";
    let mut port = serialport::new(port_name, 9600)
        .timeout(Duration::from_secs(5)) // Adjust timeout value here (5 seconds in this example)
        .open()
        .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

    // Write "AT+CENTRAL" to set the BleuIO dongle to centrla role
    let data_central = b"AT+CENTRAL\r\n";
    port.write_all(data_central).map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

    // Wait for 500 milliseconds
    sleep(Duration::from_millis(5));

    // Write "AT+GAPSCAN=3" to scan for nearby BLE devices for 3 seconds
    let data_gapscan = b"AT+GAPSCAN=3\r\n";
    port.write_all(data_gapscan).map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

    // Read response from the BleuIO dongle until no more data is available
    let mut response = String::new();
    loop {
        let mut buffer: [u8; 128] = [0; 128];
        let bytes_read = port.read(&mut buffer).map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

        // Check if no more data is available
        if bytes_read == 0 {
            break;
        }

        // Convert bytes to string and append to the response
        let chunk = String::from_utf8_lossy(&buffer[..bytes_read]);
        response.push_str(&chunk);

        // Print the current chunk of response
        print!("{}", chunk);
    }

    // Drop the port to close it
    drop(port);

    Ok(())
}

Building and Running the Project:

  • Build the Project:
cargo build
  • Run the Project:
cargo run

Output

In this tutorial, we’ve demonstrated how to develop a simple BLE applications using BleuIO and Rust that puts the BleuIO in central role and scans for nearby BLE devices for 3 seconds. Finally shows the list on the screen. By using BleuIO’s support for AT commands and Rust’s simplicity, developers can create BLE applications effortlessly. Start exploring the possibilities with BleuIO and Rust today!

Share this post on :

BleuIO JavaScript Library Update (v1.1.2): Supports BleuIO Firmware v2.7.1

BleuIO JavaScript library received a significant update to version 1.1.2, allows compatibility with BleuIO firmware v2.7.1. This update introduces several new commands, expanding the capabilities of BleuIO and helps developers to innovate further.

Here’s a breakdown of the key additions in version 1.1.2:

  1. at_customservice(): This function allows developers to set or query Custom Services, with the ability to add up to 5 Characteristics. Custom Services play a vital role in tailoring BLE applications to specific use cases, and this addition enhances flexibility in service customization.
  2. at_customservicestart() and at_customservicestop(): These functions enable the starting and stopping of Custom Services based on the settings configured using at_customservice(). This dynamic control over service activation facilitates seamless integration and management of BLE functionalities.
  3. at_customservicereset(): In scenarios where resetting Custom Service settings becomes necessary, this function comes to the rescue. It halts the Custom Service and resets configurations set by at_customservice(), ensuring a clean slate for subsequent operations.
  4. at_suotastart() and at_suotastop(): The addition of these functions facilitates over-the-air firmware updates (SUOTA) by enabling or disabling the SUOTA Service and associated advertising. This capability simplifies the process of updating BLE devices remotely, enhancing maintenance and scalability.
  5. at_autoexec() and at_clrautoexec(): These functions provide control over automatic execution of commands upon BleuIO startup. Developers can set or clear up to 10 commands, optimizing device initialization and enhancing user experience.
  6. at_connparam(): This function simplifies the management of connection parameters, allowing developers to set or display preferred values. Real-time updates during connection enable fine-tuning of parameters for optimal performance.

How to use: Updating to BleuIO JavaScript library 1.1.2 is a straightforward process. Use the following commands to use the lates BleuIO JavaScript library npm i bleuio

Documentation and Further Details: Comprehensive details, usage examples, and guidelines to use the new functionalities introduced in version 1.1.2 of the BleuIO JavaScript library is available at the official NPM page https://www.npmjs.com/package/bleuio

Share this post on :