That's what i've done : i managed to get the poweredOn event fired without any kind of trouble. Then, i wrote a small snippet of code to scan and discover nearby devices (more likely a glorified copy/paste of this example).
But no devices where found and the script juste hang there, doing nothing. I dived into the noble code and into the bluetooth-hci-socket library and with some trial and error i managed to understand two things :
The value of the bluetooth controller was undefined
The Noble library tried to bind the socket using a raw mode
So i used the global environnement variables to manually set the bind mode to user and the controller to 0 (hci0) and managed to get the snippet of code to list nearby devices, included my watch :
However, if i run the command without the --list, i get an error :
...
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 3. Received 5
...
It's another kind of problem and for now i'm quite satisfied with the progress so far, i'm gonna sleep a little bit and continue later. I will mark the thread as solved as soon as i've successfully uploaded an application to the watch.
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.
Thanks @Gordon and @Sebastian for your answers ! I did some progress !
Unfortunatly, i have a smartphone with a custom ROM instead of a stock Android one and the web browser i'm using does not work with the WedIDE.
Well, i'm a software engineer and i do plan to develop some of my own applications, especially tools for sailing ! =)
That's what i've done : i managed to get the poweredOn event fired without any kind of trouble. Then, i wrote a small snippet of code to scan and discover nearby devices (more likely a glorified copy/paste of this example).
But no devices where found and the script juste hang there, doing nothing. I dived into the noble code and into the bluetooth-hci-socket library and with some trial and error i managed to understand two things :
So i used the global environnement variables to manually set the bind mode to user and the controller to 0 (hci0) and managed to get the snippet of code to list nearby devices, included my watch :
Finally, i tried to do the same with EspruinoTools :
However, if i run the command without the --list, i get an error :
It's another kind of problem and for now i'm quite satisfied with the progress so far, i'm gonna sleep a little bit and continue later. I will mark the thread as solved as soon as i've successfully uploaded an application to the watch.
I'll keep you informed !