Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. How to sleep the Arduino but still have it respond to the Vera?

How to sleep the Arduino but still have it respond to the Vera?

Scheduled Pinned Locked Moved Troubleshooting
23 Posts 6 Posters 15.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    twosh
    wrote on last edited by
    #21

    Hi again!

    I've tried different approaches now with the gw.sleep(); func without success, using CHANGE, RISING or FALLING. No reaction either from tag or the Vera.

        // Wait for card/tag to leave reader    
        while(nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &key[0], &currentKeyLength)); 
        // gw.sleep(2000);
      }
      gw.sleep(0, CHANGE, 1, CHANGE, 0); // int8_t sleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mode2, unsigned long ms=0);
    }
    

    I've also tried adding this to setup();

      interrupts();
    

    as well as this:

      attachInterrupt(0, loop, CHANGE);
      attachInterrupt(1, loop, CHANGE);
    

    Nothing happens. It just continues to sleep...

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yveaux
      Mod
      wrote on last edited by
      #22

      According to the ATMega's datasheet only a Low-LEVEL interrupt can reliably wake the ATMega from sleep. See also http://forum.mysensors.org/topic/250/how-do-i-use-the-interrupt/5

      http://yveaux.blogspot.nl

      1 Reply Last reply
      1
      • T Offline
        T Offline
        twosh
        wrote on last edited by
        #23

        I'm back to choosing between no sleep, and the sleep(); function posted above. I can't get gw.sleep(); to work with either one or two interrupts, with or without declaring interrupts(); and/or attachInterrupt();.

        I'm ready to try more stuff if anyone got any ideas, but with my own limited understanding of both hardware in general and arduino in particular it feels like I'm running on fumes here. :o

        Thanks everyone for your contribution, and @hek - you've done a great job with MySensors! :clap:

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        11

        Online

        12.2k

        Users

        11.2k

        Topics

        113.4k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular