Lil' Blackbox

Coding => v2.0 => Topic started by: hakcenter on September 06, 2016, 07:42:56 PM

Title: LBB Bluetooth Updater
Post by: hakcenter 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...
Title: Re: LBB Bluetooth Updater
Post by: hakcenter 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.


// 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.


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.
Title: Re: LBB Bluetooth Updater
Post by: hakcenter on September 06, 2016, 07:45:53 PM
reserved