All Projects → loginov-rocks → Web Bluetooth Terminal

loginov-rocks / Web Bluetooth Terminal

Licence: mit
Progressive Web Application for serial communication with your own Bluetooth Low Energy (Smart) devices

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Web Bluetooth Terminal

bluetooth-terminal
ES6 class for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 43 (-66.92%)
Mutual labels:  serial, communication, bluetooth, ble, bluetooth-low-energy
Johnny Five
JavaScript Robotics and IoT programming framework, developed at Bocoup.
Stars: ✭ 12,498 (+9513.85%)
Mutual labels:  arduino, serial, iot, bluetooth
Gort
Command Line Interface (CLI) for RobotOps
Stars: ✭ 425 (+226.92%)
Mutual labels:  arduino, bluetooth-low-energy, iot, bluetooth
Arduino Robust Serial
A simple and robust serial communication protocol. It was designed for Arduino but can be used for other purposes (e.g. bluetooth, sockets). Implementation in C Arduino, C++, Python and Rust.
Stars: ✭ 83 (-36.15%)
Mutual labels:  arduino, serial, communication, bluetooth
Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+2442.31%)
Mutual labels:  arduino, bluetooth-low-energy, iot, bluetooth
Nimble Arduino
A fork of the NimBLE library structured for compilation with Ardruino, designed for use with ESP32.
Stars: ✭ 108 (-16.92%)
Mutual labels:  ble, bluetooth-low-energy, bluetooth
Watchy
Watchy - An Open Source E-Ink Smartwatch
Stars: ✭ 469 (+260.77%)
Mutual labels:  arduino, bluetooth-low-energy, iot
Xiaomi Flower Care Api
Xiaomi Flower Care (MiFlora) API wrapper.
Stars: ✭ 111 (-14.62%)
Mutual labels:  ble, bluetooth-low-energy, iot
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+742.31%)
Mutual labels:  arduino, ble, iot
Ios Pods Dfu Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 349 (+168.46%)
Mutual labels:  ble, bluetooth-low-energy, bluetooth
Esp32 ble wedo
A library to control LEGO wedo 2.0 with the ESP32 through Bluetooth low energy
Stars: ✭ 16 (-87.69%)
Mutual labels:  arduino, ble, bluetooth-low-energy
Rf24ble
RF24BLE is the library that makes an nrf24L01+ chip (1$) into a BLE advertising beacon and can be used for LOW payload advertising like sensor data etc.
Stars: ✭ 129 (-0.77%)
Mutual labels:  arduino, ble, bluetooth
Node Bluetooth Serial Port
Serial I/O over bluetooth for NodeJS
Stars: ✭ 444 (+241.54%)
Mutual labels:  serial, communication, bluetooth
Esp32 Ble Keyboard
Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
Stars: ✭ 533 (+310%)
Mutual labels:  arduino, ble, bluetooth
Cylon
JavaScript framework for robotics, drones, and the Internet of Things (IoT)
Stars: ✭ 3,862 (+2870.77%)
Mutual labels:  arduino, bluetooth-low-energy, iot
Uart Smartwatch
Android App, Firmware and Circuit for a DIY Smartwatch working with Bluetooth Low Energy
Stars: ✭ 30 (-76.92%)
Mutual labels:  arduino, bluetooth-low-energy, bluetooth
Serial Studio
Multi-purpose serial data visualization & processing program
Stars: ✭ 1,168 (+798.46%)
Mutual labels:  arduino, serial, iot
Rxbluetoothkit
iOS & OSX Bluetooth library for RxSwift
Stars: ✭ 1,213 (+833.08%)
Mutual labels:  ble, bluetooth-low-energy, bluetooth
Rubble
(going to be a) BLE stack for embedded Rust
Stars: ✭ 292 (+124.62%)
Mutual labels:  ble, iot, bluetooth
Magicblue
💡 Unofficial Python API to control Magic Blue bulbs over Bluetooth
Stars: ✭ 92 (-29.23%)
Mutual labels:  ble, iot, bluetooth

Web Bluetooth Terminal

NpmVersion dependencies Status devDependencies Status

Favicon https://loginov-rocks.github.io/Web-Bluetooth-Terminal — try it out, see how it works on YouTube, read tutorial on Medium (English) or on Habr (Russian).

Web Bluetooth Terminal is a website that can connect with the remote devices which support Bluetooth Low Energy (also called Bluetooth Smart) and exchange data bidirectionally. It can be installed on your homescreen as an application and work offline.

Killer feature: the application establishes serial communication over BLE that is not provided by the specification, but needed if you want to make your own BLE IoT devices using affordable bluetooth modules.

Teaser

The application utilises BLE service (0xFFE0) and characteristic (0xFFE1) available in low cost BLE modules based for example on CC2541 chip, such as HM-10, JDY-08, AT-09, CC41-A and other. Also, it bypasses 20 bytes limit specific for GATT characteristics by keeping incoming messages in a buffer and waiting for the end of line characters.

