Ahh well thank you for saving me the trouble of looking into it. Figured it wouldnt be as good just based on the adoption
Read the statement by Michael Teeuw here.
Latest posts made by artieikon
-
RE: Using voice to wake up mirror from sleep
-
RE: Clientonly mode vs just a browser
Hah well that didnt take long…
Chromium crashed on me a few times today with the classic “Aw, Snap!” page… but that might be more of an indication that I have an issue with one of the modules and not with how it is displayed. But as far as I know pm2 can be setup to auto-restart so if the “Aw, Snap!” page I’m seeing would cause the node process to crash, pm2 would auto-restart it.tl;dr one difference between the two ways. Chromium doesnt auto-restart on crashes. pm2 would autorestart but might hide the underlying issues if you are not monitoring logs/restarts.
-
RE: Using voice to wake up mirror from sleep
There is also MMM-voice that you can check out. Module hasn’t been updated for 3 years, but the forum post has still been getting some action with people sounding pleased with it.
Took a quick look at what it uses. Something called Sphinx SPHINX.
Never head of it before, but it seems to be developed by Carnegie Mellon so it should be pretty legit. Definitely much less used and known than tensor or any of the others, but being made by CMU means it should be pretty good stuff (although maybe not currently or ever “production ready”) -
RE: Using voice to wake up mirror from sleep
Thanks for the link to the MMM-assistant, I was about to start working on something similar myself.
From what I remember (truth be told I havent looked at the google assistant in a while) the google assistant does not support customized keywords ie. “Mirror” only things like “Ok Google”.
Anything that does a custom keyword usually uses snowboy (as MMM-assistant does), Picovoice, DeepVoice, or some kind of a custom tensorflow derivative. I have not looked into any of these other solutions because I’m not too much of a fan of having to say “Ok Google” (not to mention the whole “big brother” things that come with it).Also one thing to note is that some of these solutions (especially a custom tensorflow and potentially snowboy) wont have the accuracy of a google assistant since they wont have the raw voice data that google has.
Sounds like it will come down to: how much legwork do you want to do to create a solution that fits your needs, how accepting are you of a potential “always listening and sending data” solution, and how important accuracy is.Personally I’m probably going to try and figure out how to do a custom hotword that doesn’t leave my local network, and have that be a trigger for Google’s assistant. No big bro, and only have to worry about training a model for a single trigger word
-
RE: Clientonly mode vs just a browser
@potts-mike pm2 seems like a bit overkill for just opening a browser.
If you are just using using the zero to show the browser (and are not running the code with clientonly mode) than you can just edit/home/USER/.config/lxsession/LXDE-pi/autostart
to launch chromium
See this stackoverflow post: Start “Chromium” automatically on booting the Pi3 with Raspbian JESSIE -
RE: Clientonly mode vs just a browser
True stability might have been an issue at some point. Also maybe it was to support more use cases, more support is always better than less.
Both are light weight and easy to install/configure so I might just stick with browser for now and switch if I find any kind of issues (or if someone has a reason we missed). -
Clientonly mode vs just a browser
I tried searching for a topic on the difference between running MM using clientonly mode vs just connecting to a server using a browser but I couldnt find anything on it.
Why would you need to run clientonly mode and have to install nodejs and deal with the potential issues that comes with having extra dependencies while you could just connect to a server using a browser?
Edit: I am not griping about splitting client and server into different parts, I think that is a great idea I just dont see the benefit of running clientonly mode when you already have an option of using a browser… unless the only difference is you choose to depend on nodejs vs depending on chrome
-
RE: Divide Config.js into modules
Got it working. Here is some simple code for anyone curious. There is probably a better way to get the same outcome, but this seems to work for now so I’m happy with it. Obviously this is rather useless currently, but I’m planning on iterating over a directory to pull out configs and parse them into modules, but i wanted to share the simple version first.
config.js
if (typeof window === 'undefined') { // Server side add requires here var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; } else { // client side only code here } var Http = new XMLHttpRequest(); var url = "file:///location/of/file/abc.txt"; Http.open("GET", url, false); Http.send(); var mods = [ { module: Http.responseText.trim(), position: "top_left" }, ]; var config = { address: "0.0.0.0", port: 8080, ipWhitelist: [], language: "en", timeFormat: 12, units: "imperial", modules: mods, electronOptions: { webPreferences: { webSecurity: false } } }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {module.exports = config;}
abc.txt
clock
Notes:
- Without specifying
webSecurity: false
Electron will not allow you to access a file that is not served up by the application. This is a security risk so use at your own discretion. typeof window === 'undefined'
is how I am figuring out if this code is executing server side or client side. Server side I had to add the require to be able to use XMLHttpRequest.
- Without specifying
-
RE: Divide Config.js into modules
Stumbling though the process to get this working the way i want. Just felt like i should share.
From what i surmise config.js is used both client side and server side. This is why “require” doesnt work and the browser complains. That is a server side construct and cannot be used client side.
Cool whatever, we have other ways to do things. Next i started trying to use XMLHttpRequest.
This blew up on me because electron does not support hitting the filesystem from the browser unless you set webSecurity to false. Cool this seems doable as we can pass in that value in the electronOptions in the config.jsHere’s where the fun happens. This doesnt work because that is done server side and it also uses the same config.js. Server side it cant resolve XMLHttpRequest because you need a “requires” statement to get it but then that blows up client side.
I can hack it in by specifying the webSecurity setting in the js/electron.js file as a default but that seems far too darn hacky. Im still stuck with the client showing the modules properly but the server not loading them… next try will be to run server only and client only with slightly different configs :vomit:
-
RE: Divide Config.js into modules
npm run config:check
but that actually came back valid since there are no syntax errors it just blew up on me runtime. The dev mode properly shows what is the issue though