Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ESP8266_LocalPhant_KL25Z by
Revision 2:817794b2f733, committed 2016-06-26
- Comitter:
- SIT2016
- Date:
- Sun Jun 26 10:19:24 2016 +0000
- Parent:
- 1:2012c31aee1b
- Commit message:
- Modified initialize and send functions. Printing http command on screen
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2012c31aee1b -r 817794b2f733 main.cpp --- a/main.cpp Fri Jun 24 02:22:53 2016 +0000 +++ b/main.cpp Sun Jun 26 10:19:24 2016 +0000 @@ -20,14 +20,14 @@ #define PASS "eduvance" //Remote IP -#define IP "192.168.0.13" +#define IP "192.168.0.2" //ldrvalue global variable float ldrval = 0; //Public and private keys for phant -char* Public_Key = "wyJD1Pza1OCk1QEKk9K9C10zdyj3"; -char* Private_Key = "OrxMl9BLlOCvPZdBv4B4H3mDOAlx"; +char* Public_Key = "eaWkxgdlQZszLEDKpy6OFeDeO8x"; +char* Private_Key = "25xqpAeBmzSml4Yjpr05Hj3jOBq"; //Wifi init function void wifi_initialize(void){ @@ -61,10 +61,6 @@ pc.printf("%s",resp); else pc.printf("No response while getting IP \r\n"); - -} - -void wifi_send(void){ pc.printf("******** Setting WIFI UART passthrough ********\r\n"); wifi.setTransparent(); @@ -72,7 +68,7 @@ pc.printf("%s",resp); else pc.printf("No response while setting wifi passthrough. \r\n"); - wait(1); + wait(1); pc.printf("******** Setting single connection mode ********\r\n"); wifi.SetSingle(); @@ -82,6 +78,9 @@ else pc.printf("No response while setting single connection \r\n"); wait(1); +} + +void wifi_send(void){ pc.printf("******** Starting TCP connection on IP and port ********\r\n"); wifi.startTCPConn(IP, 8080); //cipstart @@ -94,6 +93,7 @@ //create link sprintf(http_cmd,"/input/%s?private_key=%s&val=%0.2f",Public_Key,Private_Key,ldrval); + pc.printf(http_cmd); pc.printf("******** Sending URL to wifi ********\r\n"); wifi.sendURL(http_cmd, comm); //cipsend and get command