Embedded Linux
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon A Time ...
  • Embedded Linux
  • Build Systems
    • Yocto Board Support Package
      • Yocto
      • Compilation
        • Make
        • Bitbake
        • Script
      • Building Blocks
      • SDK
      • Extra Packages
      • Kernel
        • Patch
        • Building
        • Headers
      • Modules
        • Cross Compilation
        • Native
      • Filesystem
      • Flashing
    • Distributions
      • CentOS
      • Google Brillo
      • Jubilinux
      • Kali
      • Ostro
      • Ubilinux
      • Debian
  • Boot Loaders
    • U-Boot
  • Initialization
    • Upgrade
    • Boot Up
    • Dual Boot
    • Root Directory
    • Display Message
    • Modules
    • Filesystem
    • Memory
    • Backup
    • Recovery
    • Reboot
    • Processes
  • User Space
    • Virtual Network Computing
    • Text Editors
    • Services
    • Logs
    • Package Management Systems
      • Open Package Management
      • Python Package Index
      • Nicely Package Make
      • Advanced Packaging Tool
      • Manual
      • Conda
    • Libraries
      • Mraa
      • Upm
      • OpenCv
      • Temboo
      • Libiio
    • Frameworks
      • Cylon JS
      • Johnny Five
      • ROS
      • Gobot
      • Pixhawk
      • Artoo
      • Bower
      • Zetta
      • Miscellaneous
  • Subsystems
    • X File Systems
    • Pin Muxing
    • Virtual File System
    • Memory
    • Input
    • General Purpose Input Output
    • Serial
    • Bluetooth
      • Advanced Audio Distribution Profile
        • Bluez
        • Gstreamer
        • Alsa
      • Human Interface Device Game Controller
      • Serial Port Protocol
      • Arduino
    • WiFi
    • Audio
    • Camera
    • Block
    • Universal Serial Bus
      • Human Interface Device Mini Keyboard
      • Python USB
    • Inter Integrated Circuit
    • Inter Process Communication
    • Peripheral Component Interconnect
    • Clock
    • Modems
    • Networking
    • Power
    • Thermal
    • Graphics
    • LED
    • LIDAR
    • Printer
    • Serial Peripheral Interface
  • Application Development
    • C
    • C++
    • Cross Compile
    • Containers
    • Python
    • NodeJS
    • Cloud9
    • Data
    • Drone Code
    • Speech
      • Python
    • Radio Frequency
    • Bots
    • Artificial Intelligence
      • WitAi
      • MycroftAi
    • Games
    • Vision
      • Bar Codes
      • Google Cloud Vision API
    • Messaging
    • Entertainment
    • Home Assistants
    • Dashboards
    • IRC
    • Location
    • Facial Recognition
    • Software Defined Radio
    • REST
    • Notes
    • Security
    • HAM Radio
    • Automotive
    • Digital Signage
    • Photography
  • Debug
  • Wrap-Up
    • Online Training
    • Challenge
    • Tbd
  • SandBox
Powered by GitBook
On this page
  • Hackathon
  • Node
  1. Subsystems
  2. Bluetooth

Serial Port Protocol

Hackathon

Install Android BlueTerm Application

root@edison:~# rfkill unblock bluetooth
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:21:2A edison [default]
[NEW] Device F8:CF:C5:D4:CB:BC Nexus 6
[bluetooth]# agent KeyboardDisplay
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller 98:4F:EE:04:21:2A Discovering: yes
[CHG] Device F1:C1:83:A4:17:0C RSSI: -57
[CHG] Device F1:C1:83:A4:17:0C TxPower: -12
[NEW] Device F8:CF:C5:D4:CB:BC Nexus 6
[bluetooth]# scan off 
[CHG] Device F8:CF:C5:D4:CB:BC RSSI is nil
[CHG] Device F1:C1:83:A4:17:0C TxPower is nil
[CHG] Device F1:C1:83:A4:17:0C RSSI is nil
[CHG] Controller 98:4F:EE:04:21:2A Discovering: no
Discovery stopped
Attempting to pair with F8:CF:C5:D4:CB:BC
[CHG] Device F8:CF:C5:D4:CB:BC Connected: yes
Request confirmation
[agent] Confirm passkey 061443 (yes/no): yes
[CHG] Device F8:CF:C5:D4:CB:BC Modalias: bluetooth:v000Fp1200d1436
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001105-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001115-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001116-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 0000112f-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001132-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device F8:CF:C5:D4:CB:BC Paired: yes
Pairing successful
[CHG] Device F8:CF:C5:D4:CB:BC Connected: no
[bluetooth]# disconnect F8:CF:C5:D4:CB:BC
Attempting to disconnect from F8:CF:C5:D4:CB:BC
Successful disconnected
[bluetooth]# exit
Agent unregistered
[DEL] Controller 98:4F:EE:04:21:2A edison [default]
root@edison:~# rfcomm listen 0 1 &
[1] 400
root@edison:~# Waiting for connection on channel 1

root@edison:~# Connection from F8:CF:C5:D4:CB:BC to /dev/rfcomm0
Press CTRL-C for hangup

Connect from Android device from BlueTerm application

root@edison:~# cat /dev/rfcomm0

Write data from Android device to BlueTerm application

#! /usr/bin/python

import serial
from time import sleep

bluetoothSerial = serial.Serial("/dev/rfcomm0", baudrate=9600)

while True:

    bluetoothSerial.write(str("Hola!"))
    sleep(2)
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:21:2A edison [default]
[NEW] Device F8:CF:C5:D4:CB:BC Nexus 6
[NEW] Device F1:C1:83:A4:17:0C Evolutel
[bluetooth]# connect F8:CF:C5:D4:CB:BC
Attempting to connect to F8:CF:C5:D4:CB:BC
[CHG] Device F8:CF:C5:D4:CB:BC Connected: yes
Connection successful
[Nexus 6]# quit
[DEL] Controller 98:4F:EE:04:21:2A edison [default]
root@edison:~# rfcomm bind 0 F8:CF:C5:D4:CB:BC 1
root@edison:~# ls /dev/rfcomm0 
/dev/rfcomm0
root@edison:~#

Node

root@edison:~# npm install bluetooth-serial-port
PreviousHuman Interface Device Game ControllerNextArduino

Last updated 7 years ago