Read the statement by Michael Teeuw here.
MMM-GoogleAssistant autostart
-
@poopyurinal said in MMM-GoogleAssistant autostart:
I know that to start the module successfully, I can enter the following 3 commands:
source env/bin/activate
cd ~/MagicMirror/modules/MMM-GoogleAssistant/pi
python3 assistant.pyyou are not starting the module… you are starting a background application
that is included in the module folderthe ‘module’ only runs inside the MagicMirror environment
so, you need to create a command that does the startup…
start the py and then start MMand then automate that
if u stop MM manually and restart it (without doing the assistant.py step) do the GA work thru mirror as u expect?
-
pm2 stop MagicMirror gives me:
[PM2][ERROR] Process MagicMirror not found
┌──────┬────┬──────┬────────┬───┬─────┬──────────┐
│ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
├──────┼────┼──────┼────────┼───┼─────┼──────────┤
│ mm │ 0 │ fork │ online │ 1 │ 0% │ 2.5 MB │
└──────┴────┴──────┴────────┴───┴─────┴──────────┘
Usepm2 show <id|name>
to get more details about an appAny thoughts? The MagicMirror is running. If I stop it by hitting Alt and closing it via the menu bar, it automatically restarts.
-
@poopyurinal pm2 list
-
pm2 list
┌──────┬────┬──────┬────────┬───┬─────┬──────────┐
│ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
├──────┼────┼──────┼────────┼───┼─────┼──────────┤
│ mm │ 0 │ fork │ online │ 1 │ 0% │ 2.5 MB │
└──────┴────┴──────┴────────┴───┴─────┴──────────┘
Usepm2 show <id|name>
to get more details about an app -
@poopyurinal pm2 stop mm
-
pm2 stop mm
[PM2] Applying action stopProcessId on app [mm](ids: 0)
[PM2] mm ✓
┌──────┬────┬──────┬─────────┬───┬─────┬────────┐
│ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
├──────┼────┼──────┼─────────┼───┼─────┼────────┤
│ mm │ 0 │ fork │ stopped │ 1 │ 0% │ 0 B │
└──────┴────┴──────┴─────────┴───┴─────┴────────┘
Usepm2 show <id|name>
to get more details about an appSorry, limited by new user restriction of one post every 120 seconds
-
@poopyurinal cool now follow the link i gave about creating a service that will autostart and make it start the assitant.py
I don’t understand why the MMM-GoogleAssistant module doesn’t do this… it would be so easy…
-
in the link it asks for ‘your service name’ make that GoogleAssistant
the command is ‘/home/pi/MagicMirror/modulesMMM-GoogleAssistant/python3 assistant.py’ -
once u create the service… make sure assistant.py is not running already
ps -ef | grep assistant
the 1st number on the output is the process id
pi xxxx yyyy etc…
thensudo kill -9 xxxx
then do
sudo systemctl start GoogleAssistant
then
ps -ef | grep assistant
to insure assistant is running
then start mirror manually with npm startif all is good, reboot
service will start the assistant.py script
and pm2 will start mirror app -
Many thanks Sam! I’ll need to take a look at your suggestions tomorrow. I appreciate the quick (immediate!) help.