Skip to content

smart-sensor-devices-ab/bleuio-serial-android-angular-typescript

Repository files navigation

BleuIO Serial Communication - Angular & TypeScript

This project demonstrates how to use the BleuIO USB dongle as a serial port on an Android device via OTG (On-The-Go) USB. Using Capacitor 6 and the @adeunis/capacitor-serial plugin, we establish a serial connection, send AT commands, and read responses in real time.

This project supports both BleuIO and BleuIO Pro dongles.

Features

  • Establish a serial connection with BleuIO via an Android device
  • Send and receive AT commands
  • Scan for nearby BLE devices
  • Works with Capacitor 6 and Angular

Requirements

  • BleuIO or BleuIO Pro USB dongle
  • Android device (with OTG support)
  • OTG cable
  • Node.js 18+
  • Java 17 (required for Capacitor 6)
  • Android Studio (for building and running the app)

Installation

1. Clone the Repository

git clone https://github.com/smart-sensor-devices-ab/bleuio-serial-android-angular-typescript.git
cd bleuio-serial-android-angular-typescript

2. Install Dependencies

npm install

3. Build the Angular App

ng build --configuration production

4. Sync with Capacitor

npx cap sync android

5. Open the Project in Android Studio

npx cap open android

6. Run the App on an Android Device

  • Ensure your Android device is connected via USB.
  • Enable USB debugging on your device.
  • In Android Studio, click Run to install and launch the app on your device.

Usage

  1. Connect BleuIO: Press the Connect to BleuIO button to establish a serial connection.
  2. Send AT Command: Press Send ATI Command to retrieve device information.
  3. Scan BLE Devices: Press Scan BLE Devices to search for nearby BLE devices.

Troubleshooting

  • If you see Permission Denied, make sure you have granted OTG USB permissions.
  • If the app does not detect the BleuIO dongle, check if OTG is enabled on your Android device.
  • If the npx cap sync android command fails, ensure all dependencies are installed.

License

This project is open-source and available under the MIT License.

About

BleuIO serial communication with android using capacitor serial (Angular and typescript)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published