Coder Social home page Coder Social logo

itsstar / relayremote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shanet/relayremote

0.0 1.0 0.0 2.56 MB

An Arduino relay control server and Android client

License: GNU Lesser General Public License v3.0

Java 14.39% Processing 0.39% Makefile 0.77% C++ 20.86% C 56.28% Arduino 7.31%

relayremote's Introduction

RelayRemote

Shane Tully (shanetully.com)

An Arduino-based relay control server and Android client

Note: This project may go long periods of time without being updated, however it is actively used and maintained. Bug reports and pull requests are welcome.

About

RelayRemote is an Arduino-based server for remotely controlling electrical relays which in turn turn on/off devices run from a standard 120V AC circuit. The project includes three clients, an Android application, a desktop client for control from Linux systems, and an Arduino-based wall switch.

The Android app supports multiple relay servers, relay groups, homescreen widgets, and NFC tags.

A demo video and brief description of how it works is available at: https://shanetully.com/2012/12/controlling-a-relay-via-an-arduino-from-an-android-client-with-nfc/

The original version of this project used an Arduino Uno and Arduino ethernet shield. See the legacy documentation for instructions on using the legacy hardware.

Hardware

Relay

RelayRemote was built and tested on an Adafruit Feather M0 WiFi. A PowerSwitch Tail II is the recommended relay.

Wall Switch

An optional piece of hardware is a wall switch for turning on/off relays more like a traditional light switch.

Usage

Setting up the hardware

  1. Connect a wire from the positive terminal of the relay to a pin between 2 and 9 (inclusive) on the Feather. Keep note of the pin you choose. Multiple relays can be connected to the same Feather by connecting them to different pins.
  2. Connect a wire from the negative terminal of the relay to a ground pin on the Feather.

Setting up the software dependencies

These instructions are for Linux (x86_64).

  • Download and extract the Adafruit SAMD library to ~/.arduino15/packages/adafruit/hardware/samd/1.0.9
  • Download and extract the ARM compiler to ~/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/4.8.3-2014q1
  • Download and extract Bossac to ~/.arduino15/packages/adafruit/tools/bossac/1.6.1-arduino.
  • Download and extract CMSIS to ~/.arduino15/packages/adafruit/tools/CMSIS/4.0.0-atmel.

Note: The archives above can be extracted whenever you'd like, but the paths at the top of the Makefile must be adjusted accordingly.

Compiling & Uploading

  1. Create arm/src/secrets.h with the following content:
    #define _SSID "your_ssid"
    #define _PASSPHRASE "passphrase"
    
  2. Change the network settings (IP, DNS, netmask, and gateway) for the Feather by editing the server header (arm/server.h) in the arm directory of this repo.
  3. Then:
    $ cd arm
    $ make WIFI_SERVER
    $ make upload
    

Android app

  1. Install the APK provided on the Releases page

Alternatively, the Android app can be compiled by:

  1. Install the Android SDK (http://developer.android.com/sdk/index.html).
  2. Create local.properties in the android/ directory with the following contents: sdk.dir=/path/to/android/sdk.
  3. From the android directory, run:
    $ ./gradlew assembleDebug
    $ ./gradlew installDebug
    

Desktop client

  1. If desired, build the desktop client in the desktop directory of this repo on a Linux system by running make from that directory.
  2. The desktop client is fairly straightforward. Run it with --help for more info.

Wall Switch

  1. Wire the circuit as follows: On the switch VDD is pin 1 (left most) and LED- is pin 4 (right most).
  2. Then follow the instructions in the "Setting up the software dependencies" and "Compiling & Uploading" sections above.
  3. Use make WIFI_CLIENT to build.

Networking

The default port is 2424. Don't forget to add rules to allow communication on this port on any firewalls or gateways between the client and the server.

License

Copyright (C) 2012 Shane Tully

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

relayremote's People

Contributors

shanet avatar

Watchers

 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.