Skip to the content.

rcraspi

Controlling Raspberry GPIO for home automation with a web/mobile app.

Click here or on the image below to view youtube video.

This application was generated using JHipster 5.7.2, you can find documentation and help at JHipster Homepage and latest documentation.

About

This software is intended to run on raspberry pi to control GPIO. It provides an interface for controlling the GPIO remotely via the network. The GPIO can be controlled via a device like smartphone or web browser.
The software was designed with the following requirements in mind:

Release notes

Release 1.3.1

Release 1.3

Release 1.1

Release 1.0

Nice to have (wish list)

Development

Before you can build this project, you must install and configure the following dependencies on your machine:

  1. Node.js: We use Node to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle.

After installing Node, you should be able to run the following command to install development tools. You will only need to run this command when dependencies change in package.json.

npm install

We use npm scripts and Webpack as our build system.

Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.

./mvnw
npm start

Npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by specifying a newer version in package.json. You can also run npm update and npm install to manage dependencies. Add the help flag on any command to see how you can use it. For example, npm help update.

The npm run command will list all of the scripts available to run for this project.

Service workers

Service workers are commented by default, to enable them please uncomment the following code.

<script>
    if ('serviceWorker' in navigator) {
        navigator.serviceWorker
        .register('./service-worker.js')
        .then(function() { console.log('Service Worker Registered'); });
    }
</script>

Note: workbox creates the respective service worker and dynamically generate the service-worker.js

Building for production

create database on raspberry pi (mysql)

create user 'rcraspi'@'%' identified by 'rcraspi';  
create database rcraspi;
GRANT ALL PRIVILEGES ON rcraspi.* TO 'rcraspi'@'%';

To optimize the rcraspi application for production, run:

./mvnw -Pprod package -DskipTests

Copy the package on raspberry pi

scp target/rcraspi-version.war pi@piaddress:/home/pi/rcraspi

To ensure everything worked, run:

sudo ./rcraspi-version.war

Then navigate to http://piaddress:8081 in your browser.

Refer to Using JHipster in production for more details.

Testing

To launch your application’s tests, run:

./mvnw clean test

Client tests

Unit tests are run by [Jest][] and written with [Jasmine][]. They’re located in src/test/javascript/ and can be run with:

npm test

For more information, refer to the Running tests page.