Skip to content
  • 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. Re-initialize radio after shutdown and restart
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Re-initialize radio after shutdown and restart

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 773 Views 2 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.
  • jerseyguy1996J Offline
    jerseyguy1996J Offline
    jerseyguy1996
    wrote on last edited by
    #1

    My node is battery operated and as such I allow the micro controller to shut off power to all of the peripherals including the radio before it goes to sleep. Then when it wakes up it powers up the radio and sends its data before repeating the whole process from the beginning. As such I need to initialize the radio again after I power it back up. I saw that 2.0 has a feature like this but unfortunately I'm using the PiSerialGateway which doesn't support 2.0 so I am using 1.5.4. How can I manually re-initialize the radios upon each wake cycle? I've tried doing mysensors.begin but that does the entire presentation of the node to the gateway and controller. All I want to do is initialize the radio. Below is my current loop testing this out.

    void loop()
    {
         sensor_node.send(msg.set(20));
    
         digitalWrite(PER, HIGH);    //turn off peripherals including radio
         delay(5000); // Wait 5 seconds
         digitalWrite(PER, LOW);  //turn on peripherals including radio
         
         sensor_node.begin(NULL, MY_NODE_ID);  //this doesn't work...actually does too much
    
         
    }```
    AWIA 1 Reply Last reply
    0
    • jerseyguy1996J jerseyguy1996

      My node is battery operated and as such I allow the micro controller to shut off power to all of the peripherals including the radio before it goes to sleep. Then when it wakes up it powers up the radio and sends its data before repeating the whole process from the beginning. As such I need to initialize the radio again after I power it back up. I saw that 2.0 has a feature like this but unfortunately I'm using the PiSerialGateway which doesn't support 2.0 so I am using 1.5.4. How can I manually re-initialize the radios upon each wake cycle? I've tried doing mysensors.begin but that does the entire presentation of the node to the gateway and controller. All I want to do is initialize the radio. Below is my current loop testing this out.

      void loop()
      {
           sensor_node.send(msg.set(20));
      
           digitalWrite(PER, HIGH);    //turn off peripherals including radio
           delay(5000); // Wait 5 seconds
           digitalWrite(PER, LOW);  //turn on peripherals including radio
           
           sensor_node.begin(NULL, MY_NODE_ID);  //this doesn't work...actually does too much
      
           
      }```
      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #2

      @jerseyguy1996 is it an option to leave the radio power on? It takes so little power that, unless you have a power hungry supply, there is no real reason to shut it down.

      1 Reply Last reply
      1
      • jerseyguy1996J Offline
        jerseyguy1996J Offline
        jerseyguy1996
        wrote on last edited by
        #3

        It is, I was going for maximum battery life so I was going to turn off everything while the micro controller was asleep. I'll try just using the built in sleep functionality.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        4

        Online

        11.7k

        Users

        11.2k

        Topics

        113.0k

        Posts


        Copyright 2019 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
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular