GithubHelp home page GithubHelp logo

eouia / mmm-assistant Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 8.0 12.32 MB

(Deprecated) This project is not supported any more from original owner. Use alternative MMM-AssistantMk2(https://github.com/eouia/MMM-AssistantMk2)

Home Page: https://github.com/eouia/MMM-AssistantMk2

License: MIT License

JavaScript 85.14% CSS 2.50% Python 4.83% Shell 7.53%

mmm-assistant's People

Contributors

e3v3a avatar eouia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-assistant's Issues

Node Version

Hi !

I’m trying to setup the MMM-Assistant module. I followed the wiki install process but at the end I have an error in my console and I can’t launch the mirror.

Here is the error;

WARNING! Could not load config file. Starting with default configuration. 
Error found: Error: The module '/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/speaker/build/Release/binding.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using npm rebuild ornpm install).

I tried the npm rebuild, npm install, delete the node_modules folder and then npm install again, but I still have this error.

Thanks a lot for your help !

After notification sent -> no more voice recognition?

Hi, i try to use notifications to control other modules with the "smart mirror" hotword. He does send the notification correctly, but after that, he doesn't go back into idle mode. Do i have to set the voice recognition back after i received the notification manually?

0|MagicMir | [ASSTNT] Snowboy Activated
0|MagicMir | [ASSTNT] Command recognized: main page
0|MagicMir | { text: 'Here is the main page',
0|MagicMir |   option: { language: 'en-US', useAlert: false },
0|MagicMir |   originalCommand: 'main page' }
0|MagicMir | [ASSTNT] Speak:  Here is the main page
HERE IT STUCKS - other modules are still running. 
	getCommands: function(commander) {
	  commander.add({
	    command: 'news page',
	    description: 'You can change to news page with this command.',
	    callback: 'command_showNewsPage'
	  })
	  commander.add({
	    command: 'main page',
	    description: 'You can change to main page with this command.',
	    callback: 'command_showMainPage'
	  })
	},

	command_showNewsPage: function(command, handler) {
	  this.showNewsPage()
	  var option = {
	    language: 'en-US',
	    useAlert: false
	  }
	  handler.response("Here is the news page!", option)
	},
	
	showNewsPage: function() {
	    this.curPage = 1;
		this.updatePages();
	},

	command_showMainPage: function(command, handler) {
	  this.showMainPage()
	  var option = {
	    language: 'en-US',
	    useAlert: false
	  }
	  handler.response("Here is the main page", option)
	},
	
	showMainPage: function() {
	    this.curPage = 0;
		this.updatePages();
	},

Add dependecy badges for security

This is a high priority issue!

We know that electron has a Remote Code Execution vulnerability in it. What this means, is that we risk to turn every single MM into a bot-net, or worse, a root leverage point in the local network of anyone using it. Basically you can gain a (Windows) command shell from something like this.

In view of this, we should consider adding one or both of the following dependency tags, in the top README.

The badges would look:

  • Gemnasium: Dependency Status
  • David-dm: dependencies Status
  • Snyk: Known Vulnerabilities

.pmdl not working?

I have tried thousand times with .pmdl but failed. .umdl works well. I don't know why.

Authentication script error: missing keyFilePath

When running the current version of the google-auth.js script, some users has reported this error:

/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/components/auth.js:18 
throw new Error(‘Missing “keyFilePath” from config (should be where your JSON file is)’);

The fix has been reported to be to edit out the auth:{ part like this :

const config = {
  //auth: {
    keyFilePath: path.resolve(__dirname,     '../assets/google-client-secret.json'), // secret.json
    savedTokensPath: path.resolve(__dirname, '../assets/google-access-tokens.json'), // resources/tokens.js
  //},
}

Help wanted: extending functionality

Hi,

I have been trying to extend some functionality.
Not being a native English speaker I really wanted some short cuts to basic functions using just a snowboy hotword. Most wanted was turning the screen on after just uttering "mirror" in my own language. Kind of like a PIR but voice activated. To get this to work I changed a few lines.

In MMM-Assistant.js I extended the function:

  hotwordDetected : function (type) {
    // Start Google Assistant
    if (type.hotword == 'ASSISTANT') {
      this.sendSocketNotification('ACTIVATE_ASSISTANT')
      this.status = 'ACTIVATE_ASSISTANT'
    // Start command mode
    } else if (type.hotword == 'COMMAND') {
      this.sendSocketNotification('ACTIVATE_COMMAND')
      this.status = 'ACTIVATE_COMMAND'
    // Start snowboy hotword activated shell command
    } else if (type.hotword == 'EXECUTE') {
      this.sendSocketNotification('EXECUTE', this.config.snowboy.models[type.index-1].parameter)
     // kludge, don't know how else to get back to listening
      this.sendSocketNotification('SPEAK', {text: ''}) 
    // Send snowboy hotword activated notification to all modules
    }  else if (type.hotword == 'NOTIFY') {
     // kludge, don't know how else to get back to listening
      this.sendSocketNotification('SPEAK', {text: this.config.snowboy.models[type.index-1].parameter}) 
      this.sendNotification(this.config.snowboy.models[type.index-1].parameter)
    }
  },

And in node_helper.js, I added to the function socketNotificationReceived: function the following:

      case 'EXECUTE':
        execute(payload, function(callback) {
          console.log(callback)
        })
        break

and in activateHotword: function(), I changed this line:

      this.sendSocketNotification('HOTWORD_DETECTED', {hotword:hotword, index:index})

So now you can extend the snowboy models in your config to something like this:

        snowboy: {
            models: [
                {
                    file: "resources/show_mirror.pmdl",
                    sensitivity: 0.45,
                    parameter: 'vcgencmd display_power 1', // monitor on
                    hotwords : "EXECUTE"         
                },
                {
                    file: "resources/hide_mirror.pmdl",
                    sensitivity: 0.5,
                    parameter: 'vcgencmd display_power 0',
                    hotwords : "EXECUTE"              
                },
                {
                    file: "resources/alert.pmdl",
                    sensitivity: 0.5,
                    parameter: 'SHOW_ALERT',
                    hotwords : "NOTIFY"  
                },

Now my problem is the kludge I used in MMM-Assistant.js. I don't know how I can gracefully revert to the default state that just listens for another hotword. Any help is appreciated.

Exceeded maximum allowed stream duration

After the "command" hot word, if nothing else is spoken a time out is triggered.

Error: 11 OUT_OF_RANGE: Exceeded maximum allowed stream duration of 65 seconds.

I would expect MMM-Assistant to return to a listening state, waiting for a new hot word to be spoken.
Unfortunately after this error MMM-Assistant becomes unresponsive and does not react to hot words.

Not able to install

Hi @eouia

I'm following your wiki instructions, but the installation fails with:

$ npm install

> [email protected] preinstall /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy
> npm install node-pre-gyp

npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 113 packages from 75 contributors in 34.586s

> [email protected] install /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.3.2/node-v59-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/build'
  CC(target) Release/obj.target/grpc/src/core/lib/surface/init.o
...

That file does not exist and seem outdated. But I found one here:
https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.1/node-v59-linux-arm.tar.gz

However, I don't know where that file belong, do you?
Either way, I did this:

cd ~/Downloads
wget https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.1/node-v59-linux-arm.tar.gz
tar -zxvf node-v59-linux-arm.tar.gz 
cd node-v59-linux-arm
mkdir -p /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/extension_binary/node-v59-linux-arm/
cp grpc_node.node /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/extension_binary/node-v59-linux-arm/.
cd /home/pi/MagicMirror/modules/MMM-Assistant/
npm install

That resulted in the following message:

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

removed 23 packages in 26.832s

Not sure if this went well, because I cut the install short the first time when it failed finding that file.

So I did this:

issue with google-auth.js

pi@raspberrypi:~/MagicMirror/modules/MMM-Assistant $ node google-auth.js
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/google-auth.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

sorry if i shouln't open a new topic on this...but can someone help me here?

modules not receiving notifications.

Hi when ever i send a notification using sendNotification none of my other modules receive the notification and yet all my other modules are able to communicate with each other no problem using sendNotification. I am only new to this so sorry if this is a stupid question.

Assistant langages

Hi,

Is there a way to set another language for the assistant (snowboy) ? The language settings seems to be only for commands.
KR

Sometime it seem that GA records it's own response...

I've noticed from the trnasciption logs that sometimes it seem that GA is recording it's own response. The response to the response is a "deep", or mans or slow, voice saying: "Sorry, I don't understand."

Very weird indeed!

[ASSTNT] GA Transcription:  { transcription: 'can you remember something for me',  done: true }
[ASSTNT] GA Response:  Sure! Just say something like 'Remember the door code is 4453' and then ask 'What is the door code'
...
[ASSTNT] GA Transcription:  { transcription: 'just say something like remember the door code is 4453 and then what is the door code',
  done: true }
[ASSTNT] GA Response:  Sorry, I don't understand.

MMM-Assistant crashes on start

0|MagicMir | WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/node/extension_binary/electron-v1.7-linux-arm-glibc/grpc_node.node'
0|MagicMir | App threw an error during load
0|MagicMir | Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/node/extension_binary/electron-v1.7-linux-arm-glibc/grpc_node.node'
0|MagicMir |     at Module._resolveFilename (module.js:470:15)
0|MagicMir |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
0|MagicMir |     at Function.Module._load (module.js:418:25)
0|MagicMir |     at Module.require (module.js:498:17)
0|MagicMir |     at require (internal/module.js:20:19)
0|MagicMir |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/grpc_extension.js:30:15)
0|MagicMir |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/grpc_extension.js:34:3)
0|MagicMir |     at Module._compile (module.js:571:32)
0|MagicMir |     at Object.Module._extensions..js (module.js:580:10)
0|MagicMir |     at Module.load (module.js:488:32)
0|MagicMir | { Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/node/extension_binary/electron-v1.7-linux-arm-glibc/grpc_node.node'
0|MagicMir |     at Module._resolveFilename (module.js:470:15)
0|MagicMir |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
0|MagicMir |     at Function.Module._load (module.js:418:25)
0|MagicMir |     at Module.require (module.js:498:17)
0|MagicMir |     at require (internal/module.js:20:19)
0|MagicMir |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/grpc_extension.js:30:15)
0|MagicMir |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/grpc_extension.js:34:3)
0|MagicMir |     at Module._compile (module.js:571:32)
0|MagicMir |     at Object.Module._extensions..js (module.js:580:10)
0|MagicMir |     at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' }

did already your Cannot find module... (esp. related with electron ver 1.7)... what else can i do?

gyp ERR! build error

This is my error information.
Somebody help me.

pi@raspberrypi:~/MagicMirror $ sudo npm install --save-dev electron-rebuild && ./node_modules/.bin/electron-rebuild --pre-gyp-fix
[email protected] /home/pi/MagicMirror
└── [email protected] 

✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/pi/MagicMirror/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/MagicMirror/node_modules/uws/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/MagicMirror/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15',
gyp info spawn args   '-Dnode_gyp_dir=/home/pi/MagicMirror/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pi/MagicMirror/node_modules/uws',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
make: Entering directory '/home/pi/MagicMirror/node_modules/uws/build'
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/uws/src/Extensions.o
  CXX(target) Release/obj.target/uws/src/Group.o
In file included from ../src/WebSocketProtocol.h:5:0,
                 from ../src/WebSocket.h:4,
                 from ../src/Group.h:4,
                 from ../src/Group.cpp:1:
../src/Networking.h:7:30: fatal error: openssl/opensslv.h: No such file or directory
 #include <openssl/opensslv.h>
                              ^
compilation terminated.
uws.target.mk:95: recipe for target 'Release/obj.target/uws/src/Group.o' failed
make: Leaving directory '/home/pi/MagicMirror/node_modules/uws/build'
make: *** [Release/obj.target/uws/src/Group.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/pi/MagicMirror/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Linux 4.9.59-v7+
gyp ERR! command "/usr/bin/node" "/home/pi/MagicMirror/node_modules/.bin/node-gyp" "rebuild" "--target=1.4.15" "--arch=arm" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd /home/pi/MagicMirror/node_modules/uws
gyp ERR! node -v v6.12.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/pi/MagicMirror/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/MagicMirror/node_modules/uws/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/MagicMirror/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15',
gyp info spawn args   '-Dnode_gyp_dir=/home/pi/MagicMirror/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/pi/.electron-gyp/.node-gyp/iojs-1.4.15/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pi/MagicMirror/node_modules/uws',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
make: Entering directory '/home/pi/MagicMirror/node_modules/uws/build'
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/uws/src/Extensions.o
  CXX(target) Release/obj.target/uws/src/Group.o
In file included from ../src/WebSocketProtocol.h:5:0,
                 from ../src/WebSocket.h:4,
                 from ../src/Group.h:4,
                 from ../src/Group.cpp:1:
../src/Networking.h:7:30: fatal error: openssl/opensslv.h: No such file or directory
 #include <openssl/opensslv.h>
                              ^
compilation terminated.
uws.target.mk:95: recipe for target 'Release/obj.target/uws/src/Group.o' failed
make: Leaving directory '/home/pi/MagicMirror/node_modules/uws/build'
make: *** [Release/obj.target/uws/src/Group.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/pi/MagicMirror/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Linux 4.9.59-v7+
gyp ERR! command "/usr/bin/node" "/home/pi/MagicMirror/node_modules/.bin/node-gyp" "rebuild" "--target=1.4.15" "--arch=arm" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd /home/pi/MagicMirror/node_modules/uws
gyp ERR! node -v v6.12.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Failed with exit code: 1
    at SafeSubscriber._error (/home/pi/MagicMirror/node_modules/spawn-rx/lib/src/index.js:277:84)
    at SafeSubscriber.__tryOrUnsub (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:239:16)
    at SafeSubscriber.error (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:198:26)
    at Subscriber._error (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:129:26)
    at Subscriber.error (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:103:18)
    at MapSubscriber.Subscriber._error (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:129:26)
    at MapSubscriber.Subscriber.error (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:103:18)
    at SafeSubscriber._next (/home/pi/MagicMirror/node_modules/spawn-rx/lib/src/index.js:251:65)
    at SafeSubscriber.__tryOrSetError (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:248:16)
    at SafeSubscriber.next (/home/pi/MagicMirror/node_modules/rxjs/Subscriber.js:188:27)


Google Assistant is not responding

Hey , i followed the installation steps,

the module is detecting the launch phrase perfectly and performs the" Smart Mirror" commands perfectly as well , but Google Assistant commands are not performed , it only says "give me permission to help you".

I checked my Google API analytics and I found that Cloud Speech API requests are all successful but Google Assistant API are all ERRORS

image

NPM version
3.10.10

node version
v6.14.1
uname -a

Linux raspberrypi 4.14.31-v7+ #1104 SMP Thu Mar 29 16:52:18
BST 2018 armv7l GNU/Linux

sudo lsb_release -a

No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch

Add debug option to enable console debug messages to not spam logs

The code base contain a lot of console.log() messages that are constantly spamming the pm2 logs.
We should write a debug log wrapper to use a config option of : debug: true to enable/disable those.

Perhaps something like:

bLog: function (blob) {
  if (this.config.debug == true) {
     console.error(blob);
  }
} 

Update packages

New packages available;

 @google-cloud/speech  ^1.3.0  →  ^1.4.0
 speaker               ^0.4.0  →  ^0.4.1

I have a question about google cloud vision api in magic mirror

I am having difficulty making a module of google vision api as a module. Do I have to make a file like google-auth.js like the MMM-Assistant and auth: {} in config? And if you write const vision = require ('@ google-cloud / vision'); in node_helper.js, you will get the error: Failed to load gRPC binary modules because it was not installed for the current system. Please help me

Hotword detection stops working when no command is given

I was able to successfully install the module and trigger a couple of commands but I'm having an issue when I trigger the Hotword and I head the ding but don't follow up with a command then the hotword detection stops working entirely.

I checked the logs but didn't see any errors.

Thanks for your help.

google authentication process

I followed the steps for authentication and installation. However I was stuck at the part where you have to do "node google-auth.js" it shows

node google-auth.js

internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/google-auth.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

Reading another thread, I went into the directory of scripts and ran the same command, which then it showed:

/MagicMirror/modules/MMM-Assistant/scripts $ node google-auth.js
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-Assistant/assets/google-client-secret.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at new Auth (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/components/auth.js:26:15)
    at new GoogleAssistant (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/index.js:21:16)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/scripts/google-auth.js:25:19)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)

Please, help.

TypeError: Speech is not a function

Relevant Branch: dev

By chance I failed to give a command after saying smart-mirror. Then it froze with the following
error in the logs:

TypeError: Speech is not a function
    at Class.activateCommand (/home/pi/MagicMirror/modules/MMM-Assistant/node_helper.js:355:20)
    at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Assistant/node_helper.js:88:43)
    at Socket.<anonymous> (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
    at emitTwo (events.js:106:13)
    at Socket.emit (events.js:191:7)
    at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:513:12
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Looking at the code line, we have:

...
  activateCommand: function() {
    this.sendSocketNotification('MODE', {mode:'COMMAND_STARTED'})
    const speech = Speech(this.config.stt.auth[this.commandAuthIndex++])    // ERROR LINE!!
    if (this.commandAuthIndex >= this.commandAuthMax) this.commandAuthIndex = 0
...

Consider removing the materialdesign CDN image dependencies

There is no good reason to keep the module having to download the material design icons, every time they are needed. It also prevent the module to display properly if:

  • You have firewalled / adblocker not allowing the cdn site
  • You do not have an internet connection

Here is the line that does the loading:

  loadCSS: function() {
    var css = [{
        id:   'materialDesignIcons',
        href: 'https://cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css',
    }]

So to accomplish this we need to download the images and keep them in ./images/ (?).
The icons in question are specified here (and possible in other places).

  getDom : function() {
    var wrapper = document.createElement("div")
    wrapper.className = "ASSTNT"
    var iconDom = document.createElement("div")
    iconDom.className = "mdi status " + this.status + " "
    switch(this.status) {
      case 'INITIALIZED':
        iconDom.className += "mdi-microphone-outline"
        break
      case 'HOTWORD_STARTED':
        iconDom.className += "mdi-microphone"
        break
      case 'HOTWORD_DETECTED':
        iconDom.className += "mdi-microphone"
        break
      case 'ASSISTANT_STARTED':
        iconDom.className += "mdi-google-assistant"
        break
      case 'ASSISTANT_SPEAKING':
        iconDom.className += "mdi-google-assistant"
        break
      case 'COMMAND_STARTED':
        iconDom.className += "mdi-apple-keyboard-command"
        break
      case 'COMMAND_LISTENED':
        iconDom.className += "mdi-apple-keyboard-command"
        break
      case 'SPEAK_STARTED':
        iconDom.className += "mdi-message-processing"
        break
      case 'SPEAK_ENDED':
        iconDom.className += "mdi-microphone"
        break
}

Refresh when expiration timer run out

Problem:
Module stops responding after a period of time when not used.

Possible causes:

  • API access token expires
  • socket connections are cut/removed after some (unknown?) time when not used?

Both (most?) voice APIs are dependent on an access token that is used to access the voice services. This access tokens has an expiration timer associated with them. When they run out, you need to refresh it with the refresh tokens.

These timers run out: (need check):

  • Amazon: 3600 sec
  • Google: 3600 sec ?

Change command json tags to correctly reflect spoken command

In the command file containing the spoken command text (that the module is reacting to) some of the variable names (or "tags") are not named according to what the command does. This is confusing.

{
  "UNSPEAKABLE" : "Sorry, I cannot pronounce this response.",
  "INVALID_FORMAT" : "Sorry, the question and answer based dialog is not supported in command mode. Please ask module developer.",
  "INVALID_COMMAND" : "Sorry, I cannot understand your command. Try again.",
  "ALIAS" : "This is alias of {command}",
  "CMD_HELP" : "help :command",
  "CMD_HELP_COMMAND_PROVIDER" : "This command is provided by {module}",
  "CMD_HELP_DESCRIPTION" : "This command could tell you the description of that command.",
  "CMD_HELP_COMMAND_EXAMPLE" : "Say command name after 'help' like this. 'help all modules'.",
  "CMD_LIST_COMMANDS" : "list all commands",
  "CMD_LIST_COMMANDS_DESCRIPTION" : "This command could tell the name of all commands available.",
  "CMD_LIST_COMMANDS_RESULT" : "These are available commands.",
  "CMD_LIST_MODULES" : "list all modules",
  "CMD_LIST_MODULES_DESCRIPTION" : "This command could tell the name of all modules installed currently.",
  "CMD_LIST_MODULES_RESULT" : "These are currently installed modules.",
  "CMD_HIDE_ALL_MODULES" : "hide all modules",
  "CMD_HIDE_ALL_MODULES_DESCRIPTION" : "This command could hide all modules from the screen of your magic mirror.",
  "CMD_HIDE_ALL_MODULES_RESULT" : "All modules will be hidden.",
  "CMD_SHOW_ALL_MODULES" : "show all modules",
  "CMD_SHOW_ALL_MODULES_DESCRIPTION" : "This command could show all modules which are hidden.",
  "CMD_SHOW_ALL_MODULES_RESULT" : "All modules will be shown.",
  "CMD_SAY" : "say :something",
  "CMD_SAY_DESCRIPTION" : "This command could speak anything which you want.",
  "CMD_REBOOT" : "reboot",
  "CMD_REBOOT_DESCRIPTION" : "This command could reboot the magic mirror instantly.",
  "CMD_SHUTDOWN" : "shut down",
  "CMD_SHUTDOWN_DESCRIPTION" : "This command could shutdown the magic mirror instantly.",
  "TELBOT_CMD_GA_DESCRIPTION" : "Send text to Google Assistant."
}

E.g. "CMD_LIST_COMMANDS" : "list all commands", should be better named: "CMD_LIST_ALL_COMMANDS" : "list all commands",.

Error: spawn arecord ENOENT when starting MagicMirror

Just finished installing and when I open my webpage I get this error in my console:

[ASSTNT] Snowboy Activated
Whoops! There was an uncaught exception...
{ Error: spawn aplay ENOENT
    at _errnoException (util.js:1003:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
    at onErrorNT (internal/child_process.js:389:16)
    at process._tickCallback (internal/process/next_tick.js:152:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn aplay',
  path: 'aplay',
  spawnargs:
   [ '/Users/roysijnesael/Github/Personal/MagicMirror/modules/MMM-Assistant/resources/beep.mp3' ] }

And:

Whoops! There was an uncaught exception...
{ Error: spawn arecord ENOENT
    at _errnoException (util.js:1003:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
    at onErrorNT (internal/child_process.js:389:16)
    at process._tickCallback (internal/process/next_tick.js:152:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn arecord',
  path: 'arecord',
  spawnargs: [ '-q', '-r', 16000, '-c', '1', '-t', 'wav', '-f', 'S16_LE', '-' ] }

Does anyone known what to do?

MMM-Assistant is unable to wake up after Hotkey command (Snowboy/Smart Mirror)

I had followed every step https://github.com/eouia/MMM-Assistant/wiki and everything went smoothly until 3-2) .pmdl for snowboy hotword detection. Instruction was to visit https://snowboy.kitt.ai/ and get .pmdl for your voice. (Hotkey)

I tried following instruction at snowboy site - http://docs.kitt.ai/snowboy/ and instruction is really not clear how to get the command in. Now I am stuck here.

I also tried npm start command and there are numerous error with "npm ERR! enoent ENOENT: no such file or directory, open 'home/pi/package.json' (Where can I get this file or which step had I missed).

Please help

File Missing

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.3.2/node-v48-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)

Error: The incoming JSON object does not contain a client_email field (solved)

The "MIRROR" hot word throws the error on the console and then MMM-Assistant stops working
The "ASSISTANT" hot word works perfect.

Behaviour

npm start

Starting MagicMirror: v2.2.2
Loading config ...
Loading module helpers ...
Initializing new module helper ...
Module helper loaded: MMM-Assistant
No helper found for module: clock.
All module helpers loaded.
Starting server on port 8080 ...
You're using a full whitelist configuration to allow for all IPs
Server started ...
Connecting socket for: MMM-Assistant
Sockets connected & modules started ...
Launching application.
[ASSTNT] Snowboy Activated

<saying "snowboy">

[ASSTNT] Assistant Activated

<saying "what time is it">

[ASSTNT] GA Transcription:  { transcription: 'what', done: false }
[ASSTNT] GA Transcription:  { transcription: 'what time', done: false }
[ASSTNT] GA Transcription:  { transcription: 'what time is', done: false }
[ASSTNT] GA Transcription:  { transcription: 'what time is it', done: false }
[ASSTNT] GA Transcription:  { transcription: 'what time is it', done: true }

`correct response`

[ASSTNT] Snowboy Activated

<saying "smart mirror">

Whoops! There was an uncaught exception...

Error: The incoming JSON object does not contain a client_email field
    at JWT.fromJSON (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-auth-library/build/src/auth/jwtclient.js:218:19)
    at GoogleAuth.fromJSON (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-auth-library/build/src/auth/googleauth.js:380:16)
    at fs.readFile.e (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-auto-auth/index.js:125:48)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

checks

# ls -ali assets`
config.txt  
google-access-tokens.json  
google-client-secret.json  
google-private-key.json

node google-auth.js
Google Authentication OK! Press CTRL+C to Quit.

config.js exactly like config.txt
Commenting out the

credentail .json is too short

Hi,
I am following your instructions step by step to create credential json files, but it looks too short and doesnt have the key work "google assistant" and "path" in this file (400bytes size). could you think of any thing wrong with my work?
Best Regards,
Ta

Conversation Error

Everytime the Assistant gets activated the following happens:

[ASSTNT] Assistant Activated
Recording with sample rate 16000...
Recording 11026 bytes
End Recording: 657.287ms
Recording 55174 bytes
Recording 11026 bytes
Recording 11026 bytes
Recording 11026 bytes
Recording 11026 bytes
Recording 11026 bytes
[ASSTNT] Conversation Error: { Error: Invalid 'audio_in': audio frame length is too long.
    at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19)
    at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8)
    at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 3, metadata: Metadata { _internal_repr: {} } }
Recording 11026 bytes

Please help.

WARNING! Could not load config file. Starting with default configuration. Error found: Error: Module version mismatch. Expected 50, got 48.
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: compliments.
App threw an error during load
Error: Module version mismatch. Expected 50, got 48.
at Error (native)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:583:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at bindings (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/bindings/bindings.js:81:44)
Whoops! There was an uncaught exception...
Error: Module version mismatch. Expected 50, got 48.
at Error (native)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:583:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at bindings (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/bindings/bindings.js:81:44)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?

Error in GA authentication

When running the google-auth.sh script, it spits out an error before you have a chance to enter anything. However, it still runs and gives the token you need.

$ node google-auth.js

Attempted to automatically open the URL, but if it failed, copy/paste this in your browser:
<url shown here>
Paste your code: 
(node:3869) UnhandledPromiseRejectionWarning: Error: Exited with code 3
    at ChildProcess.cp.once.code (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/opn/index.js:84:13)
    at Object.onceWrapper (events.js:272:13)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Socket.stream.socket.on (internal/child_process.js:353:11)
    at Socket.emit (events.js:180:13)
    at Pipe._handle.close [as _onclose] (net.js:538:12)

(node:3869) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a catch block, 
or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:3869) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. 
In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

<pasted-code-here>
Google Authentication is finished. Press Ctrl+C for quit.
^C

It seem to be a problem in the opn library, so I filed an issue there.

Use a ramdisk for the TTS tmp files

Consider using a ramdisk for the temporary files created in /tmp to store pico2wav files used in the text-to-speech function, in node_helper.js. This would help save SD card based devices from over-wear.

    var commandTmpl = 'pico2wave -l "{{lang}}" -w {{file}} "{{text}}" && aplay {{file}}'

    function getTmpFile() {
        var random = Math.random().toString(36).slice(2),
        path = '/tmp/' + random + '.wav'
        return (!fs.existsSync(path)) ? path : getTmpFile()
    }

What is the "project keyfile"?

You mention in the installation instructions to:

<your project key file location>' //REQUIRED

What is this?

All I have are:

secret.json
resources/tokens.js

Also:
What is the difference between the simple version and full version configurations?

A few things to be implemented

A few things we would like to do, eventually.

  • Add 'Alexa' as new and additional assistant mode.
  • Add other speech recognition(STT) engine. (Jasper or any other thing)
  • Add other speech modules (Google-translate or espeak)
  • Add: Bixby ?
  • Add Cortana? nope!
  • Add: Siri? nope!

Anything else?
Please comment!

email is required

Hi Eouia

Thanks for this fantastic Module.

But i have a problem, when I start the MagicMirror (npm start) it starts and it records but he stops after i said "Smart Mirror" or "Snowboy".

Thats the Error:

[Auth error:Error: email is required.
Recording 4000 bytes
[ASSTNT] RecognizeStream Error:  { Error: 14 UNAVAILABLE: Getting metadata from plugin failed 
with error: email is required.
    at createStatusError (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:64:15)
    at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:270:19)
    at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:248:8)
    at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:804:12
  code: 14,
  metadata: Metadata { _internal_repr: {} },
  details: 'Getting metadata from plugin failed with error: email is required.' }
Recording 4000 bytes
Recording 4000 bytes
(node:1677) Warning: No such label 'End Recording' for console.timeEnd()

Do you know something about this?

Thanks
TheCrack3r

Speak notifications

Not sure if this is kinda' implemented already, but it would be cool to be able to have it say whatever notifications that may arrive, from other modules.

move and rename private google assets

We want to:

  • use one ./assets directory for storing all private files
  • have fixed file name for each asset file

So we can try to rename:

secret.json          --> google-client-secret.json
<downloaded>.json    --> google-private-key.json
tokens.json          --> google-access-tokens.json

This is great for simplifying the config.js.
But we need to test if the dependencies are expecting other locations...

Implement a request counter to keep track of free usage

I suggest we implement a request counter to keep track of the number of GA requests that has been made, so that the users do not exceed their free quota of ~240 requests/month.

When the GA request is understood and processes, it returns a done:true, that we could use.

[ASSTNT] GA Transcription:  { transcription: 'Make me a sandwich',  done: true }

This value need to be:

  • saved upon module shutdown to the file ./assets/googleRC.dat.
  • saved within module for conversation restarts, and remote MM connections.
    gRQC = this.googleRequestCounter
  • shown updated under microphone icon after each successful completion when config option:
    showGRC: true.

Cannot find module 'google-assistant'

I'm down to the google-auth.js step, but when I run it, I get this:

module.js:471
    throw err;
    ^

Error: Cannot find module 'google-assistant'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/google-auth.js:3:25)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

I've got all the Google Assistant libraries installed based on the instructions given in the Google Dev section. Did I miss something else?

MMM-Assistant Node && npm version

Hi, I had raised the concern about this module that could not execute despite following a few steps.

I have Raspbian Jessie Lite version
Nodejs upgraded to version 9.10.1
npm version 5.8.0
arecord and aplay has no issue playing test.wav and recording.

I noticed only when I uses the nodejs version 6.x.x, MMM-Assistant can be installed. But when I use nodejs version 9x.x, there are plenty of error:

node-pre-gyp ERR! Tried to download(403): https://snowboy-release-node.s3-us-west-2.amazonaws.com/snowboy/v1.2.0/Release/snowboy-v1.2.0-node-v59-linux-arm.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node" "--module_name=snowboy" "--module_path=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm"
gyp ERR! cwd /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy
gyp ERR! node -v v9.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/opt/nodejs/bin/node /opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node --module_name=snowboy --module_path=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.9.35-v7+
node-pre-gyp ERR! command "/opt/nodejs/bin/node" "/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy
node-pre-gyp ERR! node -v v9.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/opt/nodejs/bin/node /opt/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm/snowboy.node --module_name=snowboy --module_path=/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/snowboy/lib/node/binding/Release/node-v59-linux-arm' (1)
npm WARN The package electron-rebuild is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2018-03-30T08_47_26_891Z-debug.log`

Please clarify if possible or if MMM-Assistant package is a Beta repository? Thanks

Better file structure and organization

Implement a more organized and logical file structure.
Now we have the following directories:

 .git
 assets        // where we keep: config.txt (template), private API keys etc  
 docs          // where we keep GitHub related docs
 images        // where we keep GitHub related images
 node_modules 
 resources     // where we keep personal or universal voice models and sound files 
 scripts       // where we keep the google-authentication scripts
 translations 

We would like to:

  • keep all API keys, secrets and related files in one directory assets
  • keep all voice models (MMM default, universal, personal) in a resources subdirectory:
    • p_models
    • u_models
    • alexa
    • ga

What is the correct ALSA setting?

In the Wiki:

You SHOULD be able to execute below commands on terminal.
arecord -d 10 test.wav && aplay test.wav

That fails with:

$ arecord -d 10 test6.wav && aplay test6.wav

Recording WAVE 'test6.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: set_params:1299: Sample format non available
Available formats:
- S16_LE

So then I tried with:

$ arecord -d 10 -fS16_LE test6.wav && aplay test6.wav

Recording WAVE 'test6.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Warning: rate is not accurate (requested = 8000Hz, got = 44100Hz)
         please, try the plug plugin (-Dplug:default)
Playing WAVE 'test6.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: set_params:1305: Channels count non available

# but this works:
arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 -V mono test5.wav 

Since I only have an ALSA in ~/.asoundrc, I guess MM never see my settings or they are not right.
What are the settings you have?

snowboy (GA) wake word poorly detected

While the smart mirror wake word is very well detected, the snowboy is not.

My guess is that one reason could be that many people with very different accents have recorded this in the snowboy library.

How can I improve the detection?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.