RN42 PIN code configuration issue: configured PIN is rejected
I'm using the RN42 bluetooth module over 9600 UART, RX/TX only.
I've been able to successfully enter/exit command mode, configure device name, set authentication mode, and configure the PIN. To test my configuration, I'm opening an SPP serial port on an Android device. I can see bytes transmitted to and from my Android device as expected.
I am having trouble getting consistent or understandable PIN authentication behavior. Here's the sequence I'm observing:
1) Enter command mode
2) Configure device name, authentication mode (4), PIN code
3) Exit command mode
4) Attempt connection to device from Android app: connection rejected due to incorrect PIN when I enter 4,3,2,1.
5) Open serial port to RN42. Confirm manually that the pin code is correct. The configuration readback command ('D') confirms that the pin is set to 4,3,2,1.
Here's what I get in response:
6) Manually repeat PIN configuration by sending SN,4321 again.
7) Attempt to connect from Android is successful now.
Any idea why the PIN is rejected after (apparently successful) configuration the first time? After every command, I'm checking the response from the RN42 module and it looks correct (AOK,CMD, or END depending on the input).