Code Monkey home page Code Monkey logo

Comments (1)

uhi22 avatar uhi22 commented on July 17, 2024

The quickfix above has the drawback, that it allows immediate transmission after sleep. For the case, that the avail time is intentionally more in the future, this would lead to a too-early transmit. I propose a more complete solution, which consists of two steps: 1. after sleep, add the sleep time to the timer, to keep track of the real elapsed time. This was proposed in https://www.thethingsnetwork.org/forum/t/lmic-plus-rfm95w-staying-awake-for-long-periods/7506/44
The hacky version for 8 seconds arduino-sleep:
//Give the AVR back the slept time back (simple version)
cli();
timer0_overflow_count += 8 * 64 * clockCyclesPerMicrosecond(); //give back 8 seconds of sleep
sei();
os_getTime(); /* VERY IMPORTANT after sleep to update os_time and not cause txbeg and
os_time out of sync which causes send delays with the RFM95 on and eating power */

Step 2: Make sure, that the avail-variables do not run too much into the past. Pseudocode: if avail is in the past, then avail = now. I referenced my bugfix proposal in #934.

from arduino-lmic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.