Saturday 3 June 2017

Meteor 1.5, johnny-five, serialport connect wrongly

I need help with Meteor 1.5, johnny-five, serialport.

I'm on MacOS. I'm following this guide https://github.com/studiorabota/meteor-johnny-five-tutorial

I made a few changes to the code due to new Meteor version and support NPM.

My NodeJs version v4.6.2

The problem is Meteor connect to the wrong serial port. The following is the error message when I run "meteor":

Available /dev/cu.usbmodem1,/dev/cu.usbserial-A5029U59

Connected /dev/cu.usbmodem1

I need to know how to make Meteor to select the correct port. Please help, thanks in advance.

My Meteor package.json

{
  "name": "j5",
  "private": true,
  "scripts": {
    "start": "meteor run"
  },
  "dependencies": {
    "babel-runtime": "^6.20.0",
    "johnny-five": "^0.11.1",
    "meteor-node-stubs": "~0.2.4",
    "serialport": "^4.0.7"
  }
}

My server/blink.js

// import johnny-five from 'johnny-five';

var JohnnyFive = require("johnny-five");

Meteor.startup(function(){
    board = new JohnnyFive.Board();

    board.on('error', function (error) {
        console.error('Johnny Five Error', error);
    });

    board.on("ready", Meteor.bindEnvironment(function() {

        var led = new JohnnyFive.Led(13);

        led.blink(500);

    }, "ready"));
});


via MarkZ

No comments:

Post a Comment