LBB Bluetooth Updater

  • 2 Replies
  • 500 Views
*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 702
    • 1998 12v Ram
LBB Bluetooth Updater
« on: September 06, 2016, 07:42:56 PM »
Latest Version
You will need to be a registered forum user to see the attachment, but there is a Arduino Sketch attached to this post.

Detailed list of code will follow...
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.


*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 702
    • 1998 12v Ram
Re: LBB Bluetooth Updater
« Reply #1 on: September 06, 2016, 07:43:00 PM »
The bluetooth unit installed on the LBB's are HC-05. It is a seemingly robust bluetooth module, with a simple AT interface, and has been absolutely rock solid during hours of testing.

If you ever want to change the bluetooth name of the device, or the pin #, this is the sketch that you'll want to use.

Code: [Select]
// HC-05
// AT                 = AT MODE                                 OK / ERROR(0)
// AT+ORGL            = Reset to defaults
// AT+RESET           = Reboot module                                     
// AT+PSWD=9220       = Set bluetooth pin 9222                  OK
// AT+UART=115200,1,0 = 115200 Baud, 1 Stop Bit, 0 Parity       OK
// AT+ROLE=1          = 0 Slave, 1 Master, 2 Slave-Loopback     OK
// AT+CMODE=1         = 0 Fixed, 1 Any, Slave-Loop              OK
// AT+NAME=LBB                                                  OK
// AT+RMAAD           = Remove paired devices                   OK
// AT+INIT            = Reboot and intialize module             OK

int timer = 0;

boolean interface = false;
boolean needs_endline = false;

String pin = "\"9220\"";
String pin2 = "9220";
String lbb_value[9] = { "AT", "AT+ORGL", "AT+PSWD=" + pin, "AT+UART=115200,1,0", "AT+ROLE=0", "AT+CMODE=1", "AT+NAME=LBB", "AT+RMAAD", "AT+INIT" };

boolean next_step = false;

Change the value at +PSWD=9220, to your pin numbers of preference
  * If setting the PIN errors, use pin2
Change the value at +NAME=LBB, to change the name, do not use spaces

The rest should be left alone unless you know what you are doing.

  • Setup the serial interface on the Arduino IDE to baud rate 38400, upload the code to your LBB
  • Move the J_PRG jumper to both pins
  • Turn the BT Switch off, then back on
  • Wait for the state light to blink slowly, and remove the J_PRG jumper back to a single pin

Using the Arduino IDE, open the serial monitor and watch.

If the screen just spams AT, with no progress. Press the reset button on the LBB, then the code should execute.
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.


*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 702
    • 1998 12v Ram
Re: LBB Bluetooth Updater
« Reply #2 on: September 06, 2016, 07:45:53 PM »
reserved
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.