Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphero Bolt Support #20

Closed
olafjanssen opened this issue Dec 10, 2018 · 18 comments
Closed

Sphero Bolt Support #20

olafjanssen opened this issue Dec 10, 2018 · 18 comments

Comments

@olafjanssen
Copy link

olafjanssen commented Dec 10, 2018

First of all, great work on trying to keep the Sphero alive for Node.js. I am trying to connect my Sphero Bolts. As a quick test, I tricked the library by changing the prefix of one of the other types to 'SB'.

However, the examples end up doing:

PACKET RECEIVED BUT NOT EXECUTING { command: 
   { commandId: 19,
     deviceId: 1,
     payload: [ 0, 0 ],
     raw: Uint8Array [ 141, 41, 1, 19, 13, 0, 0, 181, 216 ],
     sequenceNumber: 13 } }
@igbopie
Copy link
Owner

igbopie commented Jan 2, 2019

Hey! I am sorry but I don't have a Sphero Bolt, so I can't really say what is going on. That msg may not be an issue. That happens when bolt sends a msg to host but the host is not expecting one.

@igbopie
Copy link
Owner

igbopie commented Jan 17, 2019

I am thinking that it may have a different protocol. Maybe you can get a bluetooth dump, using the app, and we can investigate.

@igbopie
Copy link
Owner

igbopie commented Mar 8, 2019

Hey! I am making some progress in making the bolt work! I will update something soon :)

@igbopie
Copy link
Owner

igbopie commented Mar 11, 2019

Hey! I added sphero Bolt! let me know if it works

@igbopie
Copy link
Owner

igbopie commented Mar 11, 2019

#54

@Olindholm
Copy link

I have not been able to get it to work. Here's what I have.

spherov2.js

const { Scanner, Utils, SpheroBolt } = require('spherov2.js');

async function run() {
	var bolt = await Scanner.find(SpheroBolt.advertisement, "SB-EE1B");
	bolt.roll(50, 0);
}

run();
pi@Marengo:~ $ sudo node spherov2.js
Scanning devices...
name: Sphero Bolt, uuid: fe5dc988ee1b, mac-address: fe:5d:c9:88:ee:1b
Done scanning devices.
Starting...

It just gets stuck here, nothing ever happens after this. The bolt doesn't light up or anything, nothing.

@igbopie
Copy link
Owner

igbopie commented Mar 11, 2019

What platform are you using?

@igbopie
Copy link
Owner

igbopie commented Mar 11, 2019

Oh, raspberry, I can try on mine and let you know

@Olindholm
Copy link

Correct, I am running a Raspberry Pi 3 B+, with nodejs v8.15.1.
Originally I was running v11 but had problems installing noble (bluetooth-hci-socket to be exact). Reverting back to v8 resolves the issue.

@igbopie
Copy link
Owner

igbopie commented Mar 11, 2019

That might be an issue, can you try with node 10?

@Olindholm
Copy link

Olindholm commented Mar 11, 2019

Well, so I upgraded nodejs to v10.15.3 and tried installing noble. However just as before I am met with a huge error message, just like this guy who suggested to downgrade to v8 which worked previously.

Attached Error message

pi@Marengo:~/spherov2.js_3 $ nodejs -v
v10.15.3

pi@Marengo:~/spherov2.js_3 $ npm i noble

> [email protected] install /home/pi/spherov2.js_3/node_modules/usb
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.5.0/usb_bindings-v1.5.0-node-v64-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/spherov2.js_3/node_modules/usb/build'
  CC(target) Release/obj.target/libusb/libusb/libusb/core.o
  CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
  CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
  CC(target) Release/obj.target/libusb/libusb/libusb/io.o
  CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
  CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
  AR(target) Release/obj.target/usb.a
  COPY Release/usb.a
  CXX(target) Release/obj.target/usb_bindings/src/node_usb.o
