Gateway con agregar controles mediante firebase
Dependencies: mbed mbed-http ESP01 Pulse RFDecoder
Revision 2:bc3973471585, committed 2019-05-25
- Comitter:
- Thrillex13
- Date:
- Sat May 25 18:08:19 2019 +0000
- Parent:
- 1:cf6a75de25ce
- Child:
- 3:5dceee1c49fc
- Commit message:
- Se cambio la libreria de ESP01 de Quevedo por la de William Thenaers
Changed in this revision
| ESP01.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ESP01.lib Sat May 25 04:59:06 2019 +0000 +++ b/ESP01.lib Sat May 25 18:08:19 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/Thrillex13/code/ESP8266/#99f1cb937894 +https://os.mbed.com/users/Wosser1sProductions/code/ESP8266/#54b89962c798
--- a/main.cpp Sat May 25 04:59:06 2019 +0000
+++ b/main.cpp Sat May 25 18:08:19 2019 +0000
@@ -3,7 +3,6 @@
#include "ESP01.h"
#include "https_request.h"
#include "mbed_trace.h"
-//#include "network-helper.h"
#include "TCPSocket.h"
#include "ESP8266Interface.h"
@@ -114,11 +113,23 @@
wifiInit();
wifiConnect();
+
+
//NextToDo: Crear un servidor y a la vez hacer get y post
ESP8266Interface net(PTC17, PTC16); //Con este objeto implementamos todas las funciones de red para la creacion de Sockets
+
http_demo(&net);
+ wifi.StartServerMode(333);
+ wifi.RcvReply(rcv, 1000);
+ pc.printf("%s", rcv);
+ wait(20);
+
+ http_demo(&net);
+
+
+
while(1);
@@ -131,7 +142,7 @@
wait(2);
wifi.DisableEcho();
pc.printf("Set mode to Station+AP\r\n");
- wifi.SetMode(3);
+ wifi.SetMode(BOTH);
wifi.RcvReply(rcv, 1000);
pc.printf("%s", rcv);
wait(2);
@@ -177,7 +188,7 @@
bool isConnectedToWifi(void){
bool status;
- wifi.GetConnStatus(rcv);
+ wifi.GetConnStatusCode(rcv);
//pc.printf("%s", rcv);
if(strcmp(rcv,"STATUS:2\r")==0){
led_azul = OFF;