Skip to content

Commit ea98adf

Browse files
committed
updated readme
1 parent d44b42c commit ea98adf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

pi_plug/README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@
2525
3. `npm install express`
2626
4. `npm install rpio`
2727

28+
## BOOT NODE AT STARTUP ##
29+
30+
Reference:
31+
- https://rebeccamdeprey.com/blog/automatically-start-nodejs-applications-when-your-raspberry-pi-boots-up
32+
33+
- https://pm2.keymetrics.io/docs/usage/startup/
34+
35+
1. Install PM2 `npm install pm2 -g` (I omitted -g for permissionissues...)
36+
2. Run PM2 to start the app: `pm2 start app.js`
37+
3. Get startup command: `pm2 startup`
38+
4. Copy paste command and run it
39+
5. Save current config: `pm2 save`
40+
2841

2942
## REFERENCE ##
3043

3144
- Model B Rev2 pin layout: https://pi4j.com/1.2/pins/model-b-rev2.html
3245

3346
- Using ground + pin 16 (8th from left)
34-
35-
## TODO
36-
-start node server on startup

0 commit comments

Comments
 (0)