../src/node_usb.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE SetDebugLevel(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/node_usb.cc:99:73: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2477): Use maybe version [-Wdeprecated-declarations]
  if (info.Length() != 1 || !info[0]->IsUint32() || info[0]->Uint32Value() > 4) {
                                                                         ^
../src/node_usb.cc:103:53: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2477): Use maybe version [-Wdeprecated-declarations]
  libusb_set_debug(usb_context, info[0]->Uint32Value());
                                                     ^
../src/node_usb.cc: In function ‘void handleHotplug(std::pair<libusb_device*, libusb_hotplug_event>)’:
../src/node_usb.cc:151:58: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:1001) [-Wdeprecated-declarations]
  Nan::MakeCallback(Nan::New(hotplugThis), "emit", 2, argv);
                                                          ^
../src/node_usb.cc: In function ‘v8::Local<v8::Value> libusbException(int)’:
../src/node_usb.cc:301:14: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:10046): Use maybe version [-Wdeprecated-declarations]
  e->ToObject()->Set(Nan::New<String>("errno").ToLocalChecked(), Nan::New<Integer>(errorno));
              ^
  CXX(target) Release/obj.target/usb_bindings/src/device.o
../src/device.cc: In static member function ‘static void Req::default_after(uv_work_t*)’:
../src/device.cc:237:64: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
    Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv);
                                                                ^
  CXX(target) Release/obj.target/usb_bindings/src/transfer.o
../src/transfer.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Transfer_Submit(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/transfer.cc:58:47: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:10046): Use maybe version [-Wdeprecated-declarations]
  Local<Object> buffer_obj = info[0]->ToObject();
                                               ^
../src/transfer.cc: In function ‘void handleCompletion(Transfer*)’:
../src/transfer.cc:126:72: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
   Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv);
                                                                        ^
  SOLINK_MODULE(target) Release/obj.target/usb_bindings.node
  COPY Release/usb_bindings.node
  COPY /home/pi/spherov2.js_3/node_modules/usb/src/binding/usb_bindings.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/spherov2.js_3/node_modules/usb/build'

> [email protected] install /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket
> node-gyp rebuild

make: Entering directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
  CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’:
../src/BluetoothHciSocket.cpp:251:95: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
     Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                               ^
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’:
../src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [1])’
   Local<Value> error = errorConstructor->NewInstance(1, constructorArgs);
                                                                        ^
../src/BluetoothHciSocket.cpp:275:72: note: candidates are:
In file included from /home/pi/.node-gyp/10.15.3/include/node/node.h:63:0,
                 from /home/pi/.node-gyp/10.15.3/include/node/node_buffer.h:25,
                 from ../src/BluetoothHciSocket.cpp:7:
/home/pi/.node-gyp/10.15.3/include/node/v8.h:3993:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/pi/.node-gyp/10.15.3/include/node/v8.h:3993:44: note:   candidate expects 3 arguments, 2 provided
/home/pi/.node-gyp/10.15.3/include/node/v8.h:3996:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/pi/.node-gyp/10.15.3/include/node/v8.h:3996:44: note:   candidate expects 1 argument, 2 provided
../src/BluetoothHciSocket.cpp:282:93: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
   Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                             ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:395:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:417:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
binding.target.mk:99: recipe for target 'Release/obj.target/binding/src/BluetoothHciSocket.o' failed
make: *** [Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
make: Leaving directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm WARN spherov2.js_3 No description
npm WARN spherov2.js_3 No repository field.
npm WARN spherov2.js_3 No README data
npm WARN spherov2.js_3 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/xpc-connection):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/bluetooth-hci-socket):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 4 packages from 4 contributors and audited 107 packages in 53.147s
found 3 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details


So, further down the comments this solution is suggested which does work given you have a clean directory. Installing noble thereafter.

Console log

pi@Marengo:~/spherov2.js_3 $ nodejs -v
v10.15.3

pi@Marengo:~/spherov2.js_3 $ npm install "https://github.com/jrobeson/node-bluetooth-hci-socket/#fix-builds-for-node-10" # worked
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.

> [email protected] preinstall /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket
> npm install node-pre-gyp

npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 114 packages from 78 contributors and audited 268 packages in 10.469s
found 8 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

