diff --git a/modules/distribution/src/sketches/sensebot/PushData.ino b/modules/distribution/src/sketches/sensebot/PushData.ino index b670c8a8..6d59c56f 100644 --- a/modules/distribution/src/sketches/sensebot/PushData.ino +++ b/modules/distribution/src/sketches/sensebot/PushData.ino @@ -21,13 +21,13 @@ void pushData(){ payLoad += "\"}"; pushClient.fastrprint(F("POST ")); - pushClient.fastrprint(SERVICE_EPOINT); pushClient.fastrprint(F("pushsensordata")); + pushClient.fastrprint(SERVICE_EPOINT); pushClient.fastrprint(F("pushsensordata")); pushClient.fastrprint(F(" HTTP/1.1")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(host.c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("Content-Length: ")); - int payLength = jsonPayLoad.length() + payLoad.length(); + int payLength = jsonPayLoad.length() + payLoad.length() + 2; pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\n")); @@ -67,7 +67,7 @@ void pushData(){ } } - pushClient.fastrprint(F("\n")); + pushClient.fastrprint(F("\r\n")); if(DEBUG) Serial.println(); delay(1000); diff --git a/modules/distribution/src/sketches/sensebot/SenseBotEthernetAgent.h b/modules/distribution/src/sketches/sensebot/SenseBotEthernetAgent.h index 6c51a03e..7d46182f 100644 --- a/modules/distribution/src/sketches/sensebot/SenseBotEthernetAgent.h +++ b/modules/distribution/src/sketches/sensebot/SenseBotEthernetAgent.h @@ -21,11 +21,18 @@ #define DEVICE_OWNER "${DEVICE_OWNER}" #define DEVICE_ID "${DEVICE_ID}" -#define SERVICE_PORT 9763 -#define SERVICE_EPOINT "/iotdevices/SenseBotController/" - // pushalarmdata - application/json - {"owner":"","deviceId":"","replyMessage":"","time":"","key":"","value":""} - // readcontrols/{owner}/{deviceId} - // reply - application/json - {"owner":"","deviceId":"","replyMessage":""} +/********************************************************************************************** + The following two parameters are used when pushing data via the API in the API Manager + ***********************************************************************************************/ +#define SERVICE_PORT 8281 +#define SERVICE_EPOINT "/sensebotdata/1.0/controller/" + +/********************************************************************************************** + Use the following two parameters when pushing data directly to the JAX-RS Service + ***********************************************************************************************/ +//#define SERVICE_PORT 9763 +//#define SERVICE_EPOINT "/sensebot/controller/" + #define BUZZER A0 #define LDR_PIN A1 #define TEMP_PIN A2 diff --git a/modules/distribution/src/sketches/sensebot_wifi/PushData.ino b/modules/distribution/src/sketches/sensebot_wifi/PushData.ino index 7aacaae6..6d59c56f 100644 --- a/modules/distribution/src/sketches/sensebot_wifi/PushData.ino +++ b/modules/distribution/src/sketches/sensebot_wifi/PushData.ino @@ -27,7 +27,7 @@ void pushData(){ pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("Content-Length: ")); - int payLength = jsonPayLoad.length() + payLoad.length(); + int payLength = jsonPayLoad.length() + payLoad.length() + 2; pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\n")); @@ -67,7 +67,7 @@ void pushData(){ } } - pushClient.fastrprint(F("\n")); + pushClient.fastrprint(F("\r\n")); if(DEBUG) Serial.println(); delay(1000); diff --git a/modules/distribution/src/sketches/sensebot_wifi/SenseBotWifiAgent.h b/modules/distribution/src/sketches/sensebot_wifi/SenseBotWifiAgent.h index 9e37451d..7fce96d6 100644 --- a/modules/distribution/src/sketches/sensebot_wifi/SenseBotWifiAgent.h +++ b/modules/distribution/src/sketches/sensebot_wifi/SenseBotWifiAgent.h @@ -21,12 +21,18 @@ #define DEVICE_OWNER "${DEVICE_OWNER}" #define DEVICE_ID "${DEVICE_ID}" +/********************************************************************************************** + The following two parameters are used when pushing data via the API in the API Manager + ***********************************************************************************************/ #define SERVICE_PORT 8281 #define SERVICE_EPOINT "/sensebotdata/1.0/controller/" - // pushalarmdata - application/json - {"owner":"","deviceId":"","replyMessage":"","time":"","key":"","value":""} - // readcontrols/{owner}/{deviceId} - // reply - application/json - {"owner":"","deviceId":"","replyMessage":""} +/********************************************************************************************** + Use the following two parameters when pushing data directly to the JAX-RS Service + ***********************************************************************************************/ +//#define SERVICE_PORT 9763 +//#define SERVICE_EPOINT "/sensebot/controller/" + #define BUZZER A0 #define LDR_PIN A1 #define TEMP_PIN A2