Skip to content

Commit

Permalink
update Air_Temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
andyduino committed Aug 23, 2015
1 parent 847e3b0 commit e0b6e83
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions MQTT-for-SIM900/MQTT-for-SIM900.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
modified for IOC parameters
disabled GPS for simplicity
sending "static" information for simplicity
----
connect arduino to mqtt broker via gprsbee(sim800h module)
sesor:
A0: AM2301
A2: thermistor
*/


Expand Down Expand Up @@ -112,10 +119,10 @@ void loop(){
clientID, IP, Port, Topic, Message
*/
sendMQTTMessage("agrinode", "iot.eclipse.org", "1883", "agrinode01",jsonStr);
}//and of for
}//and of if

delay(10000);
//}
//} //end of for

while(1);
}
Expand Down Expand Up @@ -289,21 +296,22 @@ String buildJson() {
data+="\n";
data+="\"myName\": \"Agrinode_01\",";
data+="\n";
data+="\"Air Temperature\": ";
data+="\"Air_Temperature\": ";
data+=(float)Air_Temp;
data+= ",";
data+="\n";

data+="\"Air Humidity\": ";
data+="\"Air_Humidity\": ";
data+=(float)Air_Humidity;
data+= ",";
data+="\n";

data+="\"Water Temperature\": ";
data+="\"Water_Temperature\": ";
data+=(float)Water_Temp;
data+="\n";
data+="}";
data+="\n";
data+="}";
return data;
}

0 comments on commit e0b6e83

Please sign in to comment.