> [email protected] install /home/pi/spherov2.js_3/node_modules/usb
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.5.0/usb_bindings-v1.5.0-node-v64-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/spherov2.js_3/node_modules/usb/build'
  CC(target) Release/obj.target/libusb/libusb/libusb/core.o
  CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
  CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
  CC(target) Release/obj.target/libusb/libusb/libusb/io.o
  CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
  CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
  AR(target) Release/obj.target/usb.a
  COPY Release/usb.a
  CXX(target) Release/obj.target/usb_bindings/src/node_usb.o
../src/node_usb.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE SetDebugLevel(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/node_usb.cc:99:73: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2477): Use maybe version [-Wdeprecated-declarations]
  if (info.Length() != 1 || !info[0]->IsUint32() || info[0]->Uint32Value() > 4) {
                                                                         ^
../src/node_usb.cc:103:53: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2477): Use maybe version [-Wdeprecated-declarations]
  libusb_set_debug(usb_context, info[0]->Uint32Value());
                                                     ^
../src/node_usb.cc: In function ‘void handleHotplug(std::pair<libusb_device*, libusb_hotplug_event>)’:
../src/node_usb.cc:151:58: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:1001) [-Wdeprecated-declarations]
  Nan::MakeCallback(Nan::New(hotplugThis), "emit", 2, argv);
                                                          ^
../src/node_usb.cc: In function ‘v8::Local<v8::Value> libusbException(int)’:
../src/node_usb.cc:301:14: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:10046): Use maybe version [-Wdeprecated-declarations]
  e->ToObject()->Set(Nan::New<String>("errno").ToLocalChecked(), Nan::New<Integer>(errorno));
              ^
  CXX(target) Release/obj.target/usb_bindings/src/device.o
../src/device.cc: In static member function ‘static void Req::default_after(uv_work_t*)’:
../src/device.cc:237:64: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
    Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv);
                                                                ^
  CXX(target) Release/obj.target/usb_bindings/src/transfer.o
../src/transfer.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Transfer_Submit(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/transfer.cc:58:47: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:10046): Use maybe version [-Wdeprecated-declarations]
  Local<Object> buffer_obj = info[0]->ToObject();
                                               ^
../src/transfer.cc: In function ‘void handleCompletion(Transfer*)’:
../src/transfer.cc:126:72: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
   Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv);
                                                                        ^
  SOLINK_MODULE(target) Release/obj.target/usb_bindings.node
  COPY Release/usb_bindings.node
  COPY /home/pi/spherov2.js_3/node_modules/usb/src/binding/usb_bindings.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/spherov2.js_3/node_modules/usb/build'

> [email protected] install /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/sandeepmistry/node-bluetooth-hci-socket/releases/download/0.5.2/binding-0.5.2-node-v64-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://github.com/sandeepmistry/node-bluetooth-hci-socket/releases/download/0.5.2/binding-0.5.2-node-v64-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
  CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
make: Entering directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
  CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’:
../src/BluetoothHciSocket.cpp:252:95: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
     Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                               ^
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’:
../src/BluetoothHciSocket.cpp:283:93: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
   Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                             ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:396:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:418:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’:
../src/BluetoothHciSocket.cpp:252:95: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
     Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                               ^
../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’:
../src/BluetoothHciSocket.cpp:283:93: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:980) [-Wdeprecated-declarations]
   Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
                                                                                             ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:396:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:418:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated (declared at /home/pi/.node-gyp/10.15.3/include/node/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
       devId = arg0->IntegerValue();
                                  ^
  SOLINK_MODULE(target) Release/obj.target/binding.node
  SOLINK_MODULE(target) Release/obj.target/binding.node
  COPY Release/binding.node
  COPY /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/lib/binding/binding.node
  COPY Release/binding.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
  COPY /home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/lib/binding/binding.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/spherov2.js_3/node_modules/bluetooth-hci-socket/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm WARN spherov2.js_3 No description
npm WARN spherov2.js_3 No repository field.
npm WARN spherov2.js_3 No README data
npm WARN spherov2.js_3 No license field.

+ [email protected]
added 130 packages from 91 contributors and audited 369 packages in 76.389s
found 8 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

pi@Marengo:~/spherov2.js_3 $ npm i noble
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/spherov2.js_3/package.json'
npm WARN spherov2.js_3 No description
npm WARN spherov2.js_3 No repository field.
npm WARN spherov2.js_3 No README data
npm WARN spherov2.js_3 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/xpc-connection):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