Check Bluetooth Low Energy (Smart) device and How to use this app as a base for my own project? sections for a quick start and to find out how to make your own project. Also, I've made MeArm Controller as a showcase project.

Features

Accessible via browser — just go to the website and you'll get the full featured application, it is not needed to install anything.

Cross-platform — as long as the app is accessible via browser, you can use it with the desktop or with the smart phone browser.

Installable — if you don't want to remember the website address, you can add it to the homescreen.

Works offline after installation on your homescreen, since it is a Progressive Web Application.

And... it have auto scrolling! Enabled by default, but you can scroll the terminal to the top on more than a half of the terminal window height to disable it. Scroll to the bottom to enable it again. Rocket science!

Requirements

Browser

One of browsers which supports Web Bluetooth API by default (Chrome Platform Status, Can I use):

  1. Chrome for desktop 56+
  2. Chrome for Android 56+
  3. Opera 43+
  4. Opera for Android 43+

All this browsers support other necessary features, such as ES6 classes and PWA capabilities (Web App Manifest and Service Workers), so I don't pay attention to it here.

Bluetooth Low Energy (Smart) device

Different BLE devices implement their own services and characteristics to communicate with, but you can build your own simple device: you just need a BLE module (e.g. HM-10, JDY-08, AT-09, CC41-A) and an Arduino Uno. Wire it and upload the bridge sketch.

Pay attention to what voltage level your BLE module consumes, since it can vary from device to device! Read specifications, you may need to connect your BLE module to the 3.3V pin and use voltage level shifter between TX and RX pins.

Arduino Uno to BLE module wiring scheme

Open Serial Monitor in Arduino IDE, switch baudrate to 9600 and line endings to Both NL & CR. Next, launch the Web Bluetooth Terminal and connect to your module. Now you're able to make a small talk between the Terminal and the Serial Monitor!

BLE module configuration

When a BLE module is waiting for connection it can be configured with AT commands. So if you have troubles trying to make BLE module work as expected you can use following commands, but again, read specifications! Here are some commands I use with CC41-A module:

  • AT+DEFAULT — resets the module to the defaults;
  • AT+RESET — resets the module softly;
  • AT+ROLE — gets the module working mode;
  • AT+ROLE0 — makes the module to work in slave mode, waiting for connection from other devices;
  • AT+NAME — gets the module name;
  • AT+NAMESimon — sets the module name to Simon;
  • AT+PIN — gets the module pin (password);
  • AT+PIN123456 — sets the module pin to 123456;
  • AT+UUID — gets the module service UUID;
  • AT+CHAR — gets the module characteristic UUID.

Commands can be case insensitive and may need to be terminated with CR (\r) and LF (\n).

How to use this app as a base for my own project?

You can fork this repository and implement features specific to your needs. Don't forget that application should be accessible via HTTPS protocol to enable Web Bluetooth API feature, so you can use GitHub Pages switching the source to the master branch of your repository.

To use development capabilities, you'll need Node.js, npm especially. Install it, clone the repository and install npm dependencies:

git clone https://github.com/loginov-rocks/Web-Bluetooth-Terminal.git
cd Web-Bluetooth-Terminal
npm install

Global install

Alternatively, you can delegate repository cloning to the package itself. Just install it globally:

npm install -g web-bluetooth-terminal

Having this package installed globally, you can use the following command to clone the repository into your current directory:

web-bluetooth-terminal

Or you can specify directory name to clone into as an argument:

web-bluetooth-terminal MyProject

This command checks out the same version as you have installed globally. So if a new version is released, you can update package with the following command:

npm update -g web-bluetooth-terminal

Npm scripts

After installing npm dependencies, you can use some simple scripts that can be helpful:

  • npm run build copies used vendors files and generates css/style.css;
  • npm run js:vendor copies used vendors JavaScript files into the js directory;
  • npm run lint lints JavaScript files;
  • npm run styles generates css/style.css from SCSS sources placed in the scss directory;
  • npm run styles:vendor copies used vendors stylesheets into the css directory;
  • npm run watch:styles watches for changes made to the files placed in the scss directory and runs npm run styles command.

BluetoothTerminal.js API

Also, you can install bluetooth-terminal package or directly download the file containing BluetoothTerminal class written in ES6 and use it as you want. Here is a simple code snippet that can be helpful for a quick start:

// Obtain configured instance.
let terminal = new BluetoothTerminal();

// Override `receive` method to handle incoming data as you want.
terminal.receive = function(data) {
  alert(data);
};

// Request the device for connection and get its name after successful connection.
terminal.connect().then(() => {
  alert(terminal.getDeviceName() + ' is connected!');
});

// Send something to the connected device.
terminal.send('Simon says: Hello, world!');

// Disconnect from the connected device.
terminal.disconnect();

Contribution

Please use the dev branch and feel free to contribute!

Reference

  1. Web Bluetooth Specification
  2. Web Bluetooth Samples
  3. Interact with Bluetooth devices on the Web
  4. Progressive Web Apps
  5. Service Worker Toolbox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].