Skip to content

Instantly share code, notes, and snippets.

View aqmattil's full-sized avatar

Aleksi Mattila aqmattil

View GitHub Profile
@aqmattil
aqmattil / ws281 and rpio test
Created May 14, 2020 12:47
Simple example to show how rpio.poll freezes on Balena
const rpio = require('rpio');
const ws281x = require ('rpi-ws281x-native');
var rpi_options = {
gpiomem: false, // /dev/gpiomem for non-root but only GPIO access ( /dev/mem provides full access but requires root)
mapping: 'physical' // use physical pins (stay the same on all boards)
}
var active = false
var timeLastPressedStopButton = Date.now();
const STOP_BUTTON_PIN = 18 // input (physical pin 18 = bcm (gpio) 24)
@aqmattil
aqmattil / dockerfile
Created May 14, 2020 12:46
node-rpio test dockerfile
FROM balenalib/raspberrypi3-debian-node:10.20.0-buster-build
# Install other apt deps
RUN apt-get update && apt-get install -y --no-install-recommends
# Move to app dir
WORKDIR /usr/src/app
# Move package.json to filesystem
COPY ./package.json ./
@aqmattil
aqmattil / snippet.js
Last active June 22, 2018 07:54
graphql-subscriptions problem with withFilter return values
/*
"dependencies": {
"apollo-server-express": "^1.3.6",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"body-parser": "^1.18.3",
"cors": "^2.8.4",
"express": "^4.16.3",