+ [email protected]
added 4 packages from 4 contributors and removed 114 packages in 9.413s


However, now running nodejs v10 the results are nothing but the same. Still stuck at starting... and no sign of life from the bolt.

pi@Marengo:~/spherov2.js_3 $ nodejs -v
v10.15.3

pi@Marengo:~/spherov2.js_3 $ sudo node ./src/spherov2.js
Scanning devices...
name: Sphero Bolt, uuid: fe5dc988ee1b, mac-address: fe:5d:c9:88:ee:1b
Done scanning devices.
Starting...

@igbopie
Copy link
Owner

igbopie commented Mar 13, 2019

I have been able to repro the issue. I will let you know.

@igbopie
Copy link
Owner

igbopie commented Mar 13, 2019

Hey, looks like it works for a sphero mini but it does not for sphero bolt. it works in a mac computer, but not in the raspberry, maybe something I am missing. I will investigate more.

@h0uter
Copy link

h0uter commented Mar 14, 2019

Hello all,

First of great that you are working on this! We will be doing a university project with Sphero Bolts. Our options for how to connect to the Bolt from outside the Sphero Edu app were looking rather bleak until we found your work :) (We will have to interface them with Python later on, that's why we need to bypass the app).

Now as for this issue, I am using very similar test code.

const { Scanner, Utils, SpheroBolt } = require('spherov2.js');

async function run() {
	var bolt = await Scanner.find(SpheroBolt.advertisement, "SB-FDDB");
        bolt.setMainLedColor(0, 0, 250)
	bolt.roll(50, 0);
}

run();

I'm on Windows and I can see the Sphero but unfortunately I am also not getting it to move.

I did the following:

  1. Follow the instructions on Noble for how to get my bluetooth adapter working
    [https://github.com/noble/node-bluetooth-hci-socket#windows]
    1. install winUSB driver on my adapter with Zadig
    2. Manually change my adapter with the matching id
$Env:BLUETOOTH_HCI_SOCKET_USB_VID=0x8087
$Env:BLUETOOTH_HCI_SOCKET_USB_PID=0x0a2b
  1. Install spherov2.js
npm install spherov2.js
npm install

Now when I run my test file (connect.js) I get the same result as Wiggyboy

PS D:\SPHERO\BEP-SLAM> node connect.js
Scanning devices...
name: Sphero Bolt, uuid: e1b1a7e4fddb, mac-address: e1:b1:a7:e4:fd:db
Done scanning devices.
Starting...

stuck at "starting..." and no sign of life from the bolt.

If we can help you in any way with solving this please let us know.
Thanks again!

@h0uter
Copy link

h0uter commented Mar 24, 2019

I tried it again with a supported external USB Bluetooth adapter on the same windows laptop and I get the same results.
Stuck at "starting..." and no sign of life from the bolt.

@igbopie when you said:

Hey, looks like it works for a sphero mini but it does not for sphero bolt. it works in a mac computer, but not in the raspberry, maybe something I am missing. I will investigate more.

Did you mean you can connect to and control a Sphero BOLT from your mac computer?

@igbopie
Copy link
Owner

igbopie commented Mar 24, 2019

Yes, that is correct.

There is something going on when noble uses its own hci implementation.

On mac, because it is using noblemac and it uses native documented mac apis it works.

I have been trying to use different things to see what is going on but no luck.

My last go would be using chrome web bluetooth. There are some changes I have to do order to make it work.

@igbopie
Copy link
Owner

igbopie commented Mar 26, 2019

Yes!! Using chrome webbluetooth on ubuntu works!! Tomorrow I will try with the rasp!

@igbopie
Copy link
Owner

igbopie commented Apr 7, 2019

So I just published a new release with Bolt support and Raspberry :)

@igbopie igbopie closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants