sofroniewn / electron-johnny-five-examples Goto Github PK
View Code? Open in Web Editor NEWExample electron apps using johnny-five to control hardware
License: MIT License
Example electron apps using johnny-five to control hardware
License: MIT License
You could change the last line in readme.md in tut no. 9 to the readme.md at tutorial 10. The one that reads
"Congrats! You've gone through all the examples - go and build something amazing!"
you might want to replace it by a link to tutorial 10, as you've done in every other tutorial and move that line to tutorial 10.
Any way is just a small detail.
Hi,
I try to follow the installation and when running electron rebuild it said:
An unhandled error occurred inside electron-rebuild
Unable to find parent node_modules directory, specify it via --module-dir, E.g. "--module-dir ." for the current directory
Error: Unable to find parent node_modules directory, specify it via --module-dir, E.g. "--module-dir ." for the current directory
at Object. (E:\arduino\electron-johnny-five-examples\1-led\node_modules\electron-rebuild\lib\src\cli.js:79:23)
at next (native)
at fulfilled (E:\arduino\electron-johnny-five-examples\1-led\node_modules\electron-rebuild\lib\src\cli.js:5:58)
I am on win 10 x64.
Thank you.
I'm stuck on an error in the Electron Console that's preventing the 1-led script from reaching the point of communicating with my Arduino board (a Mega 2560).
I'm running:
These are the steps I've followed:
Board
is Arduino/Genuino Mega or Mega 2560
Processor
is ATmega2560 (Mega 2560)
Port
is /dev/cu.usbmodem1421 (Arduino/Genuino Mega or Mega 2560)
Programmer
is AVRISP mkII
File > Examples > Firmata > StandardFirmata
git clone [email protected]:sofroniewn/electron-johnny-five-examples.git
electron-johnny-five-examples/1-led/
npm install
./node_modules/.bin/electron-rebuild
npm start
At this point, the Electron app starts and opens a new window. The "Click me!" button is initially disabled, but it never becomes enabled. If I open Developer Tools, I see this error in the Console:
/Users/twarr/electron-johnny-five-examples/1-led/node_modules/bindings/bindings.js:83 Uncaught Error: Module version mismatch. Expected 47, got 48.
I did some Googling and it appears that this can happen if a package is installed with one version of Node, then another version is later installed:
http://stackoverflow.com/questions/15584529/module-version-mismatch-expected-11-got-1
That didn't happen in my case, but I tried the recommended solution anyways:
rm -rf node_modules; npm update
That results in:
npm WARN prefer global [email protected] should be installed with -g
> [email protected] install /Users/twarr/electron-johnny-five-examples/1-led/node_modules/nslog
> node-gyp rebuild
CXX(target) Release/obj.target/nslog/src/main.o
CXX(target) Release/obj.target/nslog/src/nslog_mac.o
SOLINK_MODULE(target) Release/nslog.node
> [email protected] install /Users/twarr/electron-johnny-five-examples/1-led/node_modules/serialport
> node-pre-gyp install --fallback-to-build
[serialport] Success: "/Users/twarr/electron-johnny-five-examples/1-led/node_modules/serialport/build/Release/serialport.node" is installed via remote
> [email protected] postinstall /Users/twarr/electron-johnny-five-examples/1-led/node_modules/electron-prebuilt
> node install.js
[email protected] /Users/twarr/electron-johnny-five-examples/1-led
├── [email protected]
├── [email protected]
└── [email protected]
However, that doesn't appear to have any effect; running npm start
again, I still see the same error in the Electron Console.
While this issue doesn't appear to be unique to this repo (it seems to be a general Node issue that can occur under a variety of circumstances), it does happen (at least for me) after following all instructions in the 1-led example exactly, so I'm hoping it's something you've encountered or are familiar with.
Please let me know if you have any troubleshooting ideas, or if you need me to provide any more details. I'm not sure how to proceed. Thanks!
i'm trying to work with arduino uno on the first project ( led ) , but the status is never changed ! , the button is still disabled and i don't know what to do to make it enabled ! , the board is connected and i can access it through the arduino IDE , but nit through this repo !!
May I ask what does this part of code do:
https://github.com/sofroniewn/electron-johnny-five-examples/blob/master/2-switch/app/index.js#L5-L15
var Readable = require('stream').Readable
var util = require('util')
util.inherits(MyStream, Readable)
function MyStream(opt) {
Readable.call(this, opt)
}
MyStream.prototype._read = function() {};
// hook in our stream
process.__defineGetter__('stdin', function() {
if (process.__stdin) return process.__stdin
process.__stdin = new MyStream()
return process.__stdin
})
Awesome job @sofroniewn!
aside from the serialport trouble, I had to upload the firmata standard firmware to my arduino to make it work. I had some goofy custom code on there before. It might be worth mentioning that in the readme.
This is from the johnny-five docs:
If the above didn't work as expected, make sure that StandardFirmata is installed on the board:
Download Arduino IDE
Plug in your Arduino or Arduino compatible microcontroller via USB
Open the Arduino IDE, select: File > Examples > Firmata > StandardFirmata
Click the "Upload" button.
If the upload was successful, the board is now prepared and you can close the Arduino IDE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.