Read the statement by Michael Teeuw here.
Fitbit
-
@achilles - I don’t actually know. Mine was up for months with no issue. It may be that a prolonged period without the module refreshing the tokens is the determining factor. It may even be something on Fitbit’s end expired all of the tokens.
-
This module looks great, unfortunately the installation is giving me the most difficulties from any module so far, I’m completely new to anything coding so I’m learning as I go. My first problem was trying to install the python-shell dependency. I get this message in my terminal:
pi@matt:~ $ npm install python-shell
npm WARN saveError ENOENT: no such file or directory, open ‘/home/pi/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/package.json’
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.- python-shell@1.0.4
updated 1 package in 2.932s
What am I doing wrong here?
- python-shell@1.0.4
-
See issue from mmille40 (above).
I am running ‘npm install python-shell’ from within the MagicMirror/modules/MMM-fitbit folder and appear to be having the exact same issue [although the location of the file that cannot be found is reported differently to mmille40’s location] and am unable to discover the reason why. Does anyone have any ideas?
npm WARN saveError ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/package.json’
npm WARN modules No description
npm WARN modules No repository field.
npm WARN modules No README data
npm WARN modules No license field.- python-shell@1.0.4
updated 1 package and audited 2 packages in 3.126s
found 0 vulnerabilities
- python-shell@1.0.4
-
@dh1201 this says u are in the MODULES folder, not MMM-Fitbit
-
Should it be the modules directory then?
Set up states:
As with all modules, use git clone in the modules directory to download the module
Goto fitbit to register a new app (sign in with your fitbit account)
Give your app a catchy name and description
Your personal website, organisation, and organisation website can be whatever you like
Check browser and personal for OAuth settings
Callback URL MUST BE http://127.0.0.1:8080/
Give your app read & write permissions (read-only untested)
Note your:
“OAuth 2.0 Client ID” — (client_id)
“Client (Consumer) Secret” — (client_secret)
(You can access these again later via manage my apps at the same link as above)
Navigate to MMM-fitbit in the modules directory
Install dependancies using the listed commands -
Sorry @sdetweil - I misread your post.
The command is definitely being run from within the MMM-fitbit directory; but shows the errors previously posted.
-
This module usually stops working for me after a day or two, and I have to go through the setupAccess.py again to get it to work, and then it stops working again within 48 hours.
Am I doing something wrong?
-
Was there a resolution to the problems @dh1201 and @mmille40 were experiencing?
I am experiencing the same problem where when running the command, npm install python-shell, while in the MMM-fitbit directory, I receive the same error as @dh1201
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json’
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json’
npm WARN modules No description
npm WARN modules No repository field.
npm WARN modules No README data
npm WARN modules No license field.When starting Magic Mirror, the Fitbit module displays no info and the cmd prompt states ‘TypeError: PythonShell.run is not a function’ and ‘TypeError: PythonShell is not a constructor’.
Does anyone know how to resolve this issue with python-shell? I’ve tried different versions and installing through different directories without any success. I’ve also tried clean installs of Magic Mirror but that doesn’t help either.
Is @Vendittelli still supporting this module?
-
@deepthought said in Fitbit:
When starting Magic Mirror, the Fitbit module displays no info and the cmd prompt states ‘TypeError: PythonShell.run is not a function’ and ‘TypeError: PythonShell is not a constructor’.
Does anyone know how to resolve this issue with python-shell? I’ve tried different versions and installing through different directories without any success. I’ve also tried clean installs of Magic Mirror but that doesn’t help either.After some faffing with the config to get the MM to load I am also getting this same error message when MM now loads.
From what I can see it is pulling the auth tokens correctly and is also able to run the getData.ph as running this on its own returns my total lack of steps etc. But the figures are not updating on MM, I’m assuming this is because of the above error messages.
I was able to get past PythonShell.run is not a function by altering line 9 in the node_helper.js to be:
let {PythonShell} = require(‘python-shell’)
However doing this then gave other error messages relating to code in other files, kind of making me think that this was the wrong thing to do. I’m assuming I am missing something obvious.
Does anyone have any suggestions?
-
hi everyone
i found a workaround
- cd MagicMirror
- mkdir Test
- cd Test
- npm install python-shell@0.5.0
- copy python-shell from Test/node_modules folder to MagicMirror/node_modules
- also copy package.json to node_modules folder of MM