GithubHelp home page GithubHelp logo

sclem / esp8266manager Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.5 MB

ESP8266 Wifi Module REST Proxy, written in go

Go 0.18% JavaScript 77.76% Objective-C 2.53% C++ 4.91% C# 0.47% Java 0.92% C 0.01% CSS 13.18% HTML 0.05%

esp8266manager's Introduction

ESP8266 Manager

What is the ESP8266?

https://en.wikipedia.org/wiki/ESP8266

  • Adds a REST proxy to normal TCP commands for one or many ESP8266 modules in a network.

  • Primary use case would be to set up all ESP8266 modules with known IP addresses and configure them in modules.json file. The server will maintain connection to the modules.

  • Client applications will use REST to trigger commands or retrieve information about each module the server knows about.

Getting started
  1. Clone the repo, go install or go run server/server.go

  2. If you don't have any chips on hand, the fakeesp8266 package listens on port 9999 for testing.

An example module config:

[{
    "name": "garage door",
    "target": "192.168.1.150",
    "commands": {
        "open": {
            value: 10
        },
        "close": {
            value: 20
        }
    }
}]

Commands can be nested with subroutines and delays (measured in milliseconds): (Subroutines will evaluate top to bottom)

[{
    "name": "kitchen lights",
    "target": "192.168.1.120",
    "commands": {
        "on": {
            "commands": [{
                value: 1
            }, {
                value: 2,
                delay: 500
            }, {
                "commands": [{
                    value: 3
                }]
            }]
        },
        "off": {
            value: 0
        }
    }
}]

The only restriction is unique names for module names.

API:

From any REST client:

GET /

- returns the list of modules

GET /[moduleName]

- returns a module and all of its commands, including active state (whether the server can currently communicate with it)

GET /[moduleName]/[commandName]

- performs a command by name

LICENSE

MIT

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.