Thingspeak IoT using Nucleo-F411RE and IDW01m1
Dependencies: mbed X_NUCLEO_IDW01M1v2 NetworkSocketAPI
Diff: main.cpp
- Revision:
- 9:13bd9c989e6c
- Parent:
- 8:74b827befe72
- Child:
- 10:cc61a766cd1f
--- a/main.cpp Thu Jan 05 09:39:03 2017 +0000 +++ b/main.cpp Tue Jan 10 09:20:31 2017 +0000 @@ -144,8 +144,10 @@ int t=0; scanf("%d",&t); printf ("entered time is: %d \n\r", t); - if (t != 0) { time_t txTm = t; set_time(txTm); } - printf ("The current system time is: %s", ctime (&ctTime)); + if (t != 0) { time_t txTm = t; set_time(txTm); } // set Nucleo system time + ctTime = time(NULL); + printf ("The current system time is: %s", ctime (&ctTime)); // set WiFi module systm time + if (!spwf.set_time(ctTime)) printf ("ERROR set_time\n\r"); if (!spwf.clean_TLS_certificate(ALL)) printf ("ERROR clean_TLS_certificate\n\r"); if (!spwf.set_TLS_certificate(CA_cert, sizeof(CA_cert), FLASH_CA_ROOT_CERT)) printf ("ERROR set_TLS_certificate\n\r"); if (!spwf.set_TLS_SRV_domain("www.amazon.it",FLASH_DOMAIN)) printf ("ERROR set_TLS_CA_domain\n\r");