tfabris / BlueGigaEmpeg

Arduino module and daughter board to convert the empeg Car MP3 player to Bluetooth output.
GNU General Public License v3.0
0 stars 0 forks source link

Auto reconnect does not work on the second paired device. #63

Closed tfabris closed 6 years ago

tfabris commented 6 years ago

Repro steps:

Expected: BGE should auto reconnect to the Honda.

Actual: BGE does not auto reconnect to the Honda.

Suspicion: the connect message that I normally use for triggering the auto reconnect applicator string either doesn’t appear, or if it does, it contains a channel number digit which is too high and the string does not match.

tfabris commented 6 years ago

Suspect that the 0 in this code is the culprit:

if (theString.indexOf(F("AUDIO ROUTE 0 A2DP LEFT RIGHT")) > (-1))
{

SendBlueGigaCommand(autoReconnectString);

tfabris commented 6 years ago

I have done my best to fix this issue, but only time will tell if it is fixed or not.

Closing bug. If it recurs, we can reopen the bug.

tfabris commented 6 years ago

My attempted fix to the audio route 0 string did not help.

Instead I think what is happening is this (guess). If you have more than one paired item in the table, it cycles through them. So your reconnect retry speed is reduced by the number of paired items.

Research to see if you can program it to only pair with one thing. A new pairing forgets the old one.

tfabris commented 6 years ago

You can use SET BT PAIRCOUNT 1 to limit the pairings to 1 and you must also set the config bit 12 "automatically make room for new pairings".

Though only do it after clearing the pairings. Here's the notes from the docs:

Note: It is highly recommended that config bit 12 (automatically make room for new pairings) is set, because if the maximum pair count is reached and a remote party wishes to pair to us, they may see a successful pairing followed by a failed connection attempt, because we have no room to store the new link key while at the same time they have stored it.

Also, SET BT PAIRCOUNT should never be issued before all the pairings are cleared, because it may not parse partially filled pairing tables correctly. When using SET BT PAIRCOUNT, you should set it only once. If you need to change the pairing count, delete all old pairings before doing it.

tfabris commented 6 years ago

I think this means that the 5100 in SET CONTROL CONFIG needs to be changed to 5900 in order for the pairing to automatically overwrite.

tfabris commented 6 years ago

Nope I was off by one. 5100 is already set correctly in SET CONTROL CONFIG so that it will already make room for new pairings. So the only change would be SET BT PAIRCOUNT 1 in the setup right after clearing out all the existing pairings when you press the reset button.

tfabris commented 6 years ago

New fix attempted with SET BT PAIRCOUNT 1.

Closing bug. Reopen if issue recurs.