Jump to content

Arduino Bluetooth Help

Go to solution Solved by dany_boy,

@Amageing, check out the datasheet for all of the AT commands, you should be able to find how to get the mac address there: http://www.electronicaestudio.com/docs/istd016A.pdf

 

Hi all,

 

Firstly, I've tried the Arduino forums for help however their account system seems to be a bit broken... (I'm logged in for the account page, I then go to the forum and I'm not logged in, I then log in to find my password is apparently incorrect...)

 

Anyway that's besides the point. Does anyone know how to get the MAC address of a device connected to a HC-05 bluetooth module on an arduino in C?

 

This is so I can get the MAC address of the device and authenticate it in the arduino it's self.

 

Thanks in advance!

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/
Share on other sites

Link to post
Share on other sites

29 minutes ago, Amageing said:

Hi all,

 

Firstly, I've tried the Arduino forums for help however their account system seems to be a bit broken... (I'm logged in for the account page, I then go to the forum and I'm not logged in, I then log in to find my password is apparently incorrect...)

 

Anyway that's besides the point. Does anyone know how to get the MAC address of a device connected to a HC-05 bluetooth module on an arduino in C?

 

This is so I can get the MAC address of the device and authenticate it in the arduino it's self.

 

Thanks in advance!

If you don't set the name of the device, the MAC-adress will show up if you look for the Bluetooth-device on your computer/phone. 

Running Arch with i3-gaps on a Thinkpad X1 Extreme
Data Science Postgrad

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769581
Share on other sites

Link to post
Share on other sites

Just now, Claryn said:

If you don't set the name of the device, the MAC-adress will show up if you look for the Bluetooth-device on your computer/phone. 

Thanks for your response Claryn,

 

I think I might have failed to explain the issue properly.

 

I meant for the Arduino to read the Phone's MAC Address, not the other way around.

 

Cheers,

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769592
Share on other sites

Link to post
Share on other sites

12 minutes ago, Amageing said:

Thanks for your response Claryn,

 

I think I might have failed to explain the issue properly.

 

I meant for the Arduino to read the Phone's MAC Address, not the other way around.

 

Cheers,

What exactly do you need this for? If it is for authentication, you can simply set a PIN or password on the HC-05 bluetooth module on setup. 

Running Arch with i3-gaps on a Thinkpad X1 Extreme
Data Science Postgrad

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769631
Share on other sites

Link to post
Share on other sites

Just now, Claryn said:

What exactly do you need this for? If it is for authentication, you can simply set a PIN or password on the HC-05 bluetooth module on setup. 

Yes, I'm using the MAC address as a type of two factor authentication along with a physical PIN pad attached to the Arduino. Standard uni project.

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769640
Share on other sites

Link to post
Share on other sites

Just now, Amageing said:

Yes, I'm using the MAC address as a type of two factor authentication along with a physical PIN pad attached to the Arduino. Standard uni project.

Hm. From quickly going over the documentation for the HC-05 and checking online, I can't seem to find any ways you can actually retrieve the MAC-adress of the device that connects to your HC-05. It is weird. 

Running Arch with i3-gaps on a Thinkpad X1 Extreme
Data Science Postgrad

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769647
Share on other sites

Link to post
Share on other sites

@W-L, Shouldn't this be in hobby electronics?

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769649
Share on other sites

Link to post
Share on other sites

1 minute ago, Claryn said:

Hm. From quickly going over the documentation for the HC-05 and checking online, I can't seem to find any ways you can actually retrieve the MAC-adress of the device that connects to your HC-05. It is weird. 

My issue as well!

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769650
Share on other sites

Link to post
Share on other sites

Just now, Amageing said:

Sorry I didn't realise that was a sub-forum for that!

No worries, a friendly mod will most likely move it there soon enough.

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769658
Share on other sites

Link to post
Share on other sites

Just now, Amageing said:

My issue as well!

Are you using any libraries to handle connections etc. with the HC-05? When I did a course at Uni. where we used the HC-05, we used a library from the Institute that made it easier to use the module. We could set UUID of it, have a seperate bluetoothSerialMonitor that we used to send messages between devices etc. 

If you are using a library like that, it might have some way of getting the MAC-adress. 

Running Arch with i3-gaps on a Thinkpad X1 Extreme
Data Science Postgrad

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769660
Share on other sites

Link to post
Share on other sites

Just now, Claryn said:

Are you using any libraries to handle connections etc. with the HC-05? When I did a course at Uni. where we used the HC-05, we used a library from the Institute that made it easier to use the module. We could set UUID of it, have a seperate bluetoothSerialMonitor that we used to send messages between devices etc. 

If you are using a library like that, it might have some way of getting the MAC-adress. 

To be honest, I thought I'd try and figure this issue out before attempting to program it.

 

If there are any libraries you could recommend I'd be very grateful!

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769664
Share on other sites

Link to post
Share on other sites

@Amageing, check out the datasheet for all of the AT commands, you should be able to find how to get the mac address there: http://www.electronicaestudio.com/docs/istd016A.pdf

 

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769672
Share on other sites

Link to post
Share on other sites

6 minutes ago, dany_boy said:

@Amageing, check out the datasheet for all of the AT commands, you should be able to find how to get the mac address there: http://www.electronicaestudio.com/docs/istd016A.pdf

 

Brilliant!

 

Yeah that shows me what serial commands I need to send to the HC-05 module!

 

Hopefully I can get it working from here, thanks mate!

Amageing

Link to comment
https://linustechtips.com/topic/774405-arduino-bluetooth-help/#findComment-9769691
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×