REHolt / Garage-Door-Controller

ESP8266 Garage Door opener with Android App
GNU General Public License v3.0
5 stars 1 forks source link

Out of scope error #1

Closed angipp01 closed 8 years ago

angipp01 commented 8 years ago

Question? Is the #include "user_interface.h" missing? Is see it in the script but I don't see that you supplied it.

I have copied and pasted you script. Here is my copy. Still getting that out of scope error.

//------------------------------------------------------------------------------- void setup() {

// Hostname defaults to esp8266-[ChipID] wifi_station_set_hostname(HostName);

Serial.begin(115200); delay(10);

Serial.println("Booting"); WiFi.mode(WIFI_STA);

pinMode(14, OUTPUT);

// prepare GPIO4 to control the door switch pinMode(4, OUTPUT); digitalWrite(4, 0);

// Prepare GPIO5 to monitor Status of the door pinMode(interrupt1, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt1), Status, CHANGE);

// Prepare GPIO12 to monitor Status of the door pinMode(interrupt2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt2), Status, CHANGE);

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

WiFi.begin(ssid, password);

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

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

// Print the IP address Serial.println(WiFi.localIP());

// print the host name Serial.print("Host Name: "); Serial.println(WiFi.hostname());

// Port defaults to 8266 // ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID] ArduinoOTA.setHostname(HostName);

// No authentication by default //ArduinoOTA.setPassword((const char *)"1234");

ArduinoOTA.onStart([]() { Serial.println("Start"); });

ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });

ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });

ArduinoOTA.onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); });

//setup the OTA server ArduinoOTA.begin();

Serial.println("Ready"); Serial.print("IP address: "); Serial.println(WiFi.localIP());

//check Status of Garage Door at power-up if (Door_Status = "Unknown") Status(); timer.setInterval(5000, checkOpen);

REHolt commented 8 years ago

The "user_interface.h" is part of the standard NodeMCU pacakge for ESP8266. If I recall I went to the library repository inside Arduino IDE and loaded the ESP8266 libraries.

angipp01 commented 8 years ago

Oh ok will check that out

REHolt commented 8 years ago

Where you able to install the correct libraries and get the program to compile?

If there is anything I can do to help, let me know.

angipp01 commented 8 years ago

I was thinking the issue is with the libraries. But if it was, upon the verification it would alert me about issue libraries and it does t. No alert regarding any "h" files.

REHolt commented 8 years ago

Seems that I had a similar issue once, but don't recall exactly what caused it. Post your entire sketch .Ino file and I'll see if I can find the issue. I'm pretty sure it is either a syntax error of the library issue. Do a search on your system and see if you can find the library on your hard drive.

REHolt commented 8 years ago

I'm still curious, were you able to find the problem? I hope the code is working for you. If you have any other questions, don't hesitate to ask. If I don't hear back within the next day or so I will gonahead and close this issue.

angipp01 commented 8 years ago

Sorry, I haven't examined it yet.. I am going to wait towards the weekend and on vacation next week (so I will have plenty of time to examine), to look into this again. I am excited to get the ball rolling because I am nearly done. Just getting 2-3 errors on the script.

angipp01 commented 8 years ago

Here is my copy (which is your copy) Still can't figure why that error.

include

include

include

include

include

include

include

extern "C" {

include "user_interface.h"

}

include "Keys.h"

ifdef DEBUG_ESP_PORT

define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( VA_ARGS )

else

define DEBUG_MSG(...)

endif

//Home Network const char* ssid = "Media2"; const char* password = "PasswordXXX";

// Hostname defaults to esp8266-[ChipID] char HostName[] = "Garage Door";

//Garage Door Status variables int Status_Open; int Status_Closed; int On_Status; String Door_Status = "Unknown";

//Interrupt Definition const byte interrupt1 = 5; const byte interrupt2 = 12; volatile byte state = LOW;

//Garage Door Open Timer setup double openForTooLongInMins = 60; int doorOpenedAtTimeInMills = 0; int doorOpenDurationInSeconds = 0; bool messageSentInThisOpening = false; const int doorOpen = HIGH; const int doorClosed = LOW; SimpleTimer timer;

// Create an instance of the server // specify the port to listen on as an argument WiFiServer server(80);

