npm run dev
Will auto reload on changes. Ligths will not work
npm run build && npm start
shh pi@raspberrypi
Need test SSL HTTPS on Raspi
const ws281x = require("@gbkwiatt/node-rpi-ws281x-native")
I turned off for mac dev Note: I have a custom version of ws281x on Raspi. Do not rebuild package on pi
For mac dev this dependency was removed from package under "dependencies"
"@gbkwiatt/node-rpi-ws281x-native": "^1.0.1",
App to control my AMI F 120 Jukebox stepper remotely through tablet or mobile device.
- Send pulses to stepper for selections
- Light show
- Cancel Action
- Turn on/off Machine
- Random Selection
- Stepper sequences
- Lights sequences
- GUI
python3 import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(32,GPIO.OUT) GPIO.output(32,GPIO.LOW) GPIO.output(32,GPIO.HIGH)
Disable Firewall:
systemctl stop firewalld
sudo netstat -tlnp
df -h
sudo apt-get autoremove sudo apt-get clean
https://github.com/billw2/rpi-clone sudo rpi-clone sdb
Set correct permissions (ownership) so npm can access your (sub)directories with your normal user permissions:
sudo chown -R $USER Most likely: sudo chown -R pi /home/pi/
https://github.com/meg768/rpi-ws281x Only works with node 10.21.0 Only works on Raspberry Pi linux and will fail on MacOS Use NVM to change
Trying this one now:https://github.com/gbkwiatt/node-rpi-ws281x-native
Tutorial https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/
The leds do not light up as expected?
It is important to have common ground for LEDs and RPi. Assure, ground is same for all of them (Thanks to euchkatzl).
Assure to connect the LED strip in the right direction. Little arrows indicate that along the strip (Thanks to euchkatzl).
Assure correct functionality of leds:
cd ~/rpi_ws281x/python/examples vim strandtest.py # Set number of leds, pin, etc. sudo python strandtest.py
The leds should light up now…
Disable the RPis soundcard (since it might interfere with the PMW-channel, sending data to the LEDs. Thanks to ELViTO12 for reporting):
sudo sh -c "echo blacklist snd_bcm2835 >> /etc/modprobe.d/alsa-blacklist.conf"; sudo reboot;
In case the LEDs are flickering as shown in this video https://www.youtube.com/watch?v=UHxVS8SkXOU (Thanks to oxivanisher), consider the usage of a level-shifter to connect the GPIO-pin of the raspberry to the LED-strip. Further reading: jgarff/rpi_ws281x#127 bk1285/rpi_wordclock#38
ref: ibmtjbot/tjbot#158
//install from package manager in node_modules npm install @gbkwiatt/node-rpi-ws281x-native
//install outside project npm install rpi-ws281x --save
// cd to ~/node_modules/@gbkwiatt/node-rpi-ws281x-native/src
// delete rpi_ws281x rm -rf rpi_ws281x/
// copy cp -r ~/rpi_ws281x ~/node_modules/@gbkwiatt/node-rpi-ws281x-native/src
// cd out to main folder cd ~/node_modules/@gbkwiatt/node-rpi-ws281x-native/
// run rebuild sudo node-gyp rebuild
// run build npm run build
//start npm start
//anoter potential fix $ npm install rpi-ws281x-native@latest $ git clone --single-branch --branch raspi4support https://github.com/jimbotel/rpi_ws281x.git $ cp -r rpi_ws281x/* node_modules/rpi-ws281x-native/src/rpi_ws281x $ npm build node_modules/rpi-ws281x-native
//also had to fix the hardcoding of channel 1 if you are using mutple gpio's and channels as I am More info here: https://github.com/beyondscreen/node-rpi-ws281x-native/commit/49c7018da34df5cd8f9d653ba0f17f8141365327
// pins that can be used PWM0, which can be set to use GPIOs 12, 18, 40, and 52. Only 12 (pin 32) and 18 (pin 12) are available on the B+/2B/3B
PWM1 which can be set to use GPIOs 13, 19, 41, 45 and 53.
Only 13 is available on the B+/2B/PiZero/3B, on pin 33
npm cache clean --force npm cache verify
https://www.instructables.com/Install-Nodejs-and-Npm-on-Raspberry-Pi/ https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps
https://heynode.com/tutorial/install-nodejs-locally-nvm/ // check version node -v || node --version
// list installed versions of node (via nvm) nvm ls
// install specific version of node nvm install 6.9.2
// set default version of node nvm alias default 6.9.2
// switch version of node nvm use 6.9.1
// to list available remote versions of node (via nvm) nvm ls-remote
Install Node nvm install <node_version> // Install a specific Node version nvm install node // Install latest Node release (Current) nvm install --lts // Install latest LTS release of NodeJS nvm install-latest-npm // Install latest NPM release only
List Available Node Releases
nvm ls-remote
nvm ls-remote | grep -i "latest"
nvm ls-remote | grep -i "<node_version>"
List Installed Nodes nvm list node // Lists installed Node versions nvm list (or) nvm ls // Lists installed Node versions with additional release info
Switch To Another Node Version nvm use node // Switch to the latest available Node version nvm use <node_version_or_alias> // Switch to a specific version nvm use --lts // Switch to the latest LTS Node version
Verifying Node Version node -v (or) node --version npm -v (or) npm --version nvm -v (or) nvm --version
Set Alias nvm alias default node // Always defaults to the latest available node version on a shell nvm alias default <node_version> // Set default node version on a shell nvm alias <alias_name> <node_version> // Set user-defined alias to Node versions
nvm unalias <alias_name> // Deletes the alias named <alias_name>
Path to Node Executable nvm which <installed_node_version> // path to the executable where a specific Node version is installed
Uninstall Specific Node Version nvm uninstall <node_version> // Uninstall a specific Node version nvm uninstall --lts // Uninstall the latest LTS release of Node nvm uninstall node // Uninstall latest (Current) release of Node
Uninstall NVM To remove, delete, or uninstall nvm, just remove the $NVM_DIR folder (usually ~/.nvm)