-
when you install Node.js you usually get given the option of installing something ('Chocolatey'?) that makes it possible to install 'native' libraries - it's possible that if you didn't do that, it would fail to install these modules.
I just installed latest LTS node from https://nodejs.org/en/download and did not check the checkbox to install those extra tools on last screen. Then I run
npm -g install espruino
andespruino --list --verbose
and while the BLE sort of works it won't find my devices.Looks like the
var hasUartService = dev.advertisement.serviceUuids && dev.advertisement.serviceUuids.indexOf(NORDIC_SERVICE)>=0;
fails most probably because of https://github.com/Timeular/noble-winrt/issues/18When logging advertising data in
else console.log("Noble: Found device:", name, dev.address,dev.advertisement);
I see most devices havemanufacturerData: null, serviceUuids: [],
There is even PR for that bug waiting here https://github.com/Timeular/noble-winrt/pull/29 :-(
Can I force the device address/name somehow from command line? When I added device name to https://github.com/espruino/EspruinoTools/blob/master/core/utils.js#L665 it connected and seems to work. maybe when passing
-p macaddress
the check could be skipped as a workaround. Or maybe when called like-d deviceName
the deviceName could be added to recognisedBluetoothDevices list.Well, at least it works for all official devices in the list for now, which is good :-)
Sorry - I missed the title.
Ok, wow, that's strange then. I guess because they're listed as 'optional' it now doesn't show you if they fail to install.
The idea with the code you posted is to allow it to work with
noble
or@abandonware/noble
as the abandonware one is the one that is more recently updated - so you'd expect thatnoble
might fail because we don't choose to install that one, but hopefully@abandonware/noble
would show.Please can you try again now? I just updated the
espruino
package to attempt to usenoble-winrt
on windows, which is actually a much better, more seamless solution.If that doesn't work, maybe try
npm install noble-winrt
and then it might tell you what was wrong - when you install Node.js you usually get given the option of installing something ('Chocolatey'?) that makes it possible to install 'native' libraries - it's possible that if you didn't do that, it would fail to install these modules. Definitely when I tried again on a Windows PC here it was fine (although BLE still refused to work out of the box until these most recent changes).I should add that even if that fails, you can still use the CLI by using your phone as a Bluetooth connection: https://github.com/espruino/EspruinoTools#web-ide-relay