Introducing the BleuIO Script Generator – Build BLE Applications with AI in Seconds

At Smart Sensor Devices, we are proud to introduce the BleuIO Script Generator – an AI-powered assistant that enables developers to instantly create valid BLE scripts using official BleuIO AT commands. Whether you’re a seasoned BLE expert or just getting started, this intelligent tool dramatically accelerates your workflow and minimizes errors.

What Is the BleuIO Script Generator?

The BleuIO Script Generator is a custom GPT (Generative Pre-trained Transformer) built using OpenAI’s advanced language model, trained and fine-tuned with the full BleuIO command reference. It understands how the BleuIO USB dongle works, including:

  • All AT commands
  • Syntax structures
  • Command usage examples
  • Valid output formats

With this AI assistant, you can now generate working scripts in Python, JavaScript, Shell, or any other language using real BleuIO commands—no more guessing or checking documentation line by line.

How Does It Help Developers?

The BleuIO Script Generator transforms the BLE development experience by offering intelligent, real-time support tailored to the needs of developers at all levels. One of its greatest strengths lies in rapid prototyping. You can simply describe your desired behavior in natural language—for example, “Create a script that connects to BleuIO and then scans for BLE devices for 5 seconds.”—and the generator instantly returns a ready-to-run script. It uses official AT commands like AT+CENTRAL, AT+GAPSCAN=5, correctly formatted and accompanied by helpful explanations.

Another major benefit is its language flexibility. Whether you’re working in Python, JavaScript, or even shell scripting, the Script Generator adapts the output to your preferred programming language, making integration seamless regardless of your tech stack. In addition to generating code, it promotes error-free development by relying solely on verified, up-to-date BleuIO AT commands. This minimizes the chance of sending unsupported or invalid instructions to your dongle, ensuring smoother workflows and reduced debugging time.

What sets this tool further apart is its built-in learning support. It doesn’t just produce scripts—it educates. You can ask the assistant questions like “What does AT+GAPSCAN=5 do?” or “How can I start advertising in extended mode?” and receive clear, example-based responses grounded in real command behavior. Whether you’re debugging, experimenting, or trying to better understand BLE communication, the BleuIO Script Generator acts as both tutor and tool.

How to Access the BleuIO AI Script Generator

You can use the Script Generator via ChatGPT’s Custom GPTs platform:

  1. Go to chat.openai.com/gpts
  2. Search for “BleuIO Script Generator” by Smart Sensor Devices
  3. Start chatting with it like a BLE expert assistant

Once you’re in, simply describe your task, and the generator will respond with code, documentation, and suggestions.

Why This Matters

At Smart Sensor Devices, we built the BleuIO dongle to make BLE development simpler, faster, and more accessible. Now, with AI as your development partner, you’re no longer bound by manuals or guesswork.

The BleuIO Script Generator removes friction from your workflow, so you can:

  • Focus on building real BLE solutions faster
  • Prototype smarter IoT and automation systems
  • Support team members with varied skill levels

Whether you’re building a hobby project, an enterprise product, or teaching BLE concepts, this AI tool accelerates learning and development.

Ready to Start?

Visit bleuio.com and get your BleuIO dongle today. Pair it with the BleuIO Script Generator, and you’ll be writing powerful BLE scripts with ease—no matter your programming experience.

Share this post on :

BLE Device Proximity Alert System Using BleuIO

Looking to detect nearby Bluetooth devices based on how close they are? With the BleuIO USB dongle and a simple Python script, you can create a BLE proximity alert system that triggers a sound when a specific device is within signal range. This setup filters devices based on signal strength (RSSI), allowing you to monitor only those within a defined proximity.

This project is ideal for anyone exploring BLE applications such as access control, IoT automation, or even security demos.

Use Cases

The BLE Proximity Alert System can serve various real-world scenarios:

  • Secure Zone Monitoring
    By defining a signal strength threshold, the system only responds to devices that are physically close—perfect for protecting sensitive areas like server rooms or restricted workspaces.
  • Proximity-Based Device Interactions
    Trigger actions such as pairing or unlocking devices only when a known BLE tag or smartphone comes within a defined range, improving both UX and security.
  • Awareness and Educational Demos
    Demonstrate proximity-based alerts in classrooms or public exhibits to show how BLE technology can be used for social distancing or presence detection.
  • Smart Home or Office Automation
    Use proximity as a trigger to automate actions—such as turning on lights, sending notifications, or logging user presence—without needing additional sensors.

Requirements

To run this BLE proximity alert system, you’ll need:

  • BleuIO Dongle
    A USB Bluetooth Low Energy dongle that supports AT command communication and works with macOS, Windows, and Linux. This dongle will be used to scan for nearby BLE devices and filter based on signal strength.
  • Close Beacon Device
    In this project, we use a Close Beacon as the target BLE device. These compact beacons broadcast Bluetooth advertisements, making them ideal for proximity detection demos.
  • Python 3.x
    Ensure Python is installed on your system. The script uses Python to handle serial communication and control logic.
  • Sound File
    A short .wav or .mp3 audio file (e.g., beep.wav) placed in the same directory as the script. This sound will be played when the target BLE device is detected within the defined proximity.

