Skip to content

Problem trying to make it work. #4

@danielfilho

Description

@danielfilho

I've been struggling for a couple hours trying to find out what could be this error, but I just can't.

I've uploaded the firmata from Jacob Rosenthal, uploaded (it gave me an error, but on LightBlue Bean some ppl say it's ok). It appears linked on my Loader (see Sketch:firmata):

screen shot 2014-12-23 at 18 12 22

Then, I'm trying to run the "hello world" with the following code:

var beanio = require("bean-io");
var board = new beanio.Board({
  timeout: 30000 //optional - defaults to 30 seconds
  // uuid: 'myUuid' //optional - will use first bean found
});

board.on("ready", function() {
  console.log("CONNECTED");
  this.pinMode(13, this.MODES.OUTPUT);

  var byte = 0;

  // This will "blink" the on board led
  setInterval(function() {
    this.digitalWrite(13, (byte ^= 1));
  }.bind(this), 500);
});

but it gives me the following:

Scanning for BLE devices...
(scan)found:Bean 2 9ac2b27b3cdf4423a0b8638e97ceba2f
Stop Scanning for BLE devices...
connect bean 9ac2b27b3cdf4423a0b8638e97ceba2f
TypeError: Cannot call method 'discoverCharacteristics' of undefined
    at new Bean (/Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/node_modules/ble-bean/lib/bean.js:27:11)
    at /Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/lib/bean.js:31:30
    at Peripheral.<anonymous> (/Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/node_modules/noble/lib/peripheral.js:66:7)
    at Peripheral.g (events.js:180:16)
    at Peripheral.emit (events.js:95:17)
    at Noble.onServicesDiscover (/Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/node_modules/noble/lib/noble.js:198:16)
    at emit (events.js:98:17)
    at nobleBindings.discoverIncludedServices.args.kCBMsgArgDeviceUUID (/Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/node_modules/noble/lib/mac/mavericks.js:234:8)
    at emit (events.js:95:17)
    at nobleBindings.sendCBMsg.sendXpcMessage.kCBMsgId (/Users/danielfilho/dev/github/danielfilho/bean-io/node_modules/bean-io/node_modules/noble/lib/mac/mavericks.js:41:8)

I've npm install --save-dev johnny-five bean-io it. any idea?

ps: I've installed johnny-five, although I'm not using it yet. I want to run the basic to go through it later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions