Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dfrozen authored Feb 18, 2018
1 parent 9585373 commit 338bdc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions dht_PZEM_8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const char* ssid = "Bestoloch";
const char* password = "511794sinikon";

#define MQTT_SERVER "10.10.100.14" ///YourMQTTBroker'sIP
const int mqtt_port = 1883;
#define mqtt_port 1883
const char* mqtt_user="orangepi";
const char* mqtt_pass="orangepi";

ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
Expand Down Expand Up @@ -60,11 +62,11 @@ void re_connect() {
lcd.print("Wi-Fi Connecting");
Serial.print(ssid);
Serial.println("...");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
WiFi.begin(ssid, password);}
else {
delay(5000);
}
}


//make sure we are connected to WIFI before attemping to reconnect to MQTT
if(WiFi.status() == WL_CONNECTED){
Expand All @@ -74,7 +76,7 @@ void re_connect() {
lcd.clear();
lcd.print("MQTT connection...");

if (client.connect("esp8266-AD14C5","orangepi","orangepi")) {
if (client.connect("esp8266-AD14C5",mqtt_user,mqtt_pass)) {
Serial.println("MQTT Connected");
lcd.clear();
lcd.print("MQTT Connected");
Expand Down Expand Up @@ -149,12 +151,9 @@ void loop(){
lcd.print(sens[2]);
lcd.setCursor(7,1);
lcd.print("Wh:");
lcd.setCursor(10,1);
lcd.setCursor(10,1);
lcd.print(sens[3]);

client.loop();



}//void

Binary file added dht_PZEM_8266.ino.d1_mini.bin
Binary file not shown.

0 comments on commit 338bdc3

Please sign in to comment.