python - send string variable from raspberry pi 2 to android app over bluetooth -
i developing android app using android studio receive string(results) raspberry pi after image processing code .
i using python 2.7.3, opencv 3.1, numpy 1.8. bluetooth chip rn42xvp connected raspberry pi 2
i read question receiving data raspberry pi in android via bluetooth
i tried gave many errors , undefined variable! anyway think not searching for.
what need send content of string python code on raspberry pi android application.
when button clicked in android app receive , display content
the following general approach: read manual
read data sheet, has information on how connect , talk device. need figure out following:
- how want connect device (the product page mentions uart or usb).
- depending on choice figure out hardware module needs in order run (capacitors, voltage supply, etc.).
after connect device usb- or uart-capable pins on raspberry pi.
then want open device file descriptor on raspberry pi, talks pins. (normally
open(file, "w")
should sufficient). (if not sure, refer raspberry pi documentation or google it.)everything write file descriptor gets sent wireless module.
figure out how communicate module (what commands need send, how set up, etc.).
write python code.
after googling it, seems, popular module , has been used arduinos, maybe can find tutorial on how connect it, i'm pretty sure there libraries written, spares hassle of writing yourself.
the following link describes how connect module arduino, should easy same raspberry pi: http://dduino.blogspot.co.at/2012/03/arduino-rn-42-bluetooth-module.html
Comments
Post a Comment