Author Topic: ListenMode with ESP32, issues.  (Read 436 times)

ReNNo

  • Newbie
  • *
  • Posts: 3
ListenMode with ESP32, issues.
« on: June 19, 2020, 12:06:17 PM »
Hello all,

I'm using this library to enable communication between AVR and ESP32. It currently works as following:

NODE (can be multiple devices):
  • AtMega328 wakes up every 60 minutes and reads sensors data
  • AtMega328 sends data over RFM69HW and goes to sleep

GATWAY:
  • ESP32 is in light sleep and RFM69HW is in Rx mode
  • If data is received by RFM69, ESP32 will wake up by DIO0 pin and received data will be stored in ESP32

This works very reliably but I want to make gateway to be solar powered. If RFM69 consumes 16mA all the time it will require pretty large solar panel and multiple 18650 batteries. My goal is to modify current project to work in "Listen mode". This will greatly reduce power consumption.

In this approach everything should be working as described previously. Only difference is that node will send data by "listenModeSendBurst" method and gateway will go to Listen Mode before ESP32 goes to sleep (by calling listenModeStart).

Thanks to @Felix for merging "ListenMode" branch to "master" branch. I successfully tested this approach between two ATMEGA328 boards and it is working properly.
But when I use ESP32 as gateway it is not working as it should. When node sends data by "listenModeSendBurst" ESP32 wakes up correctly but data is not received.
For testing purposes I'm using ListenMode_Master and ListenMode_Node sketches.

Any idea what can cause these problems?

ReNNo

  • Newbie
  • *
  • Posts: 3
Re: ListenMode with ESP32, issues.
« Reply #1 on: June 22, 2020, 05:42:29 PM »
UPDATE:
Looks like "Light Sleep" of ESP32 is causing this problem. If I don't put ESP32 in "Light Sleep" and do something like following:
Code: [Select]
radio.listenModeStart();    
delay(5000);

If burst is sent during this delay I can successfully receive message in "Listen Mode".

Any ideas what can go wrong after ESP32 wakes up from light sleep?


ReNNo

  • Newbie
  • *
  • Posts: 3
Re: ListenMode with ESP32, issues.
« Reply #2 on: July 24, 2020, 02:46:06 AM »
UPDATE2:
Looks like ESP32 never triggers interrupt after it wakes up from LightSleep.
To solve this, I'm calling "listenModeIrq" manually just after it wakes up from sleep and it is working fine.