Raspberry Pi with:
- Raspbian/NOOBS installed
- Network connection
- 100MB of free space
Basic NodeJS/Javascript experience
- Install nodejs
- Download an ARM6l .tar.gz nodejs from https://nodejs.org/dist/
- tar -xzf <nodejs-tar-gz-file>
- sudo cp -r <nodejs-unzipped-folder>/* /usr/local/
- git clone this project
- Open the terminal and navigate inside the cloned project
- npm install
- npm build
- Builds the single page application for remote interaction.
- ifconfig
- detect IP address of the PI
- npm start
- Use any browser enabled device on your network and navigate to <Raspberry Pi IP Address>:9000
- Create your first script :)
- git pull
- npm install
- npm build
- npm start
- Remote listing and editing scripts
- Viewing log files
- (Re)starting scripts
- setInterval & setTimeout alternatives to ensure cleanup
- pigpio for GPIO pins input/output support
Your script can export the following functions:
- module.exports.onStart: (helpers: ScriptHelpers) => undefined
- This function will be triggered when the "Execute" button on the UI is clicked and the current active script was ended.
- module.exports.onStop: (helpers: ScriptHelpers) => undefined
- This function will be triggered when the "Execute" button on the UI is clicked to clean up the script.
Instances of ScriptHelper provides functions that keep scripts concise, predictable and destructible.
- log: (message: string) => undefined
- Adds an entry to the logs.
- interval: (...setIntervalArgs) => intervalId: number
- Highly recommend using this instead of setInterval. Calls clearInterval on stop/reboot.
- timeout: (...setTimeoutArgs) => timeouteId: number
- Highly recommend using this instead of setTimeout. Calls clearTimeout on stop/reboot.
- wait: (milliseconds) => Promise
- Promisified timeout. Example: "async () => { log('Start'); await wait(5000); log('Done');
- Highly recommend using this instead of setTimeout. Calls clearTimeout on stop/reboot.
- gpio: require('rpi-gpio')
- Highly recommend using the script helper instead of manually importing for cleaning up on stop/reboot.
- gpiop: require('rpi-gpio').promise
- Highly recommend using the script helper instead of manually importing for cleaning up on stop/reboot.
- pigpio: require('pigpio')
- Highly recommend using the script helper instead of manually importing for cleaning up on stop/reboot.
- Documentation: https://github.com/fivdi/pigpio
- Script webpage for sensor/camera feedback and remote virtual control
- Live logs
- Extend editor