Git Product home page Git Product logo

esp8266_client_server_relay's Introduction

ESP8266_Client_Server_Relay

This sketch needs to be written onto generic ESP8266 NodeMCUs. There is one server and up to 4 clients. Each client has a button attached to GND and D4. Upon button press, the server triggers a section of an addressable LED Strip to be on/off.

Clients:

  1. Download esp_client.ino and edit the first line ("clientName") to a string number from "1" to "4". This will configure, which server output (relay/led) will be triggered.
  2. Flash the file to the NodeMCU
  3. Attach a button to GND and D4
  4. Done!

Server:

  1. Download esp_relay_server.ino and edit the first lines (modeOne, modeTwo, ...). These can be set to either "toggle", "hold" or "timed". While toggle and hold should be self explaining, times will use the variables below (timeOne, timeTwo, ...). These are milliseconds. A button press will enable the relay channel and disable it again after a set amount of milliseconds.
  2. Flash your NodeMCU
  3. Done!

When powering up, the clients will blink while trying to find the server. When the server is in range, they will connect to it and stop blinking. Now you can use the push buttons to toggle, hold or enable your channels for X milliseconds.

Notes:

  • Buttons and server will identify a lost connection and reconnect by themselves (uses a ping/pong system)

esp8266_client_server_relay's People

Contributors

mr0inka avatar

Watchers

 avatar  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.