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. No Sleep is driving me crazy!

No Sleep is driving me crazy!

Scheduled Pinned Locked Moved Troubleshooting
11 Posts 4 Posters 2.4k Views 4 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.
  • skywatchS skywatch

    I folloed the api and have done what I believe to be correct, but obviously isn't as I get a compile warning.

    So why does this fail to work at the end of the loop?

     int8_t sleep(int 1, int FALLING, unsigned long SLEEP_TIME);
    

    See here for api instructions I followed.... https://www.mysensors.org/download/sensor_api_20#sleeping

    Thanks for any pointers here.....

    mfalkviddM Offline
    mfalkviddM Offline
    mfalkvidd
    Mod
    wrote on last edited by
    #2

    @skywatch what is the return value of the sleep function?
    Are you perhaps using an esp8266?

    1 Reply Last reply
    0
    • skywatchS skywatch

      I folloed the api and have done what I believe to be correct, but obviously isn't as I get a compile warning.

      So why does this fail to work at the end of the loop?

       int8_t sleep(int 1, int FALLING, unsigned long SLEEP_TIME);
      

      See here for api instructions I followed.... https://www.mysensors.org/download/sensor_api_20#sleeping

      Thanks for any pointers here.....

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #3

      @skywatch and, as always, which mySensors version are you using...

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by skywatch
        #4

        I am using mysensors 2.1.1 which I believe is the latest one.

        But I get a compiler error with arduino IDE 1.8.3 when I add the line exactly as shown above. I have treid various combinations to try and solve the issue, but that's as far as I can get.

        It might be a library issue as I had that earlier this week! Here is the error output as it appears after compilation check

        C:\Users\captain\Documents\Arduino\MYS-Cinema-0.1\MYS-Cinema-0.1.ino: In function 'void loop()':
        
        MYS-Cinema-0.1:130: error: expected ',' or '...' before numeric constant
        
           int8_t smartSleep(int 1, int FALLING, unsigned long ms=27000);
        
                                 ^
        
        Multiple libraries were found for "SPI.h"
         Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\SPI
         Not used: C:\Users\captain\Documents\Arduino\libraries\SPI
        Multiple libraries were found for "Wire.h"
         Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\Wire
         Not used: C:\Users\captain\Documents\Arduino\libraries\Wire
        exit status 1
        expected ',' or '...' before numeric constant
        

        The set up is pro-mini with htu21DF, NRF24L01+, Door sensor.

        You might see what the problem is from that!

        Thanks for your time.

        YveauxY mfalkviddM 2 Replies Last reply
        0
        • skywatchS skywatch

          I am using mysensors 2.1.1 which I believe is the latest one.

          But I get a compiler error with arduino IDE 1.8.3 when I add the line exactly as shown above. I have treid various combinations to try and solve the issue, but that's as far as I can get.

          It might be a library issue as I had that earlier this week! Here is the error output as it appears after compilation check

          C:\Users\captain\Documents\Arduino\MYS-Cinema-0.1\MYS-Cinema-0.1.ino: In function 'void loop()':
          
          MYS-Cinema-0.1:130: error: expected ',' or '...' before numeric constant
          
             int8_t smartSleep(int 1, int FALLING, unsigned long ms=27000);
          
                                   ^
          
          Multiple libraries were found for "SPI.h"
           Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\SPI
           Not used: C:\Users\captain\Documents\Arduino\libraries\SPI
          Multiple libraries were found for "Wire.h"
           Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\Wire
           Not used: C:\Users\captain\Documents\Arduino\libraries\Wire
          exit status 1
          expected ',' or '...' before numeric constant
          

          The set up is pro-mini with htu21DF, NRF24L01+, Door sensor.

          You might see what the problem is from that!

          Thanks for your time.

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #5

          @skywatch start by upgrading to development branch (2.2.0 beta) as sleep and interrupts is broken in 2.1.x

          http://yveaux.blogspot.nl

          1 Reply Last reply
          0
          • skywatchS skywatch

            I folloed the api and have done what I believe to be correct, but obviously isn't as I get a compile warning.

            So why does this fail to work at the end of the loop?

             int8_t sleep(int 1, int FALLING, unsigned long SLEEP_TIME);
            

            See here for api instructions I followed.... https://www.mysensors.org/download/sensor_api_20#sleeping

            Thanks for any pointers here.....

            rozpruwaczR Offline
            rozpruwaczR Offline
            rozpruwacz
            wrote on last edited by
            #6

            @skywatch are you trying to compile this piece of code:
            int8_t sleep(int 1, int FALLING, unsigned long SLEEP_TIME);

            ?
            because this is not a valid c code ...

            1 Reply Last reply
            0
            • skywatchS skywatch

              I am using mysensors 2.1.1 which I believe is the latest one.

              But I get a compiler error with arduino IDE 1.8.3 when I add the line exactly as shown above. I have treid various combinations to try and solve the issue, but that's as far as I can get.

              It might be a library issue as I had that earlier this week! Here is the error output as it appears after compilation check

              C:\Users\captain\Documents\Arduino\MYS-Cinema-0.1\MYS-Cinema-0.1.ino: In function 'void loop()':
              
              MYS-Cinema-0.1:130: error: expected ',' or '...' before numeric constant
              
                 int8_t smartSleep(int 1, int FALLING, unsigned long ms=27000);
              
                                       ^
              
              Multiple libraries were found for "SPI.h"
               Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\SPI
               Not used: C:\Users\captain\Documents\Arduino\libraries\SPI
              Multiple libraries were found for "Wire.h"
               Used: C:\Program Files (x86)\Arduino1.8.3\hardware\arduino\avr\libraries\Wire
               Not used: C:\Users\captain\Documents\Arduino\libraries\Wire
              exit status 1
              expected ',' or '...' before numeric constant
              

              The set up is pro-mini with htu21DF, NRF24L01+, Door sensor.

              You might see what the problem is from that!

              Thanks for your time.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #7

              @skywatch try changing to

              int8_t sleepReturn = smartSleep(1, FALLING, 27000);
              Serial.println(sleepReturn);
              
              1 Reply Last reply
              0
              • skywatchS Offline
                skywatchS Offline
                skywatch
                wrote on last edited by
                #8

                Do I replace 2.1.1 with dev or add it over the top? The contents are different comparing the two.

                And can someone please add this 'broken' bit to the API so others don't waste hours of their time too.

                1 Reply Last reply
                0
                • skywatchS Offline
                  skywatchS Offline
                  skywatch
                  wrote on last edited by skywatch
                  #9

                  @mfalkvidd

                  Thanks this does compile OK (the value of examples) - But wiil it work as expected if sleep is broken in 2.1.1?

                  int8_t smartSleep(1, FALLING, 27000); 
                  

                  Also, is this all that is needed for the interrupt to work or do I need to declare it as I would in an arduino sketch?

                  thanks

                  1 Reply Last reply
                  0
                  • skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote on last edited by
                    #10

                    Secret then is it?

                    mfalkviddM 1 Reply Last reply
                    0
                    • skywatchS skywatch

                      Secret then is it?

                      mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #11

                      @skywatch I think you are confusing "secret" with "unknown".

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


                      26

                      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