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. Development
  3. RFM95 Sleep Mode

RFM95 Sleep Mode

Scheduled Pinned Locked Moved Development
6 Posts 2 Posters 3.0k Views 1 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.
  • L Offline
    L Offline
    lafleur
    wrote on last edited by lafleur
    #1

    I noticed that the RFM95 driver has function to put the radio to sleep...
    do I need to check anything else prior to the call?

    LOCAL bool RFM95_sleep(void);
    

    what is required to re-awake the radio after this function is called...
    do I just set the mode back to RX or Standby?
    Any delays needed to awake the radio?

    also, why is it tagged as LOCAL? is it not intended to be used in project code??

    Using an M0 processor 2.1 code base

    Thanks

    1 Reply Last reply
    0
    • scalzS Offline
      scalzS Offline
      scalz
      Hardware Contributor
      wrote on last edited by
      #2

      better use transportinit and transportpowerdown.

      LOCAL is simply a define for static ;)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lafleur
        wrote on last edited by lafleur
        #3

        As the sleep function are NOT implemented yet for the M0 SAMD processor in MyHwSAMD.ccp, is using transportinit and transportpowerdown the proper way to allow the core to shut down the radio to sleep and re awake??

        I ask because I do not see this being done in the MyHwATMega328.cpp sleep functions...

        My goal it to cut power down to a minimum with the M0 processor ...

        1 Reply Last reply
        0
        • scalzS Offline
          scalzS Offline
          scalz
          Hardware Contributor
          wrote on last edited by scalz
          #4

          yep but you asked the proper way to shutdown and reinit the radio ;)
          so imho the proper way is using the transport layer function as they include the settings in transportinit for example.
          for transportpowerdown sure it does not change a lot. but it's better for habits, depending on the use.

          for atsam, or 328p, sleep modes this is about the hardware layer, so the corresponding functions.
          regarding atsam, for the moment, you need to write your own sleep functions. and use the transport layer for radio.
          i know there are still some stuff in arduino core too about this, you can also use rocketstream lib for sleep modes.
          or you can also do a PR if you've done something https://www.mysensors.org/download/contributing :)

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lafleur
            wrote on last edited by lafleur
            #5

            Thanks...

            I'm using RocketStream lib. LowPower sleep for now...

            when I wake up, I get some messages from the TSF, not sure what they are telling me...
            it appear to not like the message it received...

            My Current Code....

            https://github.com/trlafleur/Soil_Moisture_Sensor_MS_R1.1-RFM95
            

            thanks

            *** Going to Sleep ***
            *** Wakeing From Sleep at: 17:11
            TSF:MSG:READ,0-0-76,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-1-76,s=255,c=3,t=0,pt=1,l=5,sg=0:1
            !TSF:MSG:LEN,4!=12
            TSF:MSG:READ,0-2-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-3-76,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-4-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-5-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-6-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-7-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
            !TSF:MSG:LEN,4!=32
            TSF:MSG:READ,0-9-76,s=255,c=3,t=0,pt=1,l=5,sg=0:1
            !TSF:MSG:LEN,4!=12
            TSF:MSG:READ,0-10-75,s=255,c=3,t=0,pt=1,l=5,sg=0:1
            !TSF:MSG:LEN,4!=12
            *** Going to Sleep ***
            
            L 1 Reply Last reply
            0
            • L lafleur

              Thanks...

              I'm using RocketStream lib. LowPower sleep for now...

              when I wake up, I get some messages from the TSF, not sure what they are telling me...
              it appear to not like the message it received...

              My Current Code....

              https://github.com/trlafleur/Soil_Moisture_Sensor_MS_R1.1-RFM95
              

              thanks

              *** Going to Sleep ***
              *** Wakeing From Sleep at: 17:11
              TSF:MSG:READ,0-0-76,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-1-76,s=255,c=3,t=0,pt=1,l=5,sg=0:1
              !TSF:MSG:LEN,4!=12
              TSF:MSG:READ,0-2-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-3-76,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-4-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-5-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-6-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-7-75,s=255,c=3,t=0,pt=1,l=4,sg=1:1
              !TSF:MSG:LEN,4!=32
              TSF:MSG:READ,0-9-76,s=255,c=3,t=0,pt=1,l=5,sg=0:1
              !TSF:MSG:LEN,4!=12
              TSF:MSG:READ,0-10-75,s=255,c=3,t=0,pt=1,l=5,sg=0:1
              !TSF:MSG:LEN,4!=12
              *** Going to Sleep ***
              
              L Offline
              L Offline
              lafleur
              wrote on last edited by lafleur
              #6

              @lafleur

              I have been using the transportinit() and transportpowerdown(), as suggested and it has been working fine if I was just sending data...

              But when I needed to receive data from the controller, I was never receiving any data from the controller, even if I allowed a RX window of 20 sec or more.

              On Wake up, If I remove the call to transportinit(), all work fine again... TX and RX work just fine...

              What going on here?? Why is system working without the need to call transportinit() as you suggested.

              using a SAMD processor M0
              IDE 1.8.1
              MySensor 2.1.1

              My current code base:

              https://github.com/trlafleur/Soil_Moisture_Sensor_MS_R1.1-RFM95
              
              /* **************** System Sleep ******************* */
              void systemSleep()
              {
                  debug1(PSTR("\n*** Going to Sleep ***\n"));
                  wait (100);
                  // put led's, radio and flash to sleep
                  // Turn off LED's
                  // Put Flash to sleep
                  // Put Radio and transport to Sleep
                  transportPowerDown();              // Shut down radio and MySensor transport
                  
                  interrupts();                      // make sure interrupts are on...
                  LowPower.standby();                // SAMD sleep from LowPower systems
                  
                     //  .... we will wake up from sleeping here if triggered from an interrupt
                  interrupts();                       // make sure interrupts are on...                                      
              }
              
              /* **************** System Wake-up from Sleep ******************* */
              void systemWakeUp() 
              {                                          
                  
                  //  re enable LED's if needed
                  // wake up Flash if needed
              
                  // wake up MySensor transport and Radio from Sleep
                  //transportInit();
                                            // as MySensor had NO sleep or Watch Dog for SAMD, this will
                                                      // wake us up so that we can send and receive messages
                  while (!isTransportReady()) {       // Make sure transport is ready
                  _process(); 
                  interrupts();                       // make sure interrupts are on...
              }
              
              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              17

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              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