WiFi LoRa 32 (V3) as sensor node

Hi everyone,

I’m currently trying to use the WiFi LoRa 32 (V3) board with a CCS811 airquality sensor.
I connected SDA and SCL to pin 41/42 and get the sensor working correctly.
Unfortunately when I try to send the sensordata via LoRa to TTN it only works the first time. Afterwards I only get a payload of 00000000. In the serial monitor I get the following output:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x5 (DSLEEP),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x43c

When trying the example code (Heltec-Example LoRaWAN) the exact same thing happens…
Did I miss something in the setup?
It’s really annoying as I can see it working at the first transmission (also after a reboot via the button), so I’m hoping anyone can help or point me in the right direction.

Thank you in advance!

Add a print to see if the sensor data is normal.

Hi navi, thank you for your reply!

I added print outs to where the sensor data is gathered as well as to every device state.
Here is the output:
DEVICE_STATE_JOIN
joining…
joined
DEVICE_STATE_SEND
CO2: 414ppm, TVOC: 2
confirmed uplink sending …
DEVICE_STATE_CYCLE
DEVICE_STATE_SEND
CO2: 425ppm, TVOC: 3
confirmed uplink sending …
DEVICE_STATE_CYCLE
received unconfirmed downlink: rssi = -105, snr = -9, datarate = 4
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x5 (DSLEEP),boot:0x9 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x43c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2a3c
SHA-256 comparison failed:
Calculated: dcde8d8a4817d9bf5d5d69a7247667264e4e10ac7493514868b61f5aa6146539
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway…
entry 0x403c98d8
DEVICE_STATE_INIT
DEVICE_STATE_SEND
confirmed uplink sending …
DEVICE_STATE_CYCLE
DEVICE_STATE_SEND
CO2: 427ppm, TVOC: 4
confirmed uplink sending …
DEVICE_STATE_CYCLE
received unconfirmed downlink: rssi = -105, snr = -13, datarate = 3
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021

As you can see, the sensor is still reading the correct CO2 and TVOC data, but this data was not sent. I only received the first data (highlighted) after the failed SHA-256 comparison. I don’t receive the second sending (after DEVICE_STATE_CYCLE) where the sensor data would be transmitted, I suppose.
It looks like the error occurs every time an unconfirmed downlink is received.

Maybe you can print out the data of the array it wants to send.

Hi navi,

I added more print lines to see exactly what happens and it appears that after this odd reboot:

Attempting to boot anyway…
entry 0x403c98d8

The board cannot read the CCS811 sensor anymore (ccs is not available).
Therefore my error-message is printed:

if(ccs.available()){
    ...
}else{
    Serial.println("ERROR!")
}

So I’m not giving it any Payload therefore it is probably just filled with zeros

Try to reinitialize each reset.

Hi navi,

I think you are right, the sensor is not ready after the deepsleep of the board.
How do I reinitialize when booting out of deepsleep?

It would be nice to execute the original initialization program again every time it wakes up.