//------------------------------------------------------------------------------- void setup() {

// Hostname defaults to esp8266-[ChipID] wifi_station_set_hostname(HostName);

Serial.begin(115200); delay(10);

Serial.println("Booting"); WiFi.mode(WIFI_STA);

pinMode(14, OUTPUT);

// prepare GPIO4 to control the door switch pinMode(4, OUTPUT); digitalWrite(4, 0);

// Prepare GPIO5 to monitor Status of the door pinMode(interrupt1, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt1), Status, CHANGE);

// Prepare GPIO12 to monitor Status of the door pinMode(interrupt2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt2), Status, CHANGE);

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

WiFi.begin(ssid, password);

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

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

// Print the IP address Serial.println(WiFi.localIP());

// print the host name Serial.print("Host Name: "); Serial.println(WiFi.hostname());

// Port defaults to 8266 // ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID] ArduinoOTA.setHostname(HostName);

// No authentication by default //ArduinoOTA.setPassword((const char *)"1234");

ArduinoOTA.onStart([]() { Serial.println("Start"); });

ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });

ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });

ArduinoOTA.onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); });

//setup the OTA server ArduinoOTA.begin();

Serial.println("Ready"); Serial.print("IP address: "); Serial.println(WiFi.localIP());

//check Status of Garage Door at power-up if (Door_Status = "Unknown") Status(); timer.setInterval(5000, checkOpen); } /------------------------------------------------------------ Interrupt Service Routine for Garage Door Status The routine is set-up to read two HALL-Effect sensors One (Status_Open) is triggered when the door is all the way open The second one is triggered when the door is all the way closed If they are both reading "Low" then there is a sensor error, since they are pulled up to 3.3volts and are pulled low when the magenet is present. The second one is probably over-kill, but it gives an indiction if the door is only partially open /

void Status() { Status_Open = digitalRead(interrupt1); Status_Closed = digitalRead(interrupt2); switch (Status_Open) { case 0: { switch (Status_Closed) { case 0: { Door_Status = "Sensor Error"; } break; case 1: { Door_Status = "Open"; } break; } } break; case 1: { switch (Status_Closed) { case 0: { Door_Status = "Closed"; } break; case 1: { Door_Status = "Partially Open"; } break; } } } }

//------------------------------------------------------------ /*Door Monitoring and SMS message routines

void sendSms(String message) { HTTPClient http;

http.begin(iftttMakerUrl, "A9 81 E1 35 B3 7F 81 B9 87 9D 11 DD 48 55 43 2C 8F C3 EC 87");

http.addHeader("content-type", "application/json"); int result = http.POST("{\"value1\":\"" + message + "\"}");

http.end(); }

