Blynk and Raspberry Pi: Tips & Tricks

Autostart

To enable Blynk autostart for Pi, find /etc/rc.local file and add there:
1
node full_path_to_your_script.js <YourAuthToken> &
Copied!

Run forever

Use forever utility to auto-restart your script.
1
npm install -g forever
Copied!

Run external scripts/utilities from Blynk

You can run external python, batch, or just anything executable from Node.js using child_process module:
1
var exec = require('child_process').exec;
2
exec('command', function callback(error, stdout, stderr){
3
// result
4
});
Copied!

PiBakery

PiBakery allows you to pre-configure Raspberry Pi, while creating SD Card.
Last modified 4mo ago
Copy link