Giter VIP home page Giter VIP logo

Comments (9)

disk91 avatar disk91 commented on June 12, 2024

tested on Arduino MKRFOX1200

from arduinolowpower.

disk91 avatar disk91 commented on June 12, 2024

To be more precise : it works correctly if I remove power supply and restore power it. But it stops working when the device has been programmed from USB.

from arduinolowpower.

facchinm avatar facchinm commented on June 12, 2024

Hi @disk91 ,
this may depend on your operating system/USB connection; the code path in case of USB connection is quite different from the normal one.
Could you try reverting 8cf4c73 and see if the behaviour is the expected one (in your setup)?

from arduinolowpower.

sjernigan avatar sjernigan commented on June 12, 2024

We are seeing a similar problem. We also see that sometimes the first sleep call almost immediately returns.
Current Setup: Feather M0, using Mac to program/power, reverted the commit above as asked--
When powered from a battery (no data signal), the first call immediately returns, subsequent calls work correctly. Same for power by mac after unplugging. However, after you reprogram, the first call will never return. The reset button continues the previous behavior (ie., it does not change it to the unplugged/replug behavior).

from arduinolowpower.

warriorfenixSM avatar warriorfenixSM commented on June 12, 2024

I have the same problem

from arduinolowpower.

sslupsky avatar sslupsky commented on June 12, 2024

I think I have this problem as well. I think it may have something to do with the rtc. Recently I added an rtc.begin() in my setup() and this has stopped the OP’s issue from happening.

from arduinolowpower.

sslupsky avatar sslupsky commented on June 12, 2024

I found another reference to this issue:

https://forum.arduino.cc/index.php?topic=499101.0

Gormd reported that using LowPower.attachInterruptWakeup() also cleared this up. Seem's to me there is a bug here related to declaration or construction of the RTC object?

from arduinolowpower.

DanielRIOT avatar DanielRIOT commented on June 12, 2024

You could call
SerialUSB.end(); just before calling LowPower.sleep();
to stop the USB interrupts from happening and continuously waking the system

from arduinolowpower.

nekuneko avatar nekuneko commented on June 12, 2024

Hi @disk91 ,
this may depend on your operating system/USB connection; the code path in case of USB connection is quite different from the normal one.
Could you try reverting 8cf4c73 and see if the behaviour is the expected one (in your setup)?

@facchinm Is there any reason to use USBDevice.standby(); call ? I think it doesn't work in the propper way and in order to avoid issues, I would leave sleep() function simply as this:

void ArduinoLowPowerClass::sleep() {
	USBDevice.detach();
	SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
	__DSB();
	__WFI();
       USBDevice.attach();
}

If standby is used, wouldn't it be necessary to have a function to "resume" and call runInStandby() as well standby function calls noRunInStandby()?

from arduinolowpower.

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.