Giter Site home page Giter Site logo

Comments (4)

deadprogram avatar deadprogram commented on June 2, 2024

Hi @brianfeister you are on OSX from the looks of it. What version are you running? Also, what node version?

from sphero.js.

brianfeister avatar brianfeister commented on June 2, 2024

WOW! Thanks for the quick reply @deadprogram. I guess it could be noted in the docs that if you clone this repo, sphereo will fail to install when running npm install sphero noble because it would be a circular dependency. So, cloning this repo and using it as a sandbox becomes a bit confusing. I created an empty sandbox directory and was able to get running right away with just npm install sphero noble.

Sorry for the side question, but it seems unusual to me that I was only able to connect via the uuid that I got back from the node ./node_modules/noble/examples/advertisement-discovery.js command in the docs, but not the MAC address that I got from the details inside the iPhone app... but this one is probably just my own error / misunderstanding.

from sphero.js.

deadprogram avatar deadprogram commented on June 2, 2024

Hi @brianfeister when connecting on OSX, Noble requires that you use the "uuid' instead of the Bluetooth address. I'm not sure why that is the case within the OSX APIs, I suppose due to the "iBeacon" set of wrappers. In any case, we should probably add some separate script to the module, to make it easier to figure out the correct address.

from sphero.js.

ShahNewazKhan avatar ShahNewazKhan commented on June 2, 2024

hi @deadprogram I was having this same issue, I created an Electron app and added the sphero npm module.

Here is my envoriment on OSX 10.11:

$ node -v
v7.2.0

$ electron -v
v1.4.10

I was getting this error thrown from the initBle function:

function initBLE() {
  var isChrome = typeof chrome !== "undefined";

  // thanks to https://github.com/jgautier/firmata/blob/master/lib/firmata.js
  try {
    if (isChrome) {
      // browser BLE interface here...
      console.error("Browser-based BLE interface is not yet supported.");
    } else {
      ble = require("noble");
    }
  } catch (error) {
    ble = null;
  }

  if (ble == null) {
    var err = [
      "It looks like you want to connect to a Sphero BB-8 or Sphero Ollie,",
      "but did not install the 'noble' module.", "",
      "To install it run this command:",
      "npm install noble", "",
      "For more information go to https://github.com/sandeepmistry/noble"
    ].join("\n");

    console.error(err);
    throw new Error("Missing noble dependency");
  }
}

This meant that the else clause ble = require("noble") was throwing an error, when I caught this error in console, it was throwing:

Module version mismatch. Expected 50, got 51.

I was able to resolve it by running the following from the Electron documentation

npm install --save-dev electron-rebuild

# Every time you run "npm install", run this:
./node_modules/.bin/electron-rebuild

# On Windows if you have trouble, try:
.\node_modules\.bin\electron-rebuild.cmd

from sphero.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.