there!
I'm participating in a school project in which we need to check the temperature with Arduino and DTH22 sensor. If the temperature is above a specified value (Celsius degrees is being used), the fan is activated. So far, so good. It works! But now the teacher is asking to use Zabbix (which I'm getting to know just now) to remotely collect the temperature data.
I've digged a lot, but haven't found any answer to that, only partial explanations about Zabbix, which I don't undestand very well so far. All codes that involve Zabbix are very confusing to me...
If someone could help me how to configure Zabbix with SNMP and which code lines should I add to my Arduino code in order to send Zabbix the data, I would be very thankful!
Here's the code I have (which works, without Zabbix):
#include"DHT.h"
#define DHTPIN A0
#define DHTTYPE DHT22
#define tLim 20.6
DHT dht(DHTPIN, DHTTYPE);
int rele=2;
void setup() {
Serial.begin(9600);
dht.begin();
pinMode(rele,OUTPUT);
digitalWrite(rele,HIGH);
}
void loop() {
float u=dht.readHumidity();
float t=dht.readTemperature();
if (isnan(t)||isnan(u))
{
Serial.println("Erro na leitura");
return;
}else
{
Serial.print("Temperatura: ");
Serial.print(t);
Serial.print(" \xC2\xB0");
Serial.println("C");
Serial.print("Umidade: ");
Serial.print(u);
Serial.println("%");
Serial.println();
delay(2000);
}
//turns fan on if temperature is reached
if(t>=tLim)
{
digitalWrite(rele,LOW);
}else
{
digitalWrite(rele,HIGH);
}
}