I am new to embedded programming and I am given a project to establish Bluetooth communication between an Android tablet and an ARM development board with Bluetooth capabilities.
Please tell me whether this project can be done or not ??
If it can be done then how should I approach it ??
Thanks
Check out this page: http://www.amarino-toolkit.net/
They are using the arduino board with a bluetooth component to connect to android. You can check the source code of their library to see how they establish and use the connection here:
http://code.google.com/p/amarino/
If what you want is a simple and robust communication method over Bluetooth then SPP is definitely the way to go.
The only issue could be the bandwidth, but if the throughput of a traditional serial cable connection is enough for your application then there certainly won't be any problems there. IIRC then most modules have > 1 Mbit throughput using SPP.
Some information about using SPP on Android is here.
But we need a little bit more information to give suggestions about what you need to do on your ARM kit. Maybe you could post a few details about its type, which Bluetooth module is in use there, how it is connected to the ARM MCU etc.
If you're lucky then your kit's BT module can function as a serial cable replacement and you can treat it as if the Android device is connected to your MCU's UART. Of course prior to that, some configuration is needed over some interface (could be the same UART, depending on module type) to establish a Bluetooth connection.
Oh and to answer your first question: yes, it certainly can be done :)
I haven't worked with Android to ARM board via bluetooth but I have done some work communicating between an Android device and an Arduino using bluetooth. I tried to document what I learned in a series of examples. There are several that might be helpful.
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-basic-bluetooth.html
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-turning-led-on-and.html
http://digitalhacksblog.blogspot.com/2012/05/android-example-bluetooth-simple-spp.html
The first two examples show how to setup communication via bluetooth from an Android device to an Arduino with a bluetooth board. I would expect that to get some initial connectivity between the Android and the ARM the Android side of things would be the same.
The third example shows how to setup a simple spp client and server between an Android device and a PC running windows.
Hope this helps.
Related
Here's the setup, I have an Android app that discovers BLE devices, and to do some test automation I'd like to write a program that simulates, mocks, one or several BLE devices.
I have a Nordic BLE USB stick (PCA10031), and thought I'd use that, since the actual device uses a Nordic BLE chip as well.
This is a broad "question" but I'm not sure how to start. It doesn't seem to be any JAVA or Python APIs, how do I mock a device with this setup?
Thanks to all who read my clumsy question
I don't understand your question completly.
Can you be more precise? I assume you want to write your own app to communicate on BLE with the Stick in server role? What's you target from which you want to run your stick?
I would like to transfer files between my bluetooth device and iphone.
Is there something similar to android.bluetooth.BluetoothSocket on the iOS platform?
Some code samples on connecting to the bluetooth socket will be greatly appreciated.
This article describes 5 ways to set up data exchange over Bluetooth; 2 of them (usage of private API and usage of Ringwald's BTStack on jailbroken devices) won't allow your app to be published on AppStore; one doesn't look to be a real option (MFi licensing). There are 2 options that could be useful:
Using GameKit. This enables your app to have Bluetooth connectivity only with iOS devices. So seems it's not an option for you.
Tutorial: http://code.tutsplus.com/tutorials/bluetooth-connectivity-with-gamekit--mobile-11610
Using CoreBluetooth. Doesn't limit connectivity to iOS devices only but requires support for Bluetooth Low Energy (BLE) protocol from devices you're going to connect to. I investigated possibility to connect iOS and Android via BLE about year ago and came to conclusion that android devices didn't provide enough BLE support at that time. Maybe something has changed during past year. Please note that BLE doesn't provide a 'socket-like' paradigm, so it may not fit your needs.
Tutorial: http://code.tutsplus.com/tutorials/ios-7-sdk-core-bluetooth-practical-lesson--mobile-20741
For future visitors, you can open L2CAP channel from your CBPeripheral to have an unrestricted connection to transfer your data. See below for documentation and how to use example source code.
https://developer.apple.com/documentation/corebluetooth/cbperipheral/2880151-openl2capchannel
https://github.com/paulw11/L2CapDemo
Watch this from WWDC2017
I'm developing an Arduino project (but this is not important). For this project I need to communicate (radio control) to my Arduino from my PC. The idea is to send the message or the instruction to my smartphone (cheap Android), which is connected to the internet over 3g. Then the phone will communicate to Arduino thank to the audio port (jack audio), sending a frequency controlled pulse, that is quite easy to do.
The problem is the communication between the PC and the smartphone.
Somebody has an idea of how to achieve that, eventually creating a simple application, or better, directly from the opened smartphone browser (android froyo 2.2)?
Which is the best server technology to use, and the faster, considering the tipical 3g ping?I haven`t found any source on the web, so I hope in your answers.
The microcontroller can be, with Wifly and this firmware https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip , a server (switching the led signal through 192.168.1.195/YT in adress bar) or also a client (the AD converter value is inserted in google databank).
I believe this could solve your problem: htpp://www.muzzley.com
Download C#/java sdk/nodejs and build your app in your computer (and connect it to arduino has you would like)
http://www.muzzley.com/downloads
Build your own widget to run on the side of the smartphone through this widget: http://www.muzzley.com/documentation/widgets/webview.html
note: you do not need to worry about the smartphone app. It's already done. Just build your own interface
How it will work
[SMARTPHONE 3g/4G] ---> [Computer with app] ---> arduino
I hope it helps.
As a part of feasibly study. I need to choose between Android or iOS for integrating it with an embedded system.
Basically, that embedded system will have an AVR or a PIC Microcontroller. I want to establish a communication between a mobile and that particular system.
Need some wireless technology for communication (bluetooth,wifi,internet etc..)
Micro Controllers have communication ports like UART, USART etc..
It really depends on the kind of communication you need.
I particular, if you have a normal WIFI connection and your controller can work with receiving & sending your data via wifi, you may go iOS or Android.
If however you need some kind of free format serial communication, you need to go Android, serial cable via USB.
recarding other factors, I guess it really is just a personal taste issue.
Could you give more info on how & what needs to be communicated and what kind of communication device you have between your phone and the device itself.
Not sure if this is similar to what you have in minde, but you might look at this: http://www.arduino.cc/ being probably the best known example in this context.
Using some serial to bluetooth module would be the most easier to implement.
I would go with Android unless your target audience are photographers. Seriously. Also, with iOS you need to be careful. For instance you want to use BlueTooth, but not all iOS devices will connect to, say, the Bluetooth protocol for a keyboard. (Ah! You didn't know there were more then one Bluetooth protocol did you?) And I don't think any iOS device will let you connect using the Bluetooth serial port protocol.
With Android you can jump in and start flying immediately by using the (or a copy of) the PIC 24F based IOIO board. And if you are an Android / Eclipse developer (I think) you can down load and use the IOIO JAVA / Android libraries. I have been told this makes programming the IOIO board just about as easy as programming an Arduino. Especially if you are well versed in JAVA, Android and the Eclipse editor. Add to this the IOIO board can be a host to the Android (i.e. connected by wired USB) or host to some Bluetooth modules (i.e. connect to the Andoid's bluetooth radio).
If you don't want to go it along you can buy the Microchip Android Development Kit (ADK) board which is also a PIC 24F based "USB wired" using AOA protocol to connect to an Android. I say "not going it alone" as I would expect you can then get limited support from Microchip w.r.t. their hardware (the ADK board), software (Android) and firmware (PIC ADk board). This solution, however, does not have built in Bluetooth support. I am guessing you can add it, it's just not part of the ADK software/firmware that Microchip put together.
Is it possible to communicate an Android application with a PIC microcontroller by the serial port? What phones of low cost can I use?
Sorry by my englisg, I'm from Colombia.
Not sure about PIC, but Arduino might be a good reference point and has a Android coupler called Amarino. Good luck.
Yes it is possible to communicate an Android application with a PIC microcontroller via Bluetooth also. Check that post here every thing written so descriptive and i test the code, they are given, it simulate in proteus.
http://www.nbcafe.in/interfacing-android-with-pic-microcontroller-via-bluetooth/
Well, it is indirectly possible via Bluetooth, that is for sure. As Peter Chuang stated, there has been some work done for interfacing Arduino boards and Android phones in the past. The exact same methodology can certainly work with a PIC microcontroller.
All you need is:
A PIC, preferably with an hardware UART to simplify coding (else software UART routines exist all over the net);
A Bluetooth serial module. An example of one would be the RN-42/RN41 from RovingNetworks (which is the basis for many Bluetooth adapters you might find on Sparkfun and other hobbyist-catering electronics stores)
An Android phone with Bluetooth.
I have actually tested such an interface myself, with a PIC18F26K22 linked to a RN-42 module, both being powered by a 3.3V linear regulator (MCP1700 3.3V). It is nearly plug and play, with baud rates easily achievable if in the low range (9600 baud and 19200 baud). As for higher baud rates, it is also possible if the PIC is clocked by a stable oscillator in the MHz range, and if the baud rate chosen corresponds to a USART BSEL register value that results in a close baud rate match between the 2 devices (which is possible because the RN-42 allows custom baud rates).
As for coding Bluetooth using Android SDK, it is a straightforward task using Google's own Bluetooth classes (BluetoothAdapter, inter alia)...
Microchip now has a PIC 24F based board that uses the Android Open Accessory (I think that's what AOA stands for) protocol over the USB port. You can buy the board (called the Android Discovery Kit or ADK) from Microchip. I believe both the Android software and the PIC software are inside the current Microchip PIC software libraries down load package.
Of course if you want to go open-souce you can go out and get the IOIO board. I believe that board uses a slightly different PIC 24F processor. And it may be using the Android debugging protocol instead of the newer AOA protocol. I think it depends on what version of the IOIO board you get. Also, I think the IOIO board can play host to either the Android (like the ADK does) as well as some (not all) bluetooth USB dongles.
You will have to "roll your own code" based on the example Android ADK code from Microchip. However, with the IOIO board, you can download a library of methods that you can call. The library abstracts the PIC features to the point of simply typing IOIO... into the Eclipse editor and having it come back with a list of matching methods. Or so I understand.
Yeah it is possible. You need to use Bluetooth chip which talks over Bluetooth SPP.
e.g. I used CSR-BC417 for more info Link to info of Bluetooth Chip
Micro-controller talks to Bluetooth chip using UART AT commands.
On other end you already have Android App like Bluetooth Chat where you can see the data coming from micro-controller and respond to it.
Download Android App
It is possible, i was using my Android smartPhone to send orders to a PIC microcontroller, you can use Bluetooth or WiFi hardware and the UART of the PIC, for example with de HC-06 bluetooth module or the Microchip's RN171XV WiFi module
about the app, i'm using this one:
https://play.google.com/store/apps/details?id=com.vagoscorp.virtualterminal
it's free and have a lot of working modes
for example instead of sending 123 as a character string '1' '2' '3', you can send it as a byte (byte value can be 0 up to 255), letting you to save and use directly the data as a number in the microcontroller ;).
You can see the received information as characters and/or bytes too (character 'A' have a byte value of 65, that's ASCII code, '1' will be 49)
I hope it will help you
Yes you can connect it. The best or easy way to connect is use HC-05 Bluetooth module. It is cheep and a loot of tutorials available make a google serch HC-05 interface pic.
Another way if you want connect through usb to serial converter you need to develop usb to serial driver or you can use a usb to serial converter chip that supports linux Driver and make a android application with these driver. If you are not a expert, I suggest to use hc-05 Bluetooth. It is a better option.