Search code examples
androidbluetoothpyserialserial-communication

Bluetooth Serial Communication in Android with Ubuntu


I am trying to build an android app that can be controlled by a laptop with ubuntu installed via Bluetooth. What I want is to develop an android app that listens for incoming messages and performs particular actions according to the message. Basically I want the app to listen for Bluetooth signal (message) in the background while camera intent is open in the foreground and snap the picture when a particular message is received.

For that, I started learning about the Bluetooth serial communication and got to know about the following library on Github: https://github.com/harry1453/android-bluetooth-serial/tree/master/demoApplication I have replicated the demo application and the application is sending messages successfully, however when I send the message from Linux to the Android app it is not working. Can anyone help me regarding this issue or can suggest me some good tutorial to follow in order to build the app that can communicate with raspberry pi serially?


Solution

  • We know Bluetooth serial configuration is poorly documented (I read many questions here without any clear results.)

    I believe it's due to the Raspberry Pi Bluetooth configuration issue based on your description.

    With correct Raspberry Bluetooth serial configuration, your program with serial routines (written in Python using PySerial or serial routines written in C, which you can find it in github), your requirements (sending info about camera status via serial port will work.

    Please see Bluetooth Serial Configuration (see latest answer) for more details.