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

johnny-five not working #1807

Open
Sarthak-Arya opened this issue Dec 29, 2022 · 9 comments
Open

johnny-five not working #1807

Sarthak-Arya opened this issue Dec 29, 2022 · 9 comments

Comments

@Sarthak-Arya
Copy link

const { Board, Led } = require("johnny-five");
const board = new Board({port:"COM3"});

board.on("ready", () => {

  // Create a standard `led` component instance
  const led = new Led(13);
  this.repl.inject({
    led: led
  });
  // "blink" the led in 500ms
  // on-off phase periods
  led.blink(1000);
});

Above is my code

Screenshot 2022-12-29 235929

Here is the output is not showing anything
I am using Windows 11 x64 bit system

@Jahson17
Copy link

Is it throwing an error like "cannot find module 'firmata' " ???

Or what's the result actually..

@abdooo9
Copy link

abdooo9 commented Jan 12, 2023

Is it throwing an error like "cannot find module 'firmata' " ???

I don't think so, but I'm facing this error, is there a solution?, I tried install firmata package but always fails: npm ERR

@princeborn1999
Copy link

I'm facing same problem.

@WyattSanders
Copy link

Is it throwing an error like "cannot find module 'firmata' " ???

Or what's the result actually..

Error: Cannot find module 'firmata'

It's almost a year later and I'm having the same issue with no ability to find a solution.

@tbaltrushaitis
Copy link

npm i firmata

@tbaltrushaitis
Copy link

const { Board, Led } = require("johnny-five");
const board = new Board({port:"COM3"});

board.on("ready", () => {

  // Create a standard `led` component instance
  const led = new Led(13);
  this.repl.inject({
    led: led
  });
  // "blink" the led in 500ms
  // on-off phase periods
  led.blink(1000);
});

Above is my code

Screenshot 2022-12-29 235929

Here is the output is not showing anything I am using Windows 11 x64 bit system

Your code shouldn't output anything. It should blink the default led on your board (of course if it is really on port 'COM3')

@tbaltrushaitis
Copy link

Also I'm not sure if this would represent your board because of () => {}

@WyattSanders
Copy link

WyattSanders commented Nov 14, 2023

npm i firmata

This wouldn't fix it, and there would be a laundry list of problems that would follow.
I have however figured out the root cause for this issue and others
People trying to run Johnny-five with a fresh install of Windows 10 or 11 and windows build tools 2022 CANNOT install johnny-five with "npm install" I have found that you need node version 13.14.0 or 14.17.0 (if you tried installing johnny-five with a newer version you need to delete your node_modules folder then change versions of node with nvm-windows) then install VS Build Tools 2019 (VS Build Tools 2022 will not work!) with C++ development.

After this johnny-five can install successfully with npm install. (Antivirus may also need turned off, run from powershell with administrator privileges too)

VS Build Tools 2019 Download: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16&src=myvs&utm_medium=microsoft&utm_source=my.visualstudio.com&utm_campaign=download&utm_content=vs+buildtools+2019

image

@reymesson1
Copy link

Remember also to turn off any Bluetooth connection, make sure that the package.json has into script: "firmata": "firmata-party uno --debug" and npm run firmata. And then node index.js

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

7 participants