Hello Blynkers,
My project runs for some 3 minutes, then it belly up! It does the same running in a “local” (“local” means a cloud server running Ubuntu latest release) server. I’m using the Mega2560 together with an Ethernet shield, Ethernet library updated It does the same using an ESP8266.
UPDATE: Issue resolved, a sensor was the problem.
Here is the sketch, I retouched it a little bit, the Mega2560 is a happy camper. I will post the library and some instructions if someone want to play around with the HIH6130 weather sensor.
/**************************************************************
*
* HIH6130 WX Sensors
* Author: Alex Rodriguez
* Reviewed: March 27, 2016
*
**************************************************************/
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>
SimpleTimer timer;
#include <Wire.h>
#include <A_HIH6130.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxx";
//============== HIH6130 Entries ==================
// Define the addresseses used by the HIH6130s
byte address1 = 0x29; HIH6130 hih6130_1(address1); // Master Bedroom Sensor
byte address2 = 0x27; HIH6130 hih6130_2(address2); // Backyard Sensor
void setup()
{
Serial.begin(115200);
Blynk.begin(auth);
// =========={ Initialize the HIH6130s }============================
hih6130_1.begin(); // Initialize the HIH6130
hih6130_2.begin(); // Initialize the HIH6130
// Functions to be called every 3 seconds
timer.setInterval(3000L, virtualPins);
timer.setInterval(3000L, masterBedroom);
timer.setInterval(3000L, backYard);
}
// ======================{ FUNCTIONS BEGIN HERE }=====================
void masterBedroom() // Master Bedroom Sensor
{
hih6130_1.readSensor(); //HIH6130 print data to the serial port.
Serial.println();
Serial.print("Master Bedroom Temp :");Serial.println(hih6130_1.temperature_F);
Serial.print("Master Bedroom Humidity :");Serial.println(hih6130_1.humidity);
Serial.print("Master Bedroom Heat Index :");Serial.println(hih6130_1.computeHeatIndex_F());
Serial.print("Master Bedroom Dew Point :");Serial.println(hih6130_1.dewPoint());
}
void backYard() // Backyard Sensor
{
hih6130_2.readSensor();//HIH6130 print data to the serial port
Serial.println();
Serial.print("Backyard Bedroom Temp :");Serial.println(hih6130_2.temperature_F);
Serial.print("Backyard Humidity :");Serial.println(hih6130_2.humidity);
Serial.print("Backyard Heat Index :");Serial.println(hih6130_2.computeHeatIndex_F());
Serial.print("BackYard Dew Point :");Serial.println(hih6130_2.dewPoint());
}
void virtualPins()
{
hih6130_1.readSensor(); // Master Bedroom Sensor
hih6130_2.readSensor(); // Backyard Sensor
//================{ Master Bedroom Sensor }==========================
Blynk.virtualWrite(1, hih6130_1.temperature_F); // Master Bedroom Temperature in F
Blynk.virtualWrite(2, hih6130_1.humidity); // Master Bedroom Humidity
Blynk.virtualWrite(3, hih6130_1.computeHeatIndex_F()); // Master Bedroom Heat Index
Blynk.virtualWrite(4, hih6130_1.dewPoint()); // Master Bedroom DewPoint in F
Blynk.virtualWrite(5, hih6130_1.temperature_F); // Master Bedroom Temperature - Graph
Blynk.virtualWrite(6, hih6130_1.humidity); // Master Bedroom Humidity - Graph
//================{ BackYard Sensor }================================
Blynk.virtualWrite(7, hih6130_2.temperature_F); // Backyard Temperature in F
Blynk.virtualWrite(8, hih6130_2.humidity); // Backyard Humidity
Blynk.virtualWrite(9, hih6130_2.computeHeatIndex_F()); // Backyard Heat Index in F
Blynk.virtualWrite(10, hih6130_2.dewPoint()); // Backyard DewPoint
}
void loop()
{
Blynk.run();
timer.run();
}