Giter Site home page Giter Site logo

smarttrash's Introduction

Smart Trash Can with IOTIFY & IBM IoT Framework

This is the accompanying source code for this IOTIFY documentation.

This project is an IoT enabled Smart Trash Can which can update users about its current level through a mobile app and also notify via SMS in case the level breaches a critical point. It uses IBM's IoT Platform to enable MQTT based messaging between the Trash can and mobile app.

#Overview Mobile app which is used to display the current level of filled trash inside the can. The trash can is powered by IOTIFY's raspberry pi simulator and has a ultrasonic sensor which is used to sense the level. The hardware connection between Raspberry Pi and ultrasonic sensor is as per the IOTIFY TrasnCan project description.

  1. IBM Id Bluemix Account
  2. Twillio Account

You will have to add some configuration settings to make the application work with IBM IoT platform service and Twilio messaging. These configurations are to be done as variables, which are already defined in the trash can's application code under Trashcan.py.

Edit the variables in the following lines as follows

      Variable name       Line no.           Description

      account_sid         23                 Twilio account SID

      auth_token          24                 Twilio account authToken
      
      twilionumber        28                 Twilio Number ( Your Twilio subscribed number)
      
      receivernumber      29                 Twilio verified number (where you want to receive the SMS notifications). 
                                             Should have country code, for example +18458892405

      organization        182                IBM account organization ID

      authKey             189                Generated API key

      authToken	      190                Generated Authentication token

The IBM IoT platform configurations has to be done in the mobile app as well, since the mobile app is also registered as a device instance for receiving the readings published by the trash can.

Edit the line numbers in index.js

      Variable Name        Line no.            Description

      org                  55                  IBM account organization ID

      auth-key             60                  Generated API key	

      auth-token           61                  Generated authentication token  

For building the mobile app, please refer to the official Cordova & Android documentation to setup the build dependencies. You will have to setup a build system with the dependencies, primarily the NodeJS, Java and Ant among others.

Follow the steps below to build the APK file for the mobile app. All these steps are to be performed on the build system. These steps have been verified on a build system with Ubuntu mate OS along with Android version 23 & Cordova 6.3.0

Step 1: Clone this repository and run the following commands from within the repository to pull the submodules from https://github.com/ibm-watson-iot/iot-nodejs to get the nodejs sdk for the IBM IoT platform.

git submodule init
git submodule update

Step 2: Add the android platform by executing this command in the terminal under the app root folder ( TrashCanApp)

	cordova platform add android

Step 3: In the config.xml file in the root folder change the name of the app to the name you want. This is optional step. By default the app name is "Trash Can"

Step 4: Build the app by executing the following command in the terminal in the root folder of the cordova app

      cordova build android

Step 5: Once build is successful, you can find the generated apk file in the following path relative to the cordova project root directory.

	/platforms/android/build/outputs/apk

smarttrash's People

Contributors

shyampurk avatar rajeevbrahma avatar iotify avatar

Watchers

James Cloos avatar Chinmoy Maity avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.