|
|
@ -43,8 +43,10 @@
|
|
|
|
#define TIME 0
|
|
|
|
#define TIME 0
|
|
|
|
#define SUPER_TENANT "carbon.super"
|
|
|
|
#define SUPER_TENANT "carbon.super"
|
|
|
|
|
|
|
|
|
|
|
|
#define SERVICE_EPOINT "/endpoints"
|
|
|
|
#define DAS_SERVICE_EPOINT "/endpoints/temperature-http?deviceId=${DEVICE_ID}"
|
|
|
|
#define EVENT_STREAM "/temperature-http"
|
|
|
|
#define DAS_SERVICE_TEPOINT "/endpoints/t/${TENANT_DOMAIN}/temperature-http?deviceId=${DEVICE_ID}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define IOT_SERVICE_EPOINT "/arduino/device/${DEVICE_ID}/controls"
|
|
|
|
|
|
|
|
|
|
|
|
#define POLL_INTERVAL 1000
|
|
|
|
#define POLL_INTERVAL 1000
|
|
|
|
#define PUSH_INTERVAL 10000
|
|
|
|
#define PUSH_INTERVAL 10000
|
|
|
@ -53,19 +55,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
#define SERVICE_PORT 9763 //http port of iot server
|
|
|
|
#define SERVICE_PORT 9763 //http port of iot server
|
|
|
|
|
|
|
|
|
|
|
|
byte server[4] = {192,168,43,168}; //Ip address of iot server
|
|
|
|
byte server[4] = {192,168,1,10}; //Ip address of iot server
|
|
|
|
byte deviceIP[4] = { 192, 168, 43,11 }; //Ststic ip address of arduino
|
|
|
|
byte deviceIP[4] = { 192, 168, 1,110 }; //Ststic ip address of arduino
|
|
|
|
|
|
|
|
|
|
|
|
byte dns2[] = { 8, 8, 8, 8 }; //Ststic dns of arduino
|
|
|
|
byte dns2[] = { 8, 8, 8, 8 }; //Ststic dns of arduino
|
|
|
|
byte subnet[] = { 255, 255, 255, 0 }; //Ststic subnet of arduino
|
|
|
|
byte subnet[] = { 255, 255, 255, 0 }; //Ststic subnet of arduino
|
|
|
|
byte gateway[] = { 192, 168, 43, 1 }; //Ststic gateway of arduino
|
|
|
|
byte gateway[] = { 192, 168, 1, 1 }; //Ststic gateway of arduino
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String host, jsonPayLoad, replyMsg, endPoint;
|
|
|
|
String host, jsonPayLoad, replyMsg;
|
|
|
|
String responseMsg, subStrn;
|
|
|
|
String responseMsg, subStrn;
|
|
|
|
double cpuTemperature =0;
|
|
|
|
double cpuTemperature = 0;
|
|
|
|
static unsigned long pushTimestamp = 0;
|
|
|
|
static unsigned long pushTimestamp = 0;
|
|
|
|
static unsigned long pollTimestamp = 0;
|
|
|
|
static unsigned long pollTimestamp = 0;
|
|
|
|
|
|
|
|
char charBuf[10];
|
|
|
|
|
|
|
|
String payLoad;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|