LQ and RSSI in Bluetooth Protocol: Principles and Application Scenarios

In the physical layer of the Bluetooth protocol stack, there are two useful parameters: LQI and RSSI. Both are used by the receiver to evaluate the current wireless environment quality (link quality) and guide subsequent actions. However, the calculation principles and application scenarios of these two values differ significantly. LQI (Link Quality Indication) measures the quality of the received signal. The quality of the received signal is estimated by the receiver by comparing the received signal with the ideal signal and calculating the error accumulation value. For example, when using FSK or GFSK modulation, the receiver can compare the frequency of each bit with the expected frequency and accumulate a certain number of symbols (e.g., 64) to obtain the error accumulation value. Therefore, LQI can relatively reflect the current link quality, and its value is smaller when the link quality is better, and larger when the link quality is worse. RSSI (Received Signal Strength Indication) indicates the signal strength, regardless of the signal quality or correctness. LQI does not care about the actual signal strength, but the signal quality is related to the signal strength, as a stronger signal is less susceptible to interference, resulting in a higher “correctness” rate, lower LQI, and better signal quality. The following typical scenarios illustrate the application of LQI and RSSI: Weak signal and strong noise: low RSSI, high LQI Weak signal with little noise: low RSSI, low LQI Strong interference (e.g., jammer): high RSSI, high LQI (i.e., high RSSI does not necessarily mean… Read more



Start Building with Web Bluetooth and Progressive Web Apps

A Short Introduction Web Bluetooth is a a new technology that connects the Web with the Internet of Things. Web Bluetooth is so new, it’s still being built and prototyped! But of course, that doesn’t mean we can’t play with it… Essentially, Web Bluetooth lets you control any Bluetooth Low Energy device (smart home appliances, health accessories like heart rate or glucose monitors, temperature sensors, etc.) directly from your PC or smart phone, without having to install an app first. Web Bluetooth will eventually enable developers to build one solution that will work on all platforms, including both mobile and desktop, which means lower development costs, more open source control interfaces for various physical products, and more innovation. Evenings are best spent with fine wine, fine company, and Web Bluetooth In this post I will explain the basics of Web Bluetooth by building a demo web app that controls the smart bulb that I reversed engineered in the previous post. In addition, I’ll explore how you can extend this app to become a Progressive Web App, which is an exciting new approach that we’ll go into later in the post. I will assume for this tutorial you have basic familiarity with Bluetooth Low Energy terms such as Peripherals, Services and Characteristics — if not, check out the previous post to learn about them. You might be thinking, “But Uri, we can already send commands to the bulb, and anyway doesn’t the bulb already come with an app?” Well, it does come… Read more



Bluetooth and Location Services Permission Tips

An iBeacon app relies on an active Bluetooth connection to detect the beacons around it. Without bluetooth, the app wouldn’t know when to trigger certain location related features. Handling bluetooth settings and permissions on the iPhone can sometimes be tricky. If you don’t request permissions correct and check the phone’s status in the right order, development and testing can become more of a frustration than it needs to be. Here’s how each step of the process should be handled: 1 — Is the device capable of Bluetooth Low Energy (BLE)? iBeacons run on the BLE frequency so it’s important that the device is BLE capable. BLE is available on the iPhone 4S & up, on any iPad mini or Air, and on iPad 3rd & 4th generation devices. Check for BLE capability isn’t necessary if you setup your app to require Bluetooth low energy. UIRequiredDeviceCapabilities bluetooth-le Adding the bluetooth-le key to the UIRequiredDeviceCapabilities array in your app’s plist restricts non-BLE capable devices from downloading your app. We restricted downloads of app to only BLE enabled devices since the app relies on iBeacon tech to function. Some apps may not revolve around iBeacon tech, in that case checking for BLE capability is an absolute necessity. let opts = [CBCentralManagerOptionShowPowerAlertKey: false]let manager = CBCentralManager(delegate: self, queue: nil, options: opts)func centralManagerDidUpdateState(_ central: CBCentralManager) { if central.state != .unsupported { //device supports BLE } } After the central manager is created it calls centralManagerDidUpdateState: on it’s delegate. As long as the central manager’s state isn’t .unsupported BLE is supported and available to… Read more



Hardening SSH

Keep your server safe with a few extra steps. SSH is essential to server management. This post will walk you though some of the options available to harden OpenSSH. The instructions may work for other flavors of Linux but is intended fro Ubuntu 16.04 LTS. Warning: Messing with how SSH works can be dangerous. You can very easily lock yourself out of the server. Be careful. OpenSSH Server Configuration The settings file for OpenSSH on Ubuntu 16.04 is located at /etc/ssh/sshd_config. You will need to be root or use sudo to edit and control the SSH server. Backup Configuration File It is always a good idea to make a backup of any configuration files before editing them. cp /etc/ssh/sshd_config /etc/ssh/backup.sshd_config Editing the Configuration File I am not fancy so, I use nano for configuration file edits. nano /etc/ssh/sshd_config SSH Configuration Test After editing the configuration file you should test that it is valid before reloading the service. sshd -t Reload the Configuration File Once you think your edits are good, reload the SSH daemon. sudo systemctl reload sshd Check the Protocol Our very first edit will be very simple. It is really more of a double check than an edit. Open /etc/ssh/sshd_config and check the line that starts with Protocol. Make sure it is set to 2 and not 1. The current default is 2. Protocol 2 Disable Root Instead of using root, we should be using connecting as user with sudo permission. Make sure you have sudo setup properly before continuing. So let’s disable the ability of root to login using SSH. Inside the configuration… Read more



Secure Design for Low Energy Bluetooth (BLE) Applications

Low Energy Bluetooth (BLE) is widely used in various smart devices and IoT scenarios as a low-power, short-range wireless communication technology. However, due to the characteristics of BLE, it is susceptible to various security threats. Therefore, when designing and developing BLE applications, it is crucial to focus on security issues and implement appropriate security measures to protect communication data and user privacy. Firstly, Security Measures for Bluetooth Pairing In the pairing process between BLE devices, it is essential to use FIPS-approved algorithms such as AES-CMAC and P-256 elliptic curve to ensure the security of pairing information. Pairing information should be stored in a secure storage location on the device to prevent malicious attackers from stealing it. For authentication and encryption, FIPS-approved algorithms should also be used to ensure the confidentiality and integrity of communication data. For example, the use of AES-CCM algorithm can encrypt and protect data transmission, while also ensuring the integrity of messages. In healthcare devices, such as a health wristband communicating with a smartphone, the use of AES-CCM algorithm encrypts the user’s health data to ensure its confidentiality. To prevent passive eavesdropping and man-in-the-middle attacks, user-assisted secure simple pairing methods can be used. For instance, using the ECDHE algorithm for Simple Secure Pairing (SSP) to prevent passive eavesdropping attacks, and employing the user-assisted digital method Passkey Entry to prevent man-in-the-middle attacks. Here is the description of the Bluetooth Simple Secure Pairing (SSP) implementation example:Device Preparation• Device A (Initiator): a Bluetooth device, such as a smartphone.• Device B… Read more



Unveiling the Mysteries of BLE 4.0 Range

With the rapid development of the Internet of Things (IoT), Bluetooth Low Energy (BLE) technology has become increasingly important. As the latest version of BLE technology, BLE 4.0 has sparked intense interest in its range. So, how far can BLE 4.0 reach? Today, we’ll uncover the mysteries of BLE 4.0 range. Overview of BLE 4.0 Technology BLE 4.0 is the fourth generation of BLE technology, released by the Bluetooth Special Interest Group (SIG) in 2010. This technology marks a significant leap forward in BLE, featuring lower power consumption, faster data transmission speeds, and longer communication distances. How Far Can BLE 4.0 Reach? The range of BLE 4.0 refers to the maximum communication distance between devices. In ideal environments, BLE 4.0 can reach up to 100 meters (328 feet). However, actual environments are often affected by interference, obstacles, and other factors that can impact BLE 4.0 range. The main factors that affect BLE 4.0 range include: Environmental interference: Signals from Wi-Fi, Bluetooth, and mobile phones can interfere with BLE 4.0 signals. Obstacles: Walls, pillars, and furniture can block BLE 4.0 signals. Device transmission power: Higher transmission power can increase BLE 4.0 range. Receiver sensitivity: Higher receiver sensitivity can also increase BLE 4.0 range. BLE 4.0 Range Testing To better understand BLE 4.0 range, we conducted a series of tests. The test environment was an open, obstacle-free area, with BLE 4.0 devices transmitting at 4dBm and receiving at -90dBm. The test results were: In an open, obstacle-free area, BLE 4.0 range reached… Read more



2013: A Year of Growth and Achievement

As I reflect on the past year, I am filled with a sense of pride and accomplishment. In 2013, I had the opportunity to work as a Communication and Software R&D Engineer, focusing on researching and developing innovative products related to near-field communication technology, with a particular emphasis on Bluetooth Low Energy (BLE). Throughout the year, I had the privilege of delving deeper into the realm of near-field communication, gaining a profound understanding of its underlying principles and mechanisms. My research and development efforts culminated in the successful application of BLE technology to create smart lock products that showcased enhanced user experience and security features. While the journey was not without its challenges, I persevered and overcame numerous obstacles, ultimately yielding substantial results. I am thrilled to have made meaningful contributions to the development of smart locks, which have the potential to revolutionize the industry. As I look back on 2013, I am reminded of the importance of continuous learning and growth. My experience has taught me that staying at the forefront of technological advancements requires dedication, passion, and a willingness to adapt to emerging trends and innovations. In conclusion, 2013 was a pivotal year in my career as a Communication and Software R&D Engineer. I made significant strides in near-field communication technology, and my research and development efforts yielded tangible results. I am excited to carry this momentum forward, continuing to push the boundaries of innovation and excellence in the years to come.



Zigbee Technology: A Comprehensive Review of its History, Technology, Applications, and Future Directions

Zigbee is a low-power, low-data-rate wireless communication technology that has been gaining popularity in recent years due to its ability to enable wireless communication between devices over short distances. In this article, we will delve into the history of Zigbee, its technology, applications, and future directions, providing a comprehensive review of this exciting technology. History of Zigbee The concept of Zigbee was first introduced in the late 1990s by a group of companies, including Motorola, Intel, and Philips, who formed the Zigbee Alliance. The goal of the alliance was to develop a wireless communication technology that could enable low-power, low-data-rate communication between devices over short distances. The first Zigbee standard, Zigbee 1.0, was released in 2004, followed by subsequent updates, including Zigbee 1.1, Zigbee 1.2, and Zigbee 3.0. Zigbee Technology Zigbee is a wireless communication technology that operates on the 2.4 GHz frequency band, using a mesh networking topology. The technology is designed to enable low-power, low-data-rate communication between devices, making it ideal for applications that require low power consumption and low data transfer rates. Zigbee devices can operate in one of three modes: coordinator, router, and end device. The coordinator is the central device that manages the network, while routers act as intermediaries to extend the range of the network. End devices are the devices that communicate with the coordinator and routers to exchange data. Zigbee technology has several advantages, including: Low power consumption: Zigbee devices can operate for years on a single battery, making them ideal for battery-powered… Read more



Bluetooth Mesh Security Overview

The Criticality of Security One of the most discussed issues related to the Internet of Things (IoT) is security. From agriculture to hospitals, from residential smart homes to commercial smart buildings, and from power stations to traffic management systems, IoT systems and technologies will touch many parts of the world we live in. Security breaches in IoT systems could have catastrophic consequences. Bluetooth® mesh networking was designed with security as its number one priority and from the ground up. In this article, you’ll get an overview of the key security features and the security issues addressed. Further articles in the series will examine aspects of Bluetooth mesh networking security in more detail. Security in Bluetooth Mesh Networking is Mandatory Bluetooth® Low Energy (LE) GATT devices may implement a range of security measures as defined in the Bluetooth core specification. It’s the responsibility of the product designer to decide what security measures are required and it’s permissible to decide to adopt none of the available security features at all. In other words, security in Bluetooth Low Energy GATT is optional. This makes sense if we’re talking about the security of a single device and its connection with one other device, provided the product designer performs their risk assessment correctly. However, security in Bluetooth mesh networking is concerned with the security of more than individual devices or connections between peer devices; it’s concerned with the security of an entire network of devices and of various groupings of devices in the network. Consequently, security in Bluetooth mesh… Read more