Wisblock. bme.performReading()

I am using Wisblock 4631 with the Environment sensor. Its been working like a charm but all of a sudden the environment sensor stopped working.

I traced the code down to this specific line in the Enviro_logging Wisblock sample

if (!bme.performReading()) {
return 0;
}

It just hangs here at the bme.performReading(). When I comment trap out, it starts working. (but 0 values for temp, humidity, etc).

I moved the environment sensor to a different slot (slot B), but still hanging.

Could this be a fried environment sensor? What would cause the script to hang at the bme.performReading()? (I uncommented out the return 0 so it definitely is hanging there,

Any ideas on what else I can try?

Hi @garrywh
It looks for me like a defect RAK1906. I have seen such hanging application problems when the I2C communication is not working (I2C slave does not response).

Does the I2C code have any timeout?

I’ve found that’s important in sensor projects - things deployed in the field can end up with piecemeal failures so it’s useful to have a node which can keep running even when one of its measurements is reporting failure or stuck at an implausible/unchanging value.

That said, there are types of I2C failures which will create accelerated battery drain. Still, it’s better to have a node that puts out packets that contain the information that is available, and hint at the failure, rather than one that simply ceases transmitting.

The lower level I2C communication is in the Adafruit BSP for the nRF52 (we just add our RAK4631 to their BSP) and there are some while() loops without any timeout check. => Adafruit_nRF52_Arduino/Wire_nRF52.cpp at 10ed826056f9c0b3079129a3ec37c3a90ecb0585 · adafruit/Adafruit_nRF52_Arduino · GitHub

It might be that in the Nordic SDK these events are secured with a timeout, but my experience is as well that the whole MCU hangs when something goes wrong in the I2C communication.

Thanks for the replies folks. I ended up re-creating the sketch from scratch and the problem went away. It seems like Arduino does not like incrementing global variables or something like that. Once I removed a ++g_frame_no in the send_lora_frame the problem went away.

Happy to hear that the sensor is alive.