Pages: [1]   Go Down
Author Topic: Android and Arduino Serial Bluetooth App – BlueSerial (Beta)  (Read 9209 times)
0 Members and 1 Guest are viewing this topic.
India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm just about putting the finishing touches on a Bluetooth SPP Android app that I spent the last few weeks working on. I know there are several that are better and do pretty much the same stuff like the Amarino and Bluetooth SPP Pro. But I wanted to code my own and release the code as open source without any restrictions. I don't want to release it unless I'm happy with the code (which needs some more refactoring), but if anyone needs the source, please let me know and I'll post the link here.

It would be a great help if folks on the forum can try it out and give me some feedback in terms of functionality and usability. I'm also happy to work on feature requests/changes that anyone can suggest.

Lastly, I feel I've reached a point where I can contribute (at least a little) in terms of any help anyone needs with getting Bluetooth running on Android and interfacing with Arduino. If anyone is having trouble with his/her implementation of Bluetooth on Android and interaction with Arduino, I'll do my best to help out. Just leave a note on this thread.

Here's the download link: Link removed Look below for link on Google play

Shameless PLUG to my blog which has more details and a video of my last bluetooth enabled robot: Click here

Update (10-July-2013): The app has been published! I've also uploaded the code to github, if anyone needs the code:

Link to App on Google Play: https://play.google.com/store/apps/details?id=com.blueserial
Link to code on github: https://github.com/plastygrove/BlueSerial
« Last Edit: July 09, 2013, 08:51:52 pm by plastygrove » Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Offline Offline
Newbie
*
Karma: 3
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
thanks for this!  I tested only between two Android devices (Nexus 4 on 4.2.2 and ASUS TF300 on 4.2.1), one of it running BlueSPP (http://www.google.de/url?sa=t&rct=j&q=google%20play%20bluespp&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.shenyaocn.android.BlueSPP%26hl%3Dde&ei=rUrHUaHRG4mLOK7JgfgL&usg=AFQjCNHYi9tZjWV9A_FxBlRKJ9QHcL0MqA&sig2=Kvfp-JQS1LTQAnD251pO1A&bvm=bv.48293060,d.ZWU)

With this combination it works great. Didn´t try with an Arduino yet though.

There had been some Bluetooth Serial Profile Bugs in Android basically blocking connections through BT SPP, do you know if they have been resolved ?

THanks, Robert
Logged


India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Robert - Thanks for trying it out. Honestly, it never crossed my mind that the app could be used to interact between 2 android devices. Were you able to establish the connection without changing the UUID? Reason I ask is that the default UUID in the app is for Serial interfaces only.

Regarding the bugs in the Bluetooth serial profile, I'm not aware of any existing bugs. But one bug I've consistently noticed when using an android phone and the JY-MCU module is that a disconnect command should always be issued before you power off either device. Otherwise, a hard reboot would be required for the other one. i.e. if you turn off the JY-MCU without disconnecting, you most likely would need to reboot your android phone before you can connect again. It won't help if you turn off Bluetooth and turn it back on under settings. I can confirm this in both Android 2.3 and 4.2.2

Thanks!
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've finally published the App on Google Play and uploaded the code on github. The first post has been edited to contain a link to both:

Link to App on Google Play: https://play.google.com/store/apps/details?id=com.blueserial
Link to code on github: https://github.com/plastygrove/BlueSerial
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Offline Offline
Jr. Member
**
Karma: 1
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks man for code!
Logged

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks man for code!

You're welcome! Glad you found it useful.
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Offline Offline
Newbie
*
Karma: 1
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
i already try using the BlueSerial and i can be used.. but i want to try to modified the app with change the textfield for input 0 and 1 using some buttons like ON and OFF button.. could you give me the information how to modified the app? thank you all.. i hope you all can give me the information about how to modified the app using buttons to control the LED.. smiley
Logged

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for using the app! I think what you're saying is completely doable but you will need a little bit of android programming knowledge. You will need to remove the text controls on the main screen and replace them with buttons similar to the "send" button currently which sends the data over bluetooth. But instead of getting the text from the textbox, it will be hardcoded to send a specific value. Then you can create more buttons, copy the code over and just change the hardcoded text.

A person on the net was able to create a color wheel and modify the same app to control the mood lighting of his RGB led strips at home. So, this should definitely be doable. Take a shot at it and let me know if you face any problems.

Work keeps me a bit busy these days, so I may not respond immediately. But I'll get back to you surely! All the best!

hi,
i already try using the BlueSerial and i can be used.. but i want to try to modified the app with change the textfield for input 0 and 1 using some buttons like ON and OFF button.. could you give me the information how to modified the app? thank you all.. i hope you all can give me the information about how to modified the app using buttons to control the LED.. smiley
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Offline Offline
Newbie
*
Karma: 1
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thankyou for your information  smiley
i already try to modified the app and it make a good one.. but i have any problems now, not for the buttons..
if we use the bluetooth for communicate between android and arduino, first me must  pair with arduino bluetooth and then we can control the arduino using android by bluetooth. the problem is, how to change the name of bluetooth of arduino and change the  pairing code from android? as usual, if we can change the bluetooth name and pairing code of the arduino, we just change in the code of arduino, like this command : ("\r\n+STNA=BluetoothName\r\n");
but how to change bluetooth name from android not from the code of arduino? Thankyou.. i need your help, please smiley


* ARDUINO.jpg (23.84 KB, 326x387 - viewed 79 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to draw graphs in android mobile out of data from accelerometer via bluetooth module,can you help me out with the graph part in android phone from the data that i have received from this app.
Logged

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thankyou for your information  smiley
i already try to modified the app and it make a good one.. but i have any problems now, not for the buttons..
if we use the bluetooth for communicate between android and arduino, first me must  pair with arduino bluetooth and then we can control the arduino using android by bluetooth. the problem is, how to change the name of bluetooth of arduino and change the  pairing code from android? as usual, if we can change the bluetooth name and pairing code of the arduino, we just change in the code of arduino, like this command : ("\r\n+STNA=BluetoothName\r\n");
but how to change bluetooth name from android not from the code of arduino? Thankyou.. i need your help, please smiley

Hey sorry for the late reply to this. That is definitely a good question. I haven't bothered to go deep into this because I didn't need it, but it's something you will need if you want to build something more than a prototype. Here is a link which allows you to change the name of the device. You can set it up so that the device disconnects when you do this, then programs it and then opens it for connection again.

Your app will also need to re-scan for available bluetooth devices. Might be a bit more involved. You can find more search results by searching for "linvor AT commands"

I am trying to draw graphs in android mobile out of data from accelerometer via bluetooth module,can you help me out with the graph part in android phone from the data that i have received from this app.


Sorry, I won't be able to help you with graphs on the Android since I haven't worked with them. But there are several results on Google and Stack Overflow which help with this.

Also here's a link that someone who used the app mailed me. It's an ECG scanner that uses Bluetooth, I'm impressed smiley
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know im re-awakening a practically dormant thread, but this seem'd as good a place to start as any.
I was wondering if anyone knew enough about java to help me meld this bluetooth serial app with another called "Arduino Colour"
Arduino Colour is an app that basically allows you to send 3 bytes representing RGB colour values over a USB OTG connection with a supported device.

You select a colour by tapping on the screen and it sends the 3 bytes that represent it over USB by calling "device.write()" which is added by a custom android driver simply called "usb-serial-for-android"
A sketch on the arduino then reads these 3 bytes and uses them to set the PWM value of 3 pins to make the LED strip change colour, though nothing says you couldnt modify it to send a comma separated list of integers and catch them on the arduino with "Serial.parseInt()" and do it that way.

Essentially, i want to add BlueTooth support to the Arduino Colour app. Any help you can offer would be appreciated.

Links to the relevent github pages are:
Arduino Colour: https://github.com/trevorshannon/ArduinoColor
USB-serial-for-android: https://github.com/mik3y/usb-serial-for-android
« Last Edit: August 29, 2014, 11:10:38 am by JamiePhonic » Logged

Pages: [1]   Go Up
Jump to: