MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Fitbit

    Scheduled Pinned Locked Moved Troubleshooting
    129 Posts 42 Posters 185.3k Views 37 Watching
    Loading More Posts
    • 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.
    • Sandy2503S Offline
      Sandy2503
      last edited by

      The Modul wont work on my Mirror too.
      First:
      In the moment i haven`t any Fitbit Hardware. I use the Fitbit -App on my WindowsPhone. I can see in the App all useful things like step etc. and the data will sync with the Fitbit webservce.
      I can see all activitys an the Mirror with a Zero …

      When i stop the mirror with
      pm2 stop mm and try to start the python script setupAccess.py from the local terminal so i can see this:

      //your code here
      sudo python setupAccess.py
      Get credentials from credentials.ini ? (Y/N)
      y
      {"message": "credentials.ini exists", "type": "status"}
      {"message": "Reading from crentials.ini", "type": "status"}
      {"message": "Read of credentials.ini successful.", "type": "status"}
      [19/Sep/2017:19:30:03] ENGINE Listening for SIGHUP.
      [19/Sep/2017:19:30:03] ENGINE Listening for SIGTERM.
      [19/Sep/2017:19:30:03] ENGINE Listening for SIGUSR1.
      [19/Sep/2017:19:30:03] ENGINE Bus STARTING
      CherryPY Checker:
      The Application mounted at '' has an empty config.
      
      [19/Sep/2017:19:30:03] ENGINE Started monitor thread 'Autoreloader'.
      [19/Sep/2017:19:30:03] ENGINE Started monitor thread '_TimeoutMonitor'.
      [19/Sep/2017:19:30:03] ENGINE Serving on http://127.0.0.1:8080
      [19/Sep/2017:19:30:03] ENGINE Bus STARTED
      

      and not more - and no prompt …

      when i now from a second terminal the mirror restart with pm2 restart mm
      i see on the mirror only:

      //your code here
      ```Traceback (most recent call last):
        File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 670, in respond
          response.body = self.handler()
        File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 217, in __call__
          self.body = self.oldhandler(*args, **kwargs)
        File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 67, in __call__
          raise sys.exc_info()[1]
      HTTPError: (404, `Missing parameters: state`)
      
      CherryPy 3.8.2
      

      Can anyone help me to fix the problem ?

      Greetz Sandy2503

      1 Reply Last reply Reply Quote 0
      • S Offline
        stephenmelody @s199
        last edited by

        @s199 I also have this problem, only Steps is coming through. Did you manage to get it fixed?

        1 Reply Last reply Reply Quote 0
        • S Offline
          stephenmelody
          last edited by

          This is my output of getData.py

          pi@Magic-Mirror:~/MagicMirror/modules/MMM-fitbit/python $ sudo python getData.py
          {"message": "credentials.ini exists", "type": "status"}
          {"message": "Reading from credentials.ini", "type": "status"}
          {"message": "Read of credentials.ini successful.", "type": "status"}
          {"message": "credentials.ini exists", "type": "status"}
          {"message": "Reading from credentials.ini", "type": "status"}
          {"message": "Read of credentials.ini successful.", "type": "status"}
          {"message": "tokens.ini exists", "type": "status"}
          {"message": "Reading from tokens.ini", "type": "status"}
          {"message": "Read of tokens.ini successful.", "type": "status"}
          {"message": "Making API call", "type": "status"}
          {"message": "API call okay", "type": "status"}
          {"message": "Tokens valid", "type": "status"}
          {"values": {"data": 1649, "goal": 10000}, "resource": "steps", "type": "data"}
          {"values": {"data": 0, "goal": 1}, "resource": "floors", "type": "data"}
          pi@Magic-Mirror:~/MagicMirror/modules/MMM-fitbit/python $
          
          
          1 Reply Last reply Reply Quote 0
          • pyrosmileyP Offline
            pyrosmiley
            last edited by

            For a little ways now, I’ve been running into an issue where, after running for a day or so, the module stops being able to update. It seems that it’s failing --for some odd reason-- to write the new Refresh Token, so when the Access token is expired, it needs to be re-authorized. I’ve looked through the code and I don’t know a whole lot but I cannot figure out why it’s doing what it’s doing. For now, I have this shell script set to run every night, and that seems to keep it running well enough. I’m sure there’s a better way but until I can get around to learning more, the kludgy way will do.

            #!/bin/bash
            
            export DISPLAY=:0
            pm2 stop MagicMirror
            python  ~/MagicMirror/modules/MMM-fitbit/python/setupAccess.py
            killall chromium-browser
            pm2 start MagicMirror
            
            exit 0
            

            The first line is there so that it can be run manually over SSH. I did have to log in manually once, but I just told chromium to remember me, so now I don’t have to do anything to re-grant access.

            If anyone has a better fix, I’d love to hear your thoughts!

            Sandy2503S C 2 Replies Last reply Reply Quote 0
            • Sandy2503S Offline
              Sandy2503 @pyrosmiley
              last edited by

              Hi.

              I start the setupAccess.py and i have got an Error from Chromium Browser.

              In the Message stands the the Chromium Browser starts as normal user and not as root.

              How can i fix it ?

              Sandy

              1 Reply Last reply Reply Quote 0
              • M Offline
                MattSharp
                last edited by

                Has anyone managed to get this installed on a Raspberry Pi Zero W using Jessie Lite?

                When running setupAccess.py I can’t get anywhere as it doesn’t open a browser window so I can’t authenticate.

                Any help appreciated.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Costi @pyrosmiley
                  last edited by

                  @pyrosmiley I had the same issue and I could change it by setting new rights for the tokens.ini file. Set the rights for write to all (before this only for root access) and the new token can be written. Update works now, let’ see how long …

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Achilles
                    last edited by

                    Hello all,

                    Newbie here. I know I am late trying to put together a MagicMirror, but I just discovered this! Anyway, I am trying to put this Fitbit module on mine, and I when I run “sudo python setupAccess.py”, I get a “python: can’t open file ‘setupAccess.py’: [Errno 2] No such file or directory” error.

                    I am not sure where I have gone wrong here, as I have followed the instructions thus far found here:

                    https://github.com/SVendittelli/MMM-fitbit/blob/master/README.md

                    Any ideas?

                    Thanks.

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Achilles
                      last edited by

                      I fixed it. Newbie mistake, I was in the wrong directory when I tried to excute the command. Having problems now trying to get my steps to show, so I have pouring over all of the info here in the forum…thanks to all who have posted here

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        Achilles
                        last edited by

                        I got it to work! Great module!

                        1 Reply Last reply Reply Quote 1
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 12
                        • 13
                        • 1 / 13
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy