Disconnect can cause an error if the bluetooth operation had failed because the device got disconnected - so ideally you'd print the first error or disconnect will throw an exception which will stop the first error getting printed.
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.
Ok, just fixed - turns out there were two issues:
NRF.connect
- I guess most times people userequestDevice
so it hadn't been spotted.If you use one of the latest builds from http://www.espruino.com/binaries/travis/master/ then it should be fixed now.
I'd modify the final bit of your code though to swap around the
console.log
anddisconnect
:Disconnect can cause an error if the bluetooth operation had failed because the device got disconnected - so ideally you'd print the first error or disconnect will throw an exception which will stop the first error getting printed.