void checkOpen() { if ( digitalRead(interrupt2) == doorOpen ) { doorOpenDurationInSeconds += 5; } if (digitalRead(interrupt2) == doorClosed) { }

if ( messageSentInThisOpening == false && doorOpenDurationInSeconds > openForTooLongInMins * 60 ) { String messageToSend = (String)"WARNING: your garage door has been open for more than " + openForTooLongInMins + " mins!"; sendSms(messageToSend);

doorOpenDurationInSeconds =0; // todo: this does not know if it sent successfully. needs work messageSentInThisOpening = true; } }

//-------------------------------------------------------------- void loop() { timer.run(); ArduinoOTA.handle();

// Check if a client has connected WiFiClient client = server.available(); if (!client) { return; }

// Wait until the client sends some data Serial.println("new client"); while (!client.available()) { delay(1); }

// Read the first line of the request String req = client.readStringUntil('\r'); Serial.println(req); client.flush();

// Match the request int val; if (req.indexOf("/gpio/1") != -1) val = 1; // else if (req.indexOf("/gpio/0") != -1) // val = 0; else { Serial.println("invalid request"); client.stop(); return; }

// Set GPIO4 according to the request digitalWrite(4, val); delay (500); val = 0; digitalWrite(4, val); client.flush();

// Prepare the response String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\n\r\nGPIO is now "; s += (val) ? "high" : "low"; s += "\n";

// Send the response to the client client.print(s); delay(1); Serial.println("Client disonnected");

// The client will actually be disconnected // when the function returns and 'client' object is detroyed

angipp01 commented 8 years ago

Note: I am using Board: ESP-13 Module. Would this be the issue? I have tried other wireless boards with your script, and still getting interrupt error

REHolt commented 8 years ago

Your missing a bunch of other "Include" Statements;

include

include

include

include

include

include

include

extern "C" {

include "user_interface.h"

}

include "Keys.h" //includes the wifi credentials and IFTTT URL

Try downloading my latest version.

I will copy this one to a test file and see what I can do.

angipp01 commented 8 years ago

include

include

include

include

include

include

include

extern "C" {

include "user_interface.h"

}

include "Keys.h"

ifdef DEBUG_ESP_PORT

define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( VA_ARGS )

else

define DEBUG_MSG(...)

endif

//Home Network const char* ssid = "Media2"; const char* password = "PasswordXXX";

// Hostname defaults to esp8266-[ChipID] char HostName[] = "Garage Door";

//Garage Door Status variables int Status_Open; int Status_Closed; int On_Status; String Door_Status = "Unknown";

//Interrupt Definition const byte interrupt1 = 5; const byte interrupt2 = 12; volatile byte state = LOW;

//Garage Door Open Timer setup double openForTooLongInMins = 60; int doorOpenedAtTimeInMills = 0; int doorOpenDurationInSeconds = 0; bool messageSentInThisOpening = false; const int doorOpen = HIGH; const int doorClosed = LOW; SimpleTimer timer;

// Create an instance of the server // specify the port to listen on as an argument WiFiServer server(80);

//------------------------------------------------------------------------------- void setup() {

// Hostname defaults to esp8266-[ChipID] wifi_station_set_hostname(HostName);

Serial.begin(115200); delay(10);

Serial.println("Booting"); WiFi.mode(WIFI_STA);

pinMode(14, OUTPUT);

// prepare GPIO4 to control the door switch pinMode(4, OUTPUT); digitalWrite(4, 0);

// Prepare GPIO5 to monitor Status of the door pinMode(interrupt1, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt1), Status, CHANGE);

// Prepare GPIO12 to monitor Status of the door pinMode(interrupt2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(interrupt2), Status, CHANGE);

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

WiFi.begin(ssid, password);

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

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

// Print the IP address Serial.println(WiFi.localIP());

// print the host name Serial.print("Host Name: "); Serial.println(WiFi.hostname());

// Port defaults to 8266 // ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID] ArduinoOTA.setHostname(HostName);

// No authentication by default //ArduinoOTA.setPassword((const char *)"1234");

ArduinoOTA.onStart([]() { Serial.println("Start"); });

ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });

ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });

ArduinoOTA.onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); });

//setup the OTA server ArduinoOTA.begin();

Serial.println("Ready"); Serial.print("IP address: "); Serial.println(WiFi.localIP());

//check Status of Garage Door at power-up if (Door_Status = "Unknown") Status(); timer.setInterval(5000, checkOpen); } /------------------------------------------------------------ Interrupt Service Routine for Garage Door Status The routine is set-up to read two HALL-Effect sensors One (Status_Open) is triggered when the door is all the way open The second one is triggered when the door is all the way closed If they are both reading "Low" then there is a sensor error, since they are pulled up to 3.3volts and are pulled low when the magenet is present. The second one is probably over-kill, but it gives an indiction if the door is only partially open /

void Status() { Status_Open = digitalRead(interrupt1); Status_Closed = digitalRead(interrupt2); switch (Status_Open) { case 0: { switch (Status_Closed) { case 0: { Door_Status = "Sensor Error"; } break; case 1: { Door_Status = "Open"; } break; } } break; case 1: { switch (Status_Closed) { case 0: { Door_Status = "Closed"; } break; case 1: { Door_Status = "Partially Open"; } break; } } } }

//------------------------------------------------------------ /*Door Monitoring and SMS message routines

void sendSms(String message) { HTTPClient http;

http.begin(iftttMakerUrl, "A9 81 E1 35 B3 7F 81 B9 87 9D 11 DD 48 55 43 2C 8F C3 EC 87");

http.addHeader("content-type", "application/json"); int result = http.POST("{\"value1\":\"" + message + "\"}");

http.end(); }

void checkOpen() { if ( digitalRead(interrupt2) == doorOpen ) { doorOpenDurationInSeconds += 5; } if (digitalRead(interrupt2) == doorClosed) { }

if ( messageSentInThisOpening == false && doorOpenDurationInSeconds > openForTooLongInMins * 60 ) { String messageToSend = (String)"WARNING: your garage door has been open for more than " + openForTooLongInMins + " mins!"; sendSms(messageToSend);

doorOpenDurationInSeconds =0; // todo: this does not know if it sent successfully. needs work messageSentInThisOpening = true; } }

//-------------------------------------------------------------- void loop() { timer.run(); ArduinoOTA.handle();

// Check if a client has connected WiFiClient client = server.available(); if (!client) { return; }

// Wait until the client sends some data Serial.println("new client"); while (!client.available()) { delay(1); }

// Read the first line of the request String req = client.readStringUntil('\r'); Serial.println(req); client.flush();

// Match the request int val; if (req.indexOf("/gpio/1") != -1) val = 1; // else if (req.indexOf("/gpio/0") != -1) // val = 0; else { Serial.println("invalid request"); client.stop(); return; }

// Set GPIO4 according to the request digitalWrite(4, val); delay (500); val = 0; digitalWrite(4, val); client.flush();

// Prepare the response String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\n\r\nGPIO is now "; s += (val) ? "high" : "low"; s += "\n";

// Send the response to the client client.print(s); delay(1); Serial.println("Client disonnected");

// The client will actually be disconnected // when the function returns and 'client' object is detroyed

}

angipp01 commented 8 years ago

Here is the Key file. I have setup my ifttt account, but haven't inputted the token in the script. (this is the easy stuff. so I worry about it last. Need the mechanics to work first before, I add the extra features)

const char* wifiCreds[] = { "Media2", "Hamilton" };

String iftttMakerUrl = "https://maker.ifttt.com/trigger/esp_message/with/key/your-token";

angipp01 commented 8 years ago

I that tried multiple boards (Tools>Boards) with your script and I still get the same error. I feel like

REHolt commented 8 years ago

I haven't made it all the way through yet (had to got to lunch with my wife), but I have found several syntax errors. Mostly in the area of the Arduino OTA routines such as:

ArduinoOTA.onStart( { Serial.println("Start"); });

Download my .ino file and compare it to yours.

angipp01 commented 8 years ago

What if for now just turn off the OTA with "//" there are just bell and whistles you have added.

angipp01 commented 8 years ago

Yes my wife said I am spending too much time on this. I was "googling it" if it has anything to do with the boards (Tools>Boards>) but I think it doesn't. Since my unit has your Chip ESP8266

REHolt commented 8 years ago

I have been working with this most of the day, to get the HALL Effect Sensors working properly (the magenets got moved) and to get it to report status over wifi. I have had no problems compiling Sao I don't think it has anything to do with the boards. If you want to comment out all of the OTA routines, that should work, but downloading the new files should work too.

REHolt commented 8 years ago

I made it all the way through your file. I attempted to compile it. Every place Arduino IDE showed an error I compared it to my file and repaired the syntax errors. In each case the error was in the first line of the routine. Once I corrected all of the syntax errors, it compiled without a problem.

With the current version of the file, there is one warning:

"sketch\Keys.h:3:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]"

Since this is only a warning the sketch will run without a problem. this error is due to moving the Host_Name variable to the Key.h file. I have not figured out how to solve it but my research shows that a "deprecated conversion" means that I am using an old methode that is still supported, but in the future it may not be. So I have chosen to ignore it for now (until I can find a way around it).

angipp01 commented 8 years ago

Yes I noticed that you of your script said Host_Name and another said HostName

angipp01 commented 8 years ago

Have upload the recent fix? I have downloaded the script that you are using and still getting the same 2 errors that I have reported.

REHolt commented 8 years ago

Well, yours compiles for me and mine also compiles for me. The only other thing I can suggest is that you look at the include files. You must be missing one of the libraries, or they need to be updated.

REHolt commented 8 years ago

I would look at the name of each include file, go to "Sketch/include Library/Manage libraries" on theArduino IDE task bar. Do a search on each include file name. It should find a library of that name. Check to see if it is install. If not, install it. If it has an update available, update it. If you go through the whole list (7 files) you should be able to compile.

REHolt commented 8 years ago

Can you post the text from the actual errors?

angipp01 commented 8 years ago

I can just here you say. "This guy is an idiot." Ya I feel like one.
I know the libraries are not missing because it they were the errors would say 'not include "

I have copy and pasted everything. garage door errors.txt

REHolt commented 8 years ago

I don't think your an "idiot", I had a lot of problems when I first started working with Arduino and ESP82666. I too felt stupid when I would ask a question and the answer was so simple. I just don't know what else to tell you. I have been using the Garage Door Opener for weeks now. I also have two friends that I have built them for. I know the code, as posted, will compile. The version I posted yesterday included changes that I implemented yesterday and have been using. I even left the garage door open for over an hour to test the SMS feature, which now works again. So I can't see why it will not compile for you.

What version of Arduino IDE are you using? I was using 1.6.9 and updated yesterday to 1.6.11

angipp01 commented 8 years ago

Here is a screen shot screenshots.pdf

REHolt commented 8 years ago

It looks like you must have used the "Verbose" mode for compile messages. I have never seen that much information. From what I can tell, it looks like there are two errors. One is actually a warning "Depricated conversion". I have that one as well. As i explaied yesterday I just ignore it since it works.

The second one I see has to do with defining an interrupt : "attachInterrupt(digitalPinToInterrupt(interrupt1), Status, CHANGE);" This statement is attaching an interrupt to "interrupt1" (Defined above as digital pin 12) . the second item in this command ", Status" is the interrupt service rouitine. And the third item "Change" is telling it to trigger an interrupt every tme the state changes on pin 12.

The error is stating that "Status" is undefined. Therefore you must have some sort of error in the interrupt service routine: "void Status()" which is making it an invalid routine. "void Status()" is below this statement in the "void Setup()" section. I prefaced it with a rather lengthy comment section describing what it does. it starts with: "/*Interrupt Service Routine for Garage Door Status"

REHolt commented 8 years ago

I missed it the first time through, but you also have an error in the "void checkOpen()" subroutine.

timer.setInterval(5000, checkOpen);

is setting up a timer to run the "void checkOpen()" routine every 5000 ms. the error syas that "CheckOpen" was not declared, so that means there is an error in the checkOpen routine making it invalid. Since the routine is actually below this statement, it hasn't gotten around to telling you what the error is (I think).

REHolt commented 8 years ago

I looked through one of the code versions you have posted above. the "void Status()" and "void checkOpen()" routines look OK; however, there could still be some errors in the other routines above them. If you attempted to comment out the OTA routines and put the "//" or "/*" on the wrong side of a "{", "}", or "(" then it will make the rest of the routines wrong, giving you an error. Since it's not making it down that far it wouldn't call out those errors yet.

REHolt commented 8 years ago

I ran a test and confirmed my suspician. I commented out a "}" just before the "void Status()" routine and got the "Status not declared in this scope" error. So, somewhere you have introduced a syntax error, probably by trying to comment out the OTA routines. It is below the "attachInterrupt(digitalPinToInterrupt(interrupt1), Status, CHANGE);" statement, but above the "void Status()" routine.

REHolt commented 8 years ago

Not sure how you copied the .ino file into your project, or if your re-typed it; but, there are characters missing in each of the OTA routines starting with: "ArduinoOTA.onStart( {"" it should read "ArduinoOTA.onStart( []() {"

I pointed this out yesterday. I have noticed that when i do a cut and past, sometimes it doesn't copy all of the charaters (for instance in the code examples above the file names after the Include statements are missing).

if you save the file and open it with Arduino IDE it does fine.

P.S. Yep, in the above "it should read" statement, the characters I replaced are not visible. it must be reading those as control characters for somehting. When I open it to edit the comment, they are still there. Strange

As you can see, this is a learning experiance for me to:)

angipp01 commented 8 years ago

Huh. I have downloaded the newest version of Arduino, and getting an error with ESP-13 module board, but using the generic esp8266 board and with your script it works. (although I am getting an error messages with Host_Name - not a big deal, these are just nifty belles and whistles). So, regarding the errors for host_name. I just "//" them. I will upload the file to board later on this week. ( I am still waiting for the magnetic switches from China). I think this should work on my board. The only thing that is different is mine is a complete unit with no soldering, and yours is 2 separate units.

Thanks for your idea's and help. Who would of thought it was the version I was using.

REHolt commented 8 years ago

Glad to hear you finally got it working. Sorry I wasn't more help.

Since it sounds like you are doing the whole install, including the HALL Effect Sensors, you might be interested to know I will be posting a new version of the Android App. I now have status reporting enabled. You will be able to look at the phone app to see if the door is open or closed. I will post it later this week.

angipp01 commented 8 years ago

Well you were right again. I will kinda finished when I found another issue. I get no errors using the Generic 8266 but using ESP-13 module I get errors. Inputted the error message on the forum and found that I was using ESP 2.0.0. Once I have updated using a different URL to 2.3.0. Now I am able to update your sketch on my board without errors :)

My board gets an ip address of 192.168.0.102 I went on my router and doesn't mention the Host_Name (not a big deal)

I open a webpage and type 192.168.0.102 and page can't be found. It should work because a webpage is using port 80 (default) I'm I doing anything wrong?

REHolt commented 8 years ago

If the Host Name doesn't show up on the Network Configuration, then it is likely that the device isn't logging into Google network properly. That would also be why it can't be found by the browser command.

Make sure you are supplying the proper login credentials and that that part of the code is working.

angipp01 commented 8 years ago

never mind. found it I tried typing http://192.168.0.102/Status

Result: open

REHolt commented 8 years ago

Great! I will upload the new Android app in the next couple of days. I am trying to incorporate configuration options so that youbcan enter the device IP directly without recompiling. I haven't quite gotten it worked out.

angipp01 commented 8 years ago

I will wait for the new app the old app is workable , but the new version show be easier to remotely configuration the app without upload another file after every configuration change

When using the app I am getting this ( look at the pic) the device ip address is 192.168.0.102 and I am able to use a Web page to know the status but the app doesn't work . screenshot_2016-08-23-14-28-41 screenshot_2016-08-23-14-28-39

REHolt commented 8 years ago

I'll download it and take a look. I use a custom version for mine and it'sbbeen awhile since I looked at this one. The other folks who are using it don't seem to have a problem.

angipp01 commented 8 years ago

All my pieces have come in . I wasn't impressed by the magic switch I was hope that it would be bigger 20160823_182506

REHolt commented 8 years ago

What is the "Majic Switch"?

REHolt commented 8 years ago

I see what the problem is: in the "Your IP Address" you have to put the whole adress, i.e. "http://192.168.1.102

thry that and it shoudl work.

REHolt commented 8 years ago

I just uploaded the "Status" version. You'll still have to do the compile thing, but it will provide full functionality.

angipp01 commented 8 years ago

"What is the "Majic Switch"?" - sorry typo = Magnetic Switch

I am trying and trying to use you second app. I compile it an still gives me errors. (yet the old one compiled fine)[yes your right once I inputted http://192.168.1.59 I didn't get an error. Although I got a timeout message saying it still screenshots.pdf didn't communicate with the device,] here is the screenshot

It is one hurtle after another.

angipp01 commented 8 years ago

another question, should I be seeing this when I type http://192.168.1.59/gpio/1 into my browser? screenshots.pdf

angipp01 commented 8 years ago

Thanks. for your assistance. take your time. We all have other lives.
I have always wanted to program, but don't know anything about it. Except HTML. I have ordered a book to learn C++. I have read many books about networking and Cisco devices. So I will attempt to began to read about programming.

REHolt commented 8 years ago

Yes, I think that is correct. If the sensors are not connected they will both be pulled high by the internal pullups. If they are both high it will register as open. On my version, I have two sensors one will read zero when door is closed and the other will read zero when the door is fully open. If they both read one, I set mine as "Partially Open". If they both read zero I set mine. As "Sensor Error".

REHolt commented 8 years ago

I'm doing the same thing. I have never been much good at software. Unfortunately I don't get much out of reading books. I'm more of a hands on kinda guy. I learn best just by doing. I use books and online programing guides for reference when I run into problems.