Dht11 cannot read temp and humidity on Lora shield gps

Hi,
Im new in this Lora Technology. Im sorry If my question was basic. so Im from Indonesia which is have a bit Lora Technology expertise.

MY PROBLEM
I build a single channel gateway with rpi + Lora GPS/HAT as a gateway and arduino+Lora GPS Shield as a node. trying to transmitting the temperature & humidity using dht11. my code on this github Lora dht11. and I take the example on this web wiki dragino
and will show the data humidity and temperature to cayenne mydevice.
my problem is, the sensor dht11 cannot appear on the serial monitor(try on first monitoring), and in the ttn. it always nan or 0,00%.

My Question

  • is it related with the code hex in static uint8_t mydata[22] ?
    `

static uint8_t mydata[22] = {0x06,0x67,0x00,0x00,0x02,0x68,0x00,0x03,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x65,0x00,0x00};

`
because I take that hex from this ttn_mydevice.

  • is it any wrong code with the dht11 library on it ?
  • if I add sensor GY-906 Infrared Temperatur Sensor MLX90614 ESF for contacless temperature sensor. what should I add for the code? static uint8_t mydata[] is probably add again with the differen code hex ?

Background
I build a monitoring and detection forest fires using Lora Technology. so Im using temperature sensor. with 2 nodes. for now I still trying to read sensor dht11 with 1 node first. if it can read and monitoring, I will trying to dual channel gateway. :slight_smile:

please help on my project…

Back to basics, ignore the LoRa stuff for now.

Can you confirm that, with a simple program, and no LoRa device code involved, you can read the DHT11 sensor and print the results to the serial monitor ?

Hi @LoRaTracker.
Yes I already tried to do that. Everything normal. I think its wrong with the pin dht11 which it has a digital pin but the example to analog pin. When I tried with a simple program to run the sensor using analog pin, it can read to the serial monitor. And when I back to the code using Lora, it can’t.

Your code will only even attempt to read from the DHT11 if do_send() is called when OP_TXRXPEND is unset. In practice, that flag can often get stuck on in LMiC for various reasons.

What sort of output are you seeing from the sketch?

Likely you should add additional logging to see when do_send() is called at all, see which path it takes, see if your dhtTem() function is called at all, and if it exists with a success

Attempting to read from a GPS with software serial could also be causing problems, though it looks like maybe you aren’t actually calling that in the current version.

Hi @cslorabox,

here is the output.

test%20arduino .

you seem to have commented out all calls to dht.begin()

in where I add that code?
after

#define

or in the

void setup() {

?

Wherever you would usually put it if you were not using LoRaWAN, setup() isn’t a bad guess