pbertie / inkyphat-node Goto Github PK
View Code? Open in Web Editor NEWNodeJS Module to control Inky pHAT on Raspberry Pi (e-Paper Screen).
Home Page: https://www.npmjs.com/package/inkyphat
License: MIT License
NodeJS Module to control Inky pHAT on Raspberry Pi (e-Paper Screen).
Home Page: https://www.npmjs.com/package/inkyphat
License: MIT License
I've been trying to get this to work on my inkypHAT black/White and all the examples just draw a solid rectangle about 80% of the screen and nothing more or less. What could I be doing wrong? code below
const inkyphat = require('inkyphat')();
async function main() {
await inkyphat.init();
// inkyphat.setPixel(1, 5, inkyphat.RED);
inkyphat.drawRect(50, 100, inkyphat.BLACK);
// inkyphat.drawRect(150, 20, 210, 60, inkyphat.BLACK);
await inkyphat.redraw();
await inkyphat.destroy();
}
main();
Also is there any movement on making text work with this?
Does this library also support the InkyWHAT?
[email protected] install /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/pi-spi
> node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.14.34+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/pi-spi
gyp ERR! node -v v4.8.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
> [email protected] install /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/onoff/node_modules/epoll
> node-gyp rebuild
Traceback (most recent call last):
File "/usr/share/node-gyp/gyp/gyp_main.py", line 9, in <module>
load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 545, in script_main
return main(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 538, in main
return gyp_main(args)
File "/usr/lib/python2.7/dist-packages/gyp/__init__.py", line 502, in gyp_main
'cwd': os.getcwd(),
OSError: [Errno 2] No such file or directory
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.14.34+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/Tools/instrument.local/node_modules/inkyphat/node_modules/onoff/node_modules/epoll
gyp ERR! node -v v4.8.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pi-spi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pi-spi
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.34+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "inkyphat"
npm ERR! cwd /home/pi/Tools/instrument.local
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Tools/instrument.local/npm-debug.log
npm ERR! not ok code 0
Hi! I find this application very interesting and I need your help to enananche it!
When I run the following example code I get the below error:
I have no idea what is causing this can you possible help?
Code:
const inkyphat = require('inkyphat')();
async function main() {
await inkyphat.init();
inkyphat.setPixel(1, 5, inkyphat.RED);
inkyphat.drawRect(50, 100, inkyphat.BLACK);
await inkyphat.redraw();
await inkyphat.destroy();
}
main();
Output:
Error: Timeout
at Timeout._onTimeout (/home/pi/mqtt/node_modules/inkyphat/lib/inkyphat-utils.js:14:12)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)
(node:2400) UnhandledPromiseRejectionWarning: Error: Timeout
at Timeout._onTimeout (/home/pi/mqtt/node_modules/inkyphat/lib/inkyphat-utils.js:14:12)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)
(Use node --trace-warnings ...
to show where the warning was created)
(node:2400) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2400) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
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.