DustinBryant / MMM-Ring

Module for MagicMirror that adds video feed of Ring Doorbell events
MIT License
25 stars 10 forks source link

MMM-Ring crashing magic mirror #10

Open ncmilhouse opened 4 years ago

ncmilhouse commented 4 years ago

I am having trouble with MMM-Ring crashing my magic mirror on a ring event. I have the latest version of MMM-Ring, as I just installed yesterday. I set up 2FA, and it is working just fine. It finds my ring doorbell and waits for a chime. But as soon as the doorbell is pressed mm quits and restarts itself (via pm2).

MMM-Ring at (5/3/2020, 9:08:38 PM): Found 1 location(s) with 2 camera(s). MMM-Ring at (5/3/2020, 9:08:38 PM): Location Raleigh has the following 2 camera(s): MMM-Ring at (5/3/2020, 9:08:38 PM): - 4783307: Front Door (lpd_v2) MMM-Ring at (5/3/2020, 9:08:38 PM): - 2955224: Driveway (hp_cam_v1) MMM-Ring at (5/3/2020, 9:08:38 PM): Location Raleigh has the following 0 device(s): MMM-Ring at (5/3/2020, 9:08:38 PM): Actively listening for doorbell presses MMM-Ring at (5/3/2020, 9:09:08 PM): Front Door had its doorbell rung! Preparing video stream.

magicmirror@2.7.1 start /home/pi/MagicMirror sh run-start.sh

Starting MagicMirror: v2.7.1

I checked the /public directory under MMM-Ring and it seems that sometimes I get both the .ts file and the other one, but not always. The one time I tried playing in vlc it was about a one second video. So it is probably crashing while trying to grab the video.

Any thoughts on how I can troubleshoot? As you can see above, the logs aren't terribly useful.

Thanks! milhouse

DustinBryant commented 4 years ago

Just pushed a new update that may or may not help here. The Ring-client npm developer is about to release a change that will fix possible NAT issues and once that happens it may fix this issue you are experiencing now.

For the time being, please update by navigating to the MMM-Ring directory within MagicMirror/modules and perform the following:

git pull npm install

Ring now requires Two-Factor Authentication so please make sure to follow this Wiki on the details of setting that up correctly: https://github.com/DustinBryant/MMM-Ring/wiki/Refresh-Tokens

The biggest difference in change is the module now automatically gets a new Refresh Token for you when the one you provide expires.

DustinBryant commented 4 years ago

The ring-client-api has now been updated to 9.1.1 and the biggest feature of that upgrade is:

UPnP and NAT-PMP hole punching has been removed in favor of RTP latching. This should lead to a successful live stream, regardless of network configuration, network settings, and NAT type

Please update MMM-Ring to the latest and let me know if this fixes your issues:

git pull npm install

ncmilhouse commented 4 years ago

Sorry it took me a while to respond. Ring had me blacklisted and it took awhile to clear...

I can't test yet, I am struggling getting the token. When I run npx -p ring-client-api ring-auth-cli

I am getting an error:

/home/pi/.npm/_npx/19588/lib/node_modules/ring-client-api/node_modules/got/dist/source/create.js:133
    const paginateEach = (async function* (url, options) {
                                        ^

SyntaxError: Unexpected token *
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/.npm/_npx/19588/lib/node_modules/ring-client-api/node_modules/got/dist/source/index.js:7:18)

Is an old token stored somewhere that I need to clear? Thanks!

DustinBryant commented 4 years ago

Try updating node and npm to the latest versions and then try again.

It doesn't store a token, it's just a helper to get a token.