Pages: [1]   Go Down
Author Topic: Read MAC address of a bluetooth device connected to arduino  (Read 4340 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello forum!

I was reading topics here, googling and I can't find any code to do this.

I developed an android app that sends signals to my arduino nano via bluetooth. Everything works ok, but I want to do some actions in my sketch if the android device connected to arduino has a particular MAC address.

How can I know the MAC address of a device connected via bluetooth to my arduino?

Thank you in advance.
Logged

USA
Offline Offline
Full Member
***
Karma: 0
Posts: 238
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where is the documentation for this product?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


@A_tec, please do not cross-post.
Logged

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


@A_tec, please do not cross-post.

Sorry!

Where is the documentation for this product?

Do you mean bluetooth module? There is no specific documentation for this bluetooth module, I bought it in DX

http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299



Logged

USA
Offline Offline
Full Member
***
Karma: 0
Posts: 238
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If there is no documentation then how can we help?
Logged

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

If there is no documentation then how can we help?

Maybe you can't, perhaps someone have the same device or knows how to get this data.
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2192
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If there is no documentation then how can we help?
Maybe you can't, perhaps someone have the same device or knows how to get this data.

I think we might be at the stage where anybody who asks you for the documentation isn't going to be of any help to you.

I'm not completely au fait with these devices, and I don't understand what you are trying to do, so I have a question. Why do you want a MAC address?  

I do have a JY-MCU that looks exactly like yours, and it works, but I am not using it the way you want to.  

As I understand it bluetooth devices recognise each other, get paired by the user, and talk. That is their job, and that is the way I use mine. No MAC address.

It appears that the JY-MCU label simply refers to the board with a four or six-pin connector, and the HC-05 module is fixed thereto.  The HC-05 is what you might want to know about, but probably don't. As far as I know, there is no documentation for the JY-MCU, and there is no need for it. All you need to know is written on the back of the board.  

Documentation for the HC-05 is here

http://notes-application.abcelectronique.com/314/314-67142.pdf

and here

http://www.hmangas.com/Electronica/Datasheets/Bluetooth%20Module/BluetoothHC05%20satistronics.pdf

and I can't find anything about mac address in either of them. I'm not surprised about this - yet
« Last Edit: January 19, 2013, 12:09:27 am by Nick_Pyner » Logged

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


I want to secure the access because I will use the arduino to open a door, first security is change the bluetooth pair code, the second one is filtrate which android device can open it.

I need to know which device is connected, if I have this in the sketck I don't care if you run my android app and know the bluetooth pair code.

Maybe saving in a var the devices previously scanned with AT+FSAD=<Param>?

Thanks for docs!
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2192
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe saving in a var the devices previously scanned with AT+FSAD=<Param>?

I don't know. I'm only into datalogging.
Logged

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

If you have an Android device with bluetooth module:

1. Start your Arduino BT module
2. Install and run Android application that scans for BT devices and displays their MAC addresses ( https://play.google.com/store/search?q=bluetooth+scanner&c=apps )

Regards!
Logged

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

If you have an Android device with bluetooth module:

1. Start your Arduino BT module
2. Install and run Android application that scans for BT devices and displays their MAC addresses ( https://play.google.com/store/search?q=bluetooth+scanner&c=apps )

Regards!

That way is solved, I need from the other side, wich android MAC is connected to my arduino and filtrate into the sketch, thanks anyway.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 66
Posts: 2474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you need an HC-05 BT module that is master/slave switchable because to read mac addresses you need to be in master mode to scan for devices in range and connect to them. A slave only device (HC-06) does not have the commands to read the mac address.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

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

Thanks Riva!, I will try with HC-05 mudule.
Logged

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

hello A_tec

I'am digging out this old topic, cause I'd like to do the same thing as you did.
Did you finally get a way to read the android device MAC adress using your arduino?
Wich BT module did you used finally?
Thanks in advance !
Logged

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

Hi! Actually is working with the HC-06 module, but without reading the address from the android device.
I will buy HC-05 module after Christmas and test it.

I found this useful instructable: http://www.instructables.com/id/Andruino-A-Simple-2-Way-Bluetooth-based-Android-C/

regards.
Logged

Pages: [1]   Go Up
Jump to: