P
P
Pavel Mikhalev2016-11-06 01:47:50
Python
Pavel Mikhalev, 2016-11-06 01:47:50

How to send data to the bluetooth module through the terminal on Android?

I'm trying to send data to Arduino via BT by voice command.
I found this python script

import android
import time

droid = android.Android()

mac = '00:00:00:00:00:00' #here you have to change the mac address by the one of your paired BT device
uuid = '00001101-0000-1000-8000-00805F9B34FB'
command = 'q'

droid.toggleBluetoothState(True) #if your BT is off you can switch it on
droid.bluetoothConnect(uuid,mac)
droid.bluetoothWrite(command)
time.sleep(2) #the script will pause for 2 seconds

droid.exit()

but he refuses to work.
Maybe someone knows how to finish it or another simple console-script solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-11-26
@gashopper

replace droid.bluetoothConnect(uuid,mac) with droid.bluetoothConnect(uuid) and manually make a selection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question