Skip to content

Low Power #20

@robgil

Description

@robgil

Hey Folks

I have been working on getting LoRaLayer2 working for the purposes of sending sensor data. I'm very excited to have a mesh solution that will have the ability to resolve the line to sight issues of other technologies. As a result, I'm trying to get my sensors to go in to deep sleep. One issue that I keep running in to is that messages that are in the buffer when it goes to sleep are not sent.

Pseudo code

void setup() {
  esp_sleep_enable_timer_wakeup(5 * 10000); //microseconds to seconds
  // Do all the other LoRaLayer2 setup
}

void loop() {
  LL2->daemon();
  // send packets blah blah sensor data blah
  // Ok, done prepping and adding packets to the buffer to send, now time for sleeping
  esp_deep_sleep_start();
}

Whenever I have esp_deep_sleep_start() set, it seems to immediately stop whatever the LL2->daemon() is doing. I'm thinking this is doing a hard stop and not letting LL2 flush the packets.

I'm thinking we need 2 things.

  • A way to check how many messages are in the packet buffer. c++ is not my first language (:laughing:), but it doesn't seem like I can access the struct to see how many packets are queued.
  • A way to flush the queue which will block until complete. This isn't as necessary as the first thing since we can just tell it to wait until its empty and not enqueue anything else.

Note, that this is specific for sensors. I'm thinking relay nodes will need to be active almost all the time, or at some sort of regular interval that both sender and receiver are both active at the same time.

Curious to hear your thoughts. I know this is outside of what LoRaLayer2 was originally designed for, but conceptually its awesome! (and can be applied to other problems)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions