diff --git a/hardware/neopixel/neopixel.html b/hardware/neopixel/neopixel.html index 0c0ba107..5fe65f31 100644 --- a/hardware/neopixel/neopixel.html +++ b/hardware/neopixel/neopixel.html @@ -4,8 +4,17 @@ in the string Pin Number - + + + + + + diff --git a/hardware/neopixel/neopixel.js b/hardware/neopixel/neopixel.js index fc5c6c51..6095cbbf 100644 --- a/hardware/neopixel/neopixel.js +++ b/hardware/neopixel/neopixel.js @@ -1,7 +1,9 @@ module.exports = function(RED) { "use strict"; - var spawn = require('child_process').spawn; + // RED.log.warn("rpi-neopixels : This node is for MCU Edition. Do not run."); + /** + var spawn = require('child_process').spawn; var execSync = require('child_process').execSync; var fs = require('fs'); var colors = require('./colours.js'); @@ -30,7 +32,7 @@ module.exports = function(RED) { // the magic to make python print stuff immediately process.env.PYTHONUNBUFFERED = 1; - +**/ function PiNeopixelNode(n) { RED.nodes.createNode(this,n); this.pixels = n.pixels || 1; @@ -117,7 +119,8 @@ module.exports = function(RED) { } if (allOK === true) { - node.child = spawn(piCommand, [node.pixels, node.wipe, node.mode, node.brightness, node.gamma, node.channel, node.gpio]); +/** + node.child = spawn(piCommand, [node.pixels, node.wipe, node.mode, node.brightness, node.gamma, node.channel, node.gpio]); node.status({fill:"green",shape:"dot",text:"ok"}); node.on("input", inputlistener); @@ -169,10 +172,11 @@ module.exports = function(RED) { node.fgnd = colors.getRGB(node.fgnd,node.rgb); } } - } +**/ + } else { node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"}); } } RED.nodes.registerType("rpi-neopixels",PiNeopixelNode); -} +} \ No newline at end of file diff --git a/hardware/neopixel/package.json b/hardware/neopixel/package.json index 6e2e7700..da806b5b 100644 --- a/hardware/neopixel/package.json +++ b/hardware/neopixel/package.json @@ -1,12 +1,10 @@ { - "name" : "node-red-node-pi-neopixel", - "version" : "2.0.1", - "description" : "A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Raspberry Pi.", - "dependencies" : { - }, - "repository" : { - "type":"git", - "url":"https://github.com/node-red/node-red-nodes.git", + "name": "node-red-contrib-node-pi-neopixel", + "version": "2.0.1", + "description": "A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Node-RED MCU Edition.", + "repository": { + "type": "git", + "url": "https://github.com/NextWorldLab/node-red-nodes", "directory": "tree/master/hardware/neopixel" }, "license": "Apache-2.0", @@ -21,13 +19,7 @@ "rpi-neopixels": "neopixel.js" } }, - "scripts": { - "postinstall": "scripts/checklib.js" - }, - "author": { - "name": "Dave Conway-Jones", - "email": "ceejay@vnet.ibm.com", - "url": "http://nodered.org" - }, - "engines" : { "node" : ">=12.0.0" } + "engines": { + "node": ">=12.0.0" + } } diff --git a/hardware/neopixel/scripts/checklib.js b/hardware/neopixel/scripts/checklib.js deleted file mode 100755 index c844ebcf..00000000 --- a/hardware/neopixel/scripts/checklib.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -var fs = require('fs'); - -if (!fs.existsSync('/usr/local/lib/python2.7/dist-packages/unicornhat.py') && !fs.existsSync('/usr/local/lib/python3.9/dist-packages/unicornhat.py')) { - console.warn("WARNING : Can't find required python library"); - console.warn("WARNING : Please install using the following command"); - console.warn("WARNING : Note: this uses root..."); - console.warn("WARNING : curl -sS get.pimoroni.com/unicornhat | bash\n"); - //process.exit(1); -} -else { - console.log("Python library found OK.\n") -}