Thank you for your response. I was successful in transmitting data from the bluetooth bee to my mobile phone.
I found that with just the inquiry command Serial.print("\r\n+INQ=1\r\n"); in setup, it was enough to keep the device in inquiry mode.
void setup() {
Serial.begin(38400); //Serial.print("\r\n+STWMOD=0\r\n");
Serial.print("\r\n");
Serial.print("\r\n+INQ=1\r\n");
}
I had to borrow the original xbee shield with jumper pins to get it to work. I think I have resolder my shield’s pins.
As a side note, I discovered the normal ‘L’ shaped xbee shield cannot be put ontop of the electronic brick shield due to placement of the shield’s pins, not accepting ICSP pins. I don’t use ICSP that often but some other shields still utilise it, might be something nice to have in the next revision.
Yes, the execution of command STWMOD will be remembered by the Bluetooth Bee, so it is only need one time. However, the INQ should be used every time to make the module available.
By the way, command “\r\n+STAUTO=1\r\n” will make the module auto-connected to the last paired device, which means you don’t need any command to make the module connected.