{
dallas_sensors.requestTemperatures();
float tempC = dallas_sensors.getTempC(deviceAddress);
- Serial.print("Temp C: ");
+ //Serial.print("Temp C: ");
Serial.println(tempC TEMPC_OFFSET_ARDUINO_GENEREATED_HEAT);
//Serial.print(" Temp F: ");
//Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
void printLightLevel()
{
- Serial.print("Photo: ");
+ //Serial.print("Photo: ");
Serial.println(light_level_mean_);
}
char *cmd;
if (size >= 8 && strncmp("movement", buffer, 8) == 0)
return 1;
-
- if (size > 16 && strncmp("temp0:", buffer, 5) == 0)
+ else if (size > 15 && strncmp("temp0: Temp C:", buffer, 14) == 0)
{
if (asprintf(&cmd, "rrdtool update %s -t temp N:%s", rrd_temp_, buffer + 15))
{
free(cmd);
}
}
-
- if (size > 16 && strncmp("photo0:", buffer, 6) == 0)
+ else if (size > 7 && strncmp("temp0:", buffer, 6) == 0)
+ {
+ if (asprintf(&cmd, "rrdtool update %s -t temp N:%s", rrd_temp_, buffer + 7))
+ {
+ /*printf("%s\n",cmd);*/
+ system(cmd);
+ free(cmd);
+ }
+ }
+ else if (size > 15 && strncmp("photo0: Photo:", buffer, 14) == 0)
{
if (asprintf(&cmd, "rrdtool update %s -t light N:%s", rrd_light_, buffer + 15))
{
free(cmd);
}
}
+ else if (size > 8 && strncmp("photo0:", buffer, 7) == 0)
+ {
+ if (asprintf(&cmd, "rrdtool update %s -t light N:%s", rrd_light_, buffer + 7))
+ {
+ /*printf("%s\n",cmd);*/
+ system(cmd);
+ free(cmd);
+ }
+ }
return 0;
}