What peripheral are you trying to connect to? I think what's happening most likely is the peripheral might be bonded to some other device already? It connects, realises that it doesn't have any shared keys with Puck.js during the negotiation procedure, and then disconnects immediately.
It all happens in the background using interrupts, so it's not a big surprise that the state suddenly changes.
Does this work with a different peripheral device?
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.
Does it say timeout anywhere?
What peripheral are you trying to connect to? I think what's happening most likely is the peripheral might be bonded to some other device already? It connects, realises that it doesn't have any shared keys with Puck.js during the negotiation procedure, and then disconnects immediately.
It all happens in the background using interrupts, so it's not a big surprise that the state suddenly changes.
Does this work with a different peripheral device?