Giter Club home page Giter Club logo

iotwemos's People

Contributors

shivasiddharth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iotwemos's Issues

static ip

sir i want to add static ip to it can you tell me how can i do it

error class fauxmoESP has no member named onMessage

C:\Users\sexyy\Downloads\16 device alexa control\sketch_feb03a\sketch_feb03a.ino: In function 'void setup()':

sketch_feb03a:161: error: 'class fauxmoESP' has no member named 'onMessage'

fauxmo.onMessage(callback);

      ^

exit status 1
'class fauxmoESP' has no member named 'onMessage'
...i use NODEMCU

error : 'D1' not declared in scope

#include<ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>

const char* ssid = "DLink77"; //Set your wifi network name(ssid)
const char* password = "ajith3615"; //Set your router password

int Device1 = D1;
int Device2 = D2;
int Device3 = D3;
int Device4 = D4;
WiFiServer server(80);

void setup() {
Serial.begin(115200); //change according to your com port baud rate
delay(10);

//Declare device pins
pinMode(Device1, OUTPUT);
digitalWrite(Device1, LOW);
pinMode(Device2, OUTPUT);
digitalWrite(Device2, LOW);
pinMode(Device3, OUTPUT);
digitalWrite(Device3, LOW);
pinMode(Device4, OUTPUT);
digitalWrite(Device4, LOW);

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

// Start the server
server.begin();
Serial.println("Server started");

// Print the IP address
Serial.print("Use this URL : ");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.println("/");
}

void loop() {

// Check for an active client
WiFiClient client = server.available();
if (!client) {
return;
}

// Wait until client responds
Serial.println("new client");
while (!client.available()) {
delay(1);
}

// Read client request
String request = client.readStringUntil('\r');
Serial.println(request);
client.flush();

// Check device request
if (request.indexOf("/Device1=ON") != -1) {
digitalWrite(Device1, HIGH);
}
if (request.indexOf("/Device1=OFF") != -1) {
digitalWrite(Device1, LOW);
}
if (request.indexOf("/Device2=ON") != -1) {
digitalWrite(Device2, HIGH);
}
if (request.indexOf("/Device2=OFF") != -1) {
digitalWrite(Device2, LOW);
}
if (request.indexOf("/Device3=ON") != -1) {
digitalWrite(Device3, HIGH);
}
if (request.indexOf("/Device3=OFF") != -1) {
digitalWrite(Device3, LOW);
}
if (request.indexOf("/Device4=ON") != -1) {
digitalWrite(Device1, HIGH);
}
if (request.indexOf("/Device4=OFF") != -1) {
digitalWrite(Device1, LOW);
}

// Return the client response
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println(""); // do not forget this one
client.println("");
client.println("");

//HTML code for controling devices from browser
client.println("

");
client.println("Device 1: <a href="/Device1=ON">ON and <a href="/Device1=OFF">OFF
");
client.println("
");
client.println("Device 2: <a href="/Device2=ON">ON and <a href="/Device2=OFF">OFF
");
client.println("
");
client.println("Device 3: <a href="/Device3=ON">ON and <a href="/Device3=OFF">OFF
");
client.println("
");
client.println("Device 4: <a href="/Device3=ON">ON and <a href="/Device4=OFF">OFF
");
client.println("
");
client.println("");
client.println("");

delay(1);
Serial.println("Client disconnected");
Serial.println("");

}

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.