Serial Data Transfer via Bluetooth

by AnthonyB » Wed, 17 Mar 2010 04:18:43 GMT


Sponsored Links
 I'm trying to get serial data from a USB Weather Board from Sparkfun
Electronics using one of their SPP Bluetooth Modems.  This device will
be able to send serial data over bluetooth and all I wan't to do is
read and store the data.  I'm pretty sure this is possible but I'm
still not great at writing code for an android device yet. After that
I want to take that data and put it into a human-readable way for
instance for temperature have ("Temperature= 70F"). The value of 70
will come from the serial ascii string of bytes and I'll probably be
able to work with the data after I get it and save it.  So can anyone
give me a little bit of code on how to read and store the ascii string
or give me a good example to look at?  Also the string is 46 bytes and
starts with a # sign and ends with a $ sign and I'd like to use that
to make sure I just get one string of data.  Any help or insight would
be greatly appreciated.

Thanks
Tony

--



Serial Data Transfer via Bluetooth

by DonFrench » Wed, 17 Mar 2010 09:27:06 GMT


 Look at the Bluetooth Chat example and change the UUID to
"00001101-0000-1000-8000-00805F9B34FB".  That should get you going.




--


Sponsored Links


Serial Data Transfer via Bluetooth

by BobG » Thu, 18 Mar 2010 03:05:43 GMT


 Hi Don. I think you need 2.0 or higher to run the bluetooth chat
example.. wish it wasnt so... I have a dev phone 2 (Google Ion? Does
it have other names? HTC something? TI something?) with 1.6. Someone
know how to use the bt backport examples? What dir do I put the jar
file in?

--



Serial Data Transfer via Bluetooth

by DonFrench » Thu, 18 Mar 2010 06:14:21 GMT


 Then we are out of my comfort zone.  You might check this site though,
 http://www.amarino-toolkit.net/documentation.html.  According to 
Bonifaz Kaufmann, the developer of Amarino, they are communicating via
Bluetooth SPP with   the following devices, all pre 2.0.

    * HTC Dream (aka T-Mobile G1, firmware 1.1, 1.5 and 1.6)
    * HTC Magic (firmware 1.5 and 1.6)
    * HTC Tattoo (firmware 1.6)
    * Huawei U8220 (aka T-Mobile Pulse, firmware 1.5)
    * (partially tested) Samsung Galaxy (firmware 1.5)

You can find the entire source code of Amarino here: 
 http://code.google.com/p/amarino/ 
and it includes all the Bluetooth related stuff as well.  Good luck.







--



Serial Data Transfer via Bluetooth

by Ben » Fri, 19 Mar 2010 05:43:37 GMT


 I've attempted to use the unofficial Bluetooth API for 1.6, got
through finding the adapter and the remote device, but could not open
an RFCOMM socket.  You should be able to put the Jar anywhere as long
as Eclipse--if that is what you are developing on--points to it.
There are instructions on how to external libraries on the android
developer site:

 http://developer.android.com/guide/appendix/faq/commontasks.html 

Though google advises against using these to future proof your app.




--



Serial Data Transfer via Bluetooth

by Lovers v. Haters » Fri, 19 Mar 2010 05:44:56 GMT


 I agree-- Amarino is pretty useful.  I'm doing a project that uses
Amarino to transmit strings of data over XMPP.  (Google put the kibosh
on making your own jabber client, but I found a useful JAR to get
around it.)  Put Amarino together with XMPP and your device becomes a
great transmitter for broadcasting microcontroler status anywhere
instantly.

If you're interested in going that route, check out (in addition to
Amarino)
1) Asmack (Jabber hack for 1.5 and 1.6-- not sure about 2.0)
 http://github.com/rtreffer/asmack 
2) ChatStar (which I wrote cobbling Amarino and Asmack together)
 http://github.com/harlo/ChatStarr/ 

Thanks,
Harlo/Lovers v. Haters





--



Serial Data Transfer via Bluetooth

by BobG » Sun, 21 Mar 2010 03:00:45 GMT


 Thanks Ben... your message was the clue I needed... I put the backport
jar file in a dir in the package, went to the package properties and
added the jar under 'link external jars', and the bt chat compiled
right up. Lots of details need to be right to get this stuff to work,
huh?

--



Serial Data Transfer via Bluetooth

by Ben » Sun, 21 Mar 2010 23:25:15 GMT


 No problem Bob.  Let me know if you are able to open an RFCOMM socket
it never worked for me.  I checked the Amarino source code, and it
looks like I am doing basically the same thing that they are, but for
some reason they can get it open and I can't.  So for now I've
modified my app to use a broadcast receiver to receive data from the
amarino like the examples.  Though I don't have my Bluetooth antenna
hooked up to an Arduino, it's hooked up to a Blackfin DSP, so
hopefully there is nothing about Amarino that actually requires the
thing on the other end of the UART to be an Arduino.  Looking through
the source I can't find anything that would limit it like that, but
I'll see.




--



Serial Data Transfer via Bluetooth

by Shane » Sat, 27 Mar 2010 04:57:15 GMT


 Hi guys,
Im new to android and im trying to use the bluetooth backport. Could
someone explain what the step "put
backport_android_bluetooth.properties in to your src directory. "
means? Do i create a file and paste in the code or is there something
im missing. Ive followed the other steps and its not working for me so
i think the problem lies here.

Thanks





--



Other Threads

1. To Play .mp3 from host machine filesystem

Hi All,

Is there any procedure to play .mp3 file stored in a filesystem of
host machine (windows XP) without getting into file system of
emulator.

I know its least useful scenario but i am just curious to know
whaether MediaPlayer class supports it or not ?

Thanks
Sal
--~--~---------~--~----~------------~-------~--~----~

2. About davikvm's GC

Hi:

I have some small questions about Davikvm's GC:

Does davikvm's gc derived from Apache harmony GC?
If it is true, which version of GC it is based(I mean GCv5 or ...)?
Are there some big upgrade or update related which davikvm's GC later?

Thanks&BstRgds
gan

--~--~---------~--~----~------------~-------~--~----~

3. How to find out which package started an intent?

4. service with a UI

5. Unable to get all phone numbers of a contact.

6. Why Google does not accepts my Visa credit card?

7. FM application on Android.