Skip to content

A lightweight Bluetooth Low Energy (BLE) Peripheral Simulator built with Node.js. This tool turns any Linux machine (Debian, Ubuntu, Raspberry Pi) into a "Smart Logistics Sensor."

Notifications You must be signed in to change notification settings

TruGanic/ble-sensor-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš› BLE Sensor Simulator (Logistics & Cold Chain)

A lightweight Bluetooth Low Energy (BLE) Peripheral Simulator built with Node.js and TypeScript.

This tool turns any Linux machine (Debian, Ubuntu, Raspberry Pi) into a "Smart Logistics Sensor." It reads shipment data from a CSV file and broadcasts it over Bluetooth in real-time. This is ideal for developing and testing BLE Client applications (like React Native dashboards) without needing physical sensor hardware.

πŸš€ Features

  • CSV Playback: Streams real-world dataset rows (Timestamp, Asset_ID, Temperature, Humidity, Status) sequentially.
  • Standard BLE Stack: Uses the bleno library to interface directly with the Linux BlueZ stack.
  • Real-time Updates: Updates the characteristic value every 2 seconds (configurable).
  • Simple Protocol: Broadcasts data as a comma-separated string (UTF-8), making it easy to debug and parse.

πŸ“Š Dataset

The simulation data (sensor_data.csv) is based on the Smart Logistics Supply Chain Dataset.

πŸ› οΈ Prerequisites

  • OS: Linux (Debian/Ubuntu/Raspberry Pi recommended).
    • Note: Windows/macOS support is experimental due to driver limitations.
  • Hardware: A device with a Bluetooth 4.0+ Adapter (Internal or USB Dongle).
  • Software: Node.js (v18+), npm.

πŸ“¦ Installation

  1. Clone the repository:

    git clone https://github.com/TruGanic/ble-sensor-simulator.git
    cd ble-sensor-simulator
  2. Install System Dependencies (Linux): Required for the Bluetooth C++ bindings.

    sudo apt-get update
    sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev build-essential
  3. Install Node Dependencies:

    npm install

πŸƒβ€β™‚οΈ Usage

Quick Start (Shell Script)

The easiest way to run the simulator is using the included helper script, which handles compilation and permissions.

chmod +x start_sim.sh
./start_sim.sh

About

A lightweight Bluetooth Low Energy (BLE) Peripheral Simulator built with Node.js. This tool turns any Linux machine (Debian, Ubuntu, Raspberry Pi) into a "Smart Logistics Sensor."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published