3

I have developed an application on Android, which connects to a Bluetooth HM10, launches commands, and turns LEDs on and off through my Arduino. All of this works properly.

So, I want to make Bluetooth secure, so that nobody can connect to it, and keep it busy and I can't connect myself.

To do this, from my Serial Monitor I execute the corresponding configuration commands, but I never get it to link correctly on my Android.

I have tried many options, to no avail:

OPTION 1)

  • AT+ROLE? = Ok+Get:0 (Slave or Periphe)
  • AT+TYPE2 = Ok+Set:2 (Auth with PIN)
  • AT+PASS123456
  • AT+RESET

OPTION 2)

  • AT+ROLE? = Ok+Get:0 (Slave or Periphe)
  • AT+TYPE3 = Ok+Set:3 (Auth and bond)
  • AT+PASS123456
  • AT+RESET

In both cases (and more failed tests), I see the BLE device on my Android Bluetooth. I give it to connect and the window to enter the password pops up. I introduce 123456 And it always tells me that it could not be linked.

Any ideas for why?

Thank you.

asked Jan 27, 2021 at 7:15
16
  • I'm not an expert but the AT commands seems a bit strange. e.g. I would expect to enter a new PIN with AT+PASS123456. Perhaps the space is part of the PIN in your case. Just a guess. Also, the question mark after PASS is used (AFAIK) to read the PIN, not to set it. Just some guesses, without knowing much about AT commands. Perhaps it works. Cheers. Commented Jan 27, 2021 at 11:19
  • The ROLE command also has a question mark. But as 0 is the default it is not a problem. PASS is just an alias for PIN so the official AT-command to set a new PIN is AT+PIN123456. Commented Jan 27, 2021 at 11:29
  • As you set the type to 3, the module requires authentication, but (I guess) the password/PIN is still 000000. Commented Jan 27, 2021 at 11:34
  • @PeterPaulKiefer I have modified the initial message, because yes, I put it wrong. The password setting is without "?" And, no, I am not putting any spaces after the password. I have made sure they are only 6 digits, clean, with no spaces. Commented Jan 27, 2021 at 20:16
  • 1
    I live similar problem. kio4.com/arduino/161_HM10_BLE_Actualizar.htm Your page is very very successful.All the instructions are working. I will use the pio for opening the door of my car. Thank you very very much for you help. I have a problem but.I give password to module and give the typr 3 or 2 .I try this but iphone asks for paşrşng password.I wrote wrong password but system connects and works.Beaceuse of this issue I can not use on my car because, if I wrote wrong pin it connects also.There is no password protection on the car than.so I cannot solve the password problem.What must I Commented Mar 1, 2021 at 23:21

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.