Simple app for communication with devices via bluetooth based on Apache Cordova (PhoneGap). It was made to fetch data from one of IoT (Internet of Things) device, so it's source code can be helpful as a base for your own project.
Make sure you have cordova-cli installed globally, install with the help of npm otherwise:
$ npm install -g cordova
Clone repository, jump into, pull platforms (only android by default) and plugins:
$ git clone https://github.com/loginov-rocks/Cordova-Bluetooth-Terminal.git
$ cd Cordova-Bluetooth-Terminal
$ cordova prepare
Also, you can check Cordova requirements (optional or is something failed):
$ cordova requirements
Build:
$ cordova build
Or run on connected Android device via USB:
$ cordova run
Emulator is useless here, because you need working bluetooth module.
- BluetoothSerial Cordova plugin
- jQuery 3.1.1
- Reset CSS
You can try android build from here without installing anything.
- Smartphone (tablet, etc)
- Arduino Uno
- Bluetooth module (HC-05 for example)
- PC
Use /misc/arduino-uno-bridge/arduino-uno-bridge.ino
script to make serial bridge between PC and device connected to Arduino Uno via bluetooth. Wire bluetooth module to
Arduino Uno as mentioned there, upload script, open Serial Monitor on PC and pair smartphone with BT module.
Open Terminal app, select paired device, connect to it and now whatever you send in Serial Monitor on PC will appear in app and vice versa. Because of using SoftwareSerial this script is not reliable at all, some symbols can be skipped, etc. So... buy Mega! Or STM32.