Required Python Library

Only one external Python library is needed:

  • pyserial – for handling communication with the BleuIO dongle via the serial port.

You can install it using:

pip install pyserial

No additional audio libraries are required on macOS or Windows; the script uses the built-in afplay tool for macOS and winsound for Windows to play audio.

How It Works

When you launch the script, it establishes a serial connection with the BleuIO dongle. It then sets an RSSI filter using the AT+FRSSI command, which limits scan results to only those devices whose signal strength is above a certain threshold (i.e., closer in physical distance). For example, setting a filter of -76 means the scan will ignore devices with weaker signals (further away) and only show those nearby.

Every 30 seconds, the script initiates a BLE scan using AT+GAPSCAN=3. It parses the output in real time, looking for a specific MAC address. If the device is detected, the system immediately plays a sound to alert the user. This process repeats continuously, offering reliable detection based on proximity rather than just presence.

Important Notes

  • Serial Port
    Update the SERIAL_PORT variable in the script to match your operating system:
    • macOS: Typically /dev/cu.usbmodemXXXX
    • Windows: Usually COM3, COM4, etc.
  • MAC Address
    Replace the default value with the MAC address of your target BLE device.
  • RSSI Threshold
    Modify RSSI_FILTER_THRESHOLD at the top of the script to define how close the device must be to trigger the alert. Acceptable values range from -1 (very strong signal) to -99 (very weak).
  • Sound File
    Make sure the beep sound file (e.g., beep.wav) is present in the same folder as the script.

Source Code

The source code is available at

https://github.com/smart-sensor-devices-ab/ble-proximity-alert.git

You can find the complete Python script with configuration options and logic here:

import platform
import serial
import time
import subprocess
if platform.system() == "Windows":
    import winsound

# ==== CONFIGURATION ====
SERIAL_PORT = '/dev/cu.usbmodem4048FDEBA6D01'  # Update as needed
#SERIAL_PORT = "COM8"  # Update as needed
BAUD_RATE = 9600
TARGET_DEVICE_MAC = "D0:76:50:80:15:32"
SOUND_FILE = "beep.wav"  # Must exist in the same folder

# RSSI filter threshold: Acceptable range is -1 to -99
RSSI_FILTER_THRESHOLD = "60"  # You can input without '-' sign
# ========================


def play_beep():
    try:
        if platform.system() == "Windows":
            winsound.PlaySound(SOUND_FILE, winsound.SND_FILENAME)
        else:
            subprocess.call(["afplay", SOUND_FILE])
    except Exception as e:
        print(f"Failed to play sound: {e}")


def connect_to_bleuio():
    try:
        ser = serial.Serial(SERIAL_PORT, BAUD_RATE, timeout=1)
        time.sleep(2)

        # Send basic AT to wake up
        ser.write(b"AT\r\n")
        time.sleep(0.5)

        # Ensure threshold has leading '-'
        rssi_value = RSSI_FILTER_THRESHOLD
        if not rssi_value.startswith("-"):
            rssi_value = "-" + rssi_value

        command = f"AT+CENTRAL\r\n".encode()
        ser.write(command)
        print(f"BleuIO set to central role\n")
        time.sleep(0.5)

        # Send AT+FRSSI command
        command = f"AT+FRSSI={rssi_value}\r\n".encode()
        ser.write(command)
        print(f"RSSI filter set to {rssi_value} dBm\n")
        time.sleep(0.5)

        return ser
    except Exception as e:
        print(f"Error connecting to BleuIO: {e}")
        return None


def scan_for_device(ser):
    ser.write(b"AT+GAPSCAN=3\r\n")
    end_time = time.time() + 5

    while time.time() < end_time:
        if ser.in_waiting:
            line = ser.readline().decode(errors="ignore").strip()
            print(line)
            if TARGET_DEVICE_MAC in line:
                print("Target device found! Triggering alert...")
                play_beep()

    print("Scan complete.\n")


def main():
    ser = connect_to_bleuio()
    if not ser:
        return

    print("Connected to BleuIO. Starting periodic scan...\n")

    while True:
        scan_for_device(ser)
        time.sleep(30)


if __name__ == "__main__":
    main()

Conclusion

This BLE proximity alert system is a great example of using signal strength (RSSI) to filter and detect nearby Bluetooth devices. It’s a lightweight, effective solution that can be easily customized for different applications—from home automation to enterprise access control. The source code is entirely open and flexible, allowing anyone to adapt it for their own use cases and expand it with additional features such as logging, notifications, or integration with cloud services.

This is an example project—but the building blocks can easily become part of something much bigger.

Share this post on :