I'm afraid I don't have many ideas... You could try waiting (with setTimeout) for a second after you establish the connection before you try and use getPrimaryService and see if that helps?
But if you google BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED there are a bunch of posts. One interesting one says this:
OK, I see what is happening.
My Peripheral device is "bonding" with only one device. I have to go thru a reset sequence on it to allow it to bond to a different Central.
Do you think that could be a possibility? That the GPS device is actually only allowing itself to be connected to just one device (like your phone)?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm afraid I don't have many ideas... You could try waiting (with setTimeout) for a second after you establish the connection before you try and use
getPrimaryService
and see if that helps?But if you google BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED there are a bunch of posts. One interesting one says this:
Do you think that could be a possibility? That the GPS device is actually only allowing itself to be connected to just one device (like your phone)?