Plus: I learned that the callback page needs to be called exactly as specified, so I tried also with http://127.0.0.1:8888/
with ending slash, without, even with https - all to no avail.
Thanks again
Markus
Plus: I learned that the callback page needs to be called exactly as specified, so I tried also with http://127.0.0.1:8888/
with ending slash, without, even with https - all to no avail.
Thanks again
Markus
@Vizulize thanks a lot!
In the meantime I came a little further.
So about the package.json: Yes, can confirm, @sdetweil 's solution works perfectly.
I did go the other route: after the git clone, I did an npm init, this resolved the prob in the package.json and package-lock.json - this worked, too.
My next problem was when calling the init.sh, I found out I had no pip installed, so the required libraries could not be installed.
So I installed pip, then init.sh ran fine and installed what was required.
I also came to the conclusion that the oauth authentification would probably work better locally rather than over ssh.
So I ran auth.sh, was told that server was now listening on http://127.0.01/8888 - which was also what I entered when registering the app at fitbit. Looked good so far.
No browser was opened though. So restarted MM with an invalid config.js, hooked up a keyboard/mouse on the mirror-raspberry locally and opened electron from a local terminal like so:
/home/pi/MagicMirror/node_modules/electron/dist/electron http://localhost:8888
That’s when the serverside reported
127.0.0.1 - - [04/Dec/2023:20:19:56] "GET / HTTP/1.1" 404 2019 "" "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.228 Electron/26.6.2 Safari/537.36"
So, 404.
On the electron window, this was shown:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
TypeError: index() missing 1 required positional argument: 'state'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cprequest.py", line 628, in respond
self._do_respond(path_info)
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cprequest.py", line 687, in _do_respond
response.body = self.handler()
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\lib\encoding.py", line 219, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cpdispatch.py", line 60, in __call__
raise sys.exc_info()[1]
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cpdispatch.py", line 58, in __call__
test_callable_spec(self.callable, self.args, self.kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\cherrypy\_cpdispatch.py", line 157, in test_callable_spec
raise cherrypy.HTTPError(404, message=message)
cherrypy._cperror.HTTPError: (404, 'Missing parameters: state')
Pls note: this is not exactly my error, looks like this is coming from a windows machine:
This came up as the first result when entering “missing parameters state” in the google search. But it is close enough to my error (just replace C:\ProgramData… with home/pi/.local/lib/python3.7… - I could not be bothered to type it all off of my mirror :-D )
There was no solution given, though, so that is where I am stuck now…
Thanks again for your help,
Markus
So, quick update:
I tried inist.sh with the modified package.json
The result was just the same - I don’t see any input dialog open.
I believe the module is installed properly and the dependencies are ok.
Thanks
Markus
Yes, right.
Must have looked into the package.json after doing the npm init - my bad. Did another git clone and it is as you said.
Meanwhile it turned out I had pip not installed. After installing pip and running ./init.sh again (after npm init) libraries were installed, and also auth.sh was able to start (only saw it when I called the python script directly rather than from auth.sh)
So auth.sh was now able to “Open a Web browser” (at least according to its logs), I just don’t see any dialog.
Anyway, will now try init with the modified package.json and see if it makes a difference - will report back.
Thanks so far
Markus
@sdetweil yeah, so I renamed MMM-Fitbit2, cloned fresh.
In the package.json there is no such a line that you mentioned (I guess @Vizulize must have fixed it already)
Did npm init, then ./init seemingly went through.
With ./auth.sh same thing as before - no dialog showing up.
I hope @Vizulize sees it and helps out :-)
Thanks
Markus
Thanks, Sam!
Had it googled in the meantime, had renamed the package-lock.json und run npm init
It braught no further error, I called auth.sh and that’s where I’m stuck now.
After entering the credentials, no browser dialog opens and I’m not quite sure where to search it.
Am logged in over ssh and in addition have a browser open to :8080
Neither on the mirror, nor on the pc, there is any dialog appearing.
I guess I’ll start from scratch, remove the module folder, clone new from git, and try your suggested method with the original package.json?
Thanks again
Markus
Hi, updated MM and now Google-Fit can no longer be installed, so I gave MMM-Fitbit2 a go.
Thanks @Vizulize for your work, I’d really like to get it running.
I have the same error that is reported in the github:
npm ERR! must provide string spec
To reproduce, just try to install it on an updated MM system.
It happens when calling ./init.sh as per your instructions on github
Have you/has anybody figured out a way to initialize the module?
Thanks
Markus
Hallo @HansB
danke fürs Lob, sorry für die superspäte Antwort…
Ich verwende das MMM_Webradio Modul. Habe es ein wenig verändert, um die Logos für die Radiostationen anzuzeigen. Aber so wie es ist funktioniert es auch gut (habe ehrlich gesagt schon lange nicht mehr meine Module aktualisiert, weiß daher nicht, wie es aktuell tut)
Viel Erfolg und liebe Grüße
hi @bachoo786
sorry for the late late reply, haven’t been on the forum for quite some time.
Yes, I did have problems with dropping wifi. Not quite sure what it caused, might be the aluminium frame, maybe the mirror coating on the glass, idk. Had to replace the wifi module. Best of luck and cheers
Markus
Since my Magic Mirror went live, it received 2 major upgrades:
The monitor died and was replaced
Still not sure on how it died. I suspect that the button control caused a short circuit with the metal casing of the monitor control box. Or maybe it was moisture that got into it after all.
Anyway, I replaced it with a much slimmer monitor of the same size. Another advantage was that it had a well sealed external power brick instead of the somewhat sketchily mounted power board of the original monitor.
This is what I got:
https://www.amazon.de/gp/product/B07C4B1ZXC/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1
Very cheap, very slim, way lighter, way better sealed and brighter than the first monitor I head
The Raspberry is now running from HDD
The raspberry 2 kept crashing. All the time, every other day at least. Checked and changed power supply, no improvement. Re-wrote image on sd-card, no improvement. Updated os and mm, no improvement. I even set up a cron job to reboot once per night. Nothing helped.
So I investigated and read a lot on how an sd card isn’t really suitable to run an os over a long time (at least that is what I made of it). So I decided to run it from a hdd. Was originally planning to go for an sdd, but decided well I don’t want to spend another 50-100 EUR, including an usb adapter. So I digged up a 2.5’’ HDD which I had laying around (to be precise: being uselessly sticked to the back of my tv). Looked up a bunch of tutorials on how to run a raspberry 2 from HDD. (Note: it actually still boots from sd, but hands over control to HDD immediately after startup). It involves:
After that you should expand the size of the filesystem on the HDD, since it has initially only the size of the image you burned on it. Note, this can’t be done with raspi-config, but with fdisk
It looks like (and honestly is) quite some task to get it to run (at least it was for me, a half-experienced Linux user). I found it worth to investigate though, educate myself about Linux, the file system, and other aspects and spend some time with trial and error.
You will find plenty of instructions on the internet, some more useful than others, but you will find your way through it, too.
Finally it is running really fine now. I had no crashes since (and it is over a week running now), so I guess it is worth the effort. :-)
Sure, I could have thrown out the Raspberry pi 2 and replaced it with a 4, seeing if that helps, but I really wanted to see if I can make it work with the good old pi2.
So I ended up installing the mm from scratch (now on HDD), thereby getting the latest version, fetching the latest versions of the modules I use, redoing the modifications I did to them, re- and re- and rearranging the modules until I finally had it running as I wanted it to.
Here is a pic with the new monitor, the HDD and some cleaning up:
And here is the front, one more time:
Here is a current snapshot from the browser (with the webradio running):
Cheers!