Arduino pushing data via HTTP V2

The next step is to add the photosensor and 2 DHT11 to my current humidity sensor setup.

All electronics are on a small breakout board:

Reading data from an DHT11 using an arduino is fairly simple. Library used: https://github.com/adafruit/DHT-sensor-library

Preliminaries

  • using arduino-mk

  • Arduino Linux 64bit package Version 1.0.5

Libs

A few more libs are needed

LIBS = Ethernet SPI SHT1x DHT-sensor-library
USER_LIB_PATH = ../libs/

New code added to arduino http push code:

#include "DHT.h"

// DHT11
#define DHTTYPE DHT11   // DHT 11
#define DHTPIN1 2     // pin of first DHT
#define DHTPIN2 3     // pin of second DHT

DHT dht1(DHTPIN1, DHTTYPE);
DHT dht2(DHTPIN2, DHTTYPE);


void setup()
{
  // ...

  // DHT init
  dht1.begin();
  dht2.begin();

  // ...
}

void loop()
{
  float dht1_c, dht1_h, dht2_c, dht2_h;

  if(millis() - lastConnectionTime > postingInterval) {

    // Read values from DHT11
    dht1_h = dht1.readHumidity();
    dht1_c = dht1.readTemperature();
    dht2_h = dht2.readHumidity();
    dht2_c = dht2.readTemperature();

    // ...

  }
}