Giter Site home page Giter Site logo

balena-rpi-nodejs-basic-gpio's Introduction

Basic GPIO with node.js

This is a basic example of GPIO control on the rasperry pi using the pi-pins module from npm

In this example we have a LED on pin 22 which will light up when the button is pressed on pin 17 and switch off when pressed again.

All you need to do is :

  • clone this repo locally and cd into the folder.
  • connect up the pi as shown in the diagram
  • using balena cli, run 'balena push ' wait a minute or so for the code to upload and start.
  • enjoy the all the LED goodness...

Circuit diagram

If you have any questions, please contact us on https://forums.balena.io/.

balena-rpi-nodejs-basic-gpio's People

Contributors

dansku avatar mgalgs avatar michaek avatar page- avatar shaunmulligan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

balena-rpi-nodejs-basic-gpio's Issues

Deployment fails

Hi guys,

I'm using this based on the instructions in the Resin.io getting started guide.

The failure is due to a missing Python executable.

Moving from node-slim to node as the base image fixes it for me

Cheers.

Error while building this project

I had the following error while building this project.

I simply cloned it, added my resin git repo and pushed.

[main]  npm
[main]
[main]  WARN
[main]  package.json [email protected] No repository field.
[main]
[main]  > [email protected] preinstall /usr/src/app
[main]  > bash deps.sh
[main]  npm http
[main]  GET https://registry.npmjs.org/pi-pins
[main]
[main]  npm
[main]
[main]  http
[main]
[main]  GET https://registry.npmjs.org/pi-pins
[main]
[Info]  Still working...
[main]  npm http GET https://registry.npmjs.org/pi-pins
[main]
[main]  npm ERR!
[main]   Error: CERT_UNTRUSTED
[main]
[main]  npm ERR!     at SecurePair.<anonymous> (tls.js:1362:32)
[main]  npm
[main]  ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
[main]
[main]  npm ERR!     at SecurePair.maybeInitFinished (tls.js:974:10)
[main]
[main]  npm ERR!     at CleartextStream.read [as _read] (tls.js:462:15)
[main]
[main]  npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
[main]  npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
[main]  npm ERR!     at doWrite (_stream_writable.js:221:10)
[main]  npm ERR!     at writeOrBuffer (_stream_writable.js:211:5)
[main]
[main]  npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
[main]
[main]  npm
[main]
[main]  ERR!
[main]       at write (_stream_readable.js:583:24)
[main]  npm
[main]   ERR!
[main]   If you need help, you may report this log at:
[main]  npm ERR!
[main]       <http://github.com/isaacs/npm/issues>
[main]  npm ERR!
[main]   or email it to:
[main]
[main]  npm ERR!     <[email protected]>
[main]
[main]
[main]  npm
[main]  ERR!
[main]  System Linux 4.12.13
[main]
[main]  npm ERR! command
[main]   "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--unsafe-perm"
[main]
[main]  npm
[main]   ERR!
[main]
[main]  cwd /usr/src/app
[main]  npm
[main]
[main]  ERR!
[main]   node -v v0.10.22
[main]
[main]  npm
[main]  ERR! npm -v 1.3.14
[main]
[main]  npm
[main]  ERR!
[main]
[main]  npm ERR!
[main]   Additional logging details can be found in:
[main]
[main]  npm ERR!
[main]       /usr/src/app/npm-debug.log
[main]
[main]  npm ERR! not ok code 0
[main]
[main]  Removing intermediate container 3b80f9710032
[main]  The command '/bin/sh -c DEBIAN_FRONTEND=noninteractive JOBS=MAX npm install --unsafe-perm' returned a non-zero code: 1
[Info]  Uploading images
[Success]  Successfully uploaded images
[Error]  Some services failed to build:
[Error]    Service: main
[Error]      Error: The command '/bin/sh -c DEBIAN_FRONTEND=noninteractive JOBS=MAX npm install --unsafe-perm' returned a non-zero code: 1
[Error]  Not deploying release.

Add Dockerfile

Please add a docker file at this project and transform it to the format of your repo simple-server-node. Also, you could add a more detailed readme about each file and its purpose like in the basic tutorial.

It would be really helpful if you could transform all of your tutorials to one "format", so that everyone can integrate them to one bigger project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.