Trying to install both Mycroft-Core and MagicMirror on the same PI

In linux there are a lot of ways to achieve that, I’m not sure which way is “cleanest” check out this stackoverflow thread for some suggestion from more experienced people: https://unix.stackexchange.com/questions/122424/execute-a-command-on-user-logon

1 Like

Once again thank you for your guidance.

Turns out that because the desktop automatically logs in as pi user to run MagicMirror the best way I found to start mycroft-core was to call a

  • start.sh

Script in the

  • /home/pi/.config/lxsession/LXDE-pi/autostart

Here’s the script I added:

`#!/bin/bash
 #start.sh for starting mycroft-core

  Echo Waiting for MagicMirror to complete startup...

   Sleep 25

    Echo Starting Mycroft-core virtualenv...
   
   Sleep 5

    Cd /home/pi/mycroft-core/

    start-pulseaudio-x11

     ./start-mycroft.sh all

     Sleep 5

     ./start-mycroft.sh cli`

Not sure why I needed to add the start-pulseaudio-x11, but I couldn’t get it to work just by adding autospawn=yes to the pulseaudio config file.

I used nano (not sudo) to edit the autostart

  • nano /home/pi/.config/lxsession/LXDE-pi/autostart

To read:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@lxterminal -e "/home/pi/start.sh"

I also made the start.sh script executable by:

  • chmod +x /home/pi/start.sh

Anyway, thanks again for your help!

Now to start working on the mycroft MagicMirror skill to allow mycroft to control some basic functions of the MagicMirror modules.

Cheers!

3 Likes

Great writeup, @dmwilsonkc

@dmwilsonkc, thanks a lot for the write-up. Any update on the skills for MyCroft? Would love to use Mycroft for my smartmirror.

@svarto The skill is completely functional. I recommend reading this post: Creating my first skill with essentially no experience - Mycroft MagicMirror skill

That should give you a good understanding of how the skill works and how to install the skill and the required modules for MagicMirror.

I am hanging Christmas lights at the moment, but would be glad to answer any questions later.

Cheers!

@svarto There’s another post you should look at. I almost forgot. Testing and Feedback for Magic-Mirror-Voice-Control-Skill

Hopefully that will give you everything you need.

Cheers again!

Please help im !REALLY! new to all this iv followed your step’s (right i think) but when i go to start picroft i get the error

bash: ./dev-setup.sh: No such file or directory

please tell me what im doing wrong

Not sure why that is. Did you follow instructions here in post 17?

Yes mate followed every step am I running the set up up scripts right, I’m newbie to all this.

I think you have to cd into the directory where shat script is. I think this could do it

cd /home/pi/mycroft-core

andt then run

./dev_setup.sh

ok so im starting to see i need help installing the mycroft-core is anyone out there willing to help me please, as im at a loss iv reinstalled stretch as i think iv gone about this all wrong, iv got magicmirror installed.

thanks

I’m willing to help, but while I can help with the skill, my experience is limited as you can tell from my post. I have no experience with Stretch since i’m Running Debian Jesse. Also, i’m Running a previous version of MagicMirror.

Just from looking at your previous post, you were very close to succeeding, you just needed to start in the /home/pi/ folder when you started the process. That way the mycroft core will be within the “pi” user folder.

sorry for the questions just want to check a few things over before i start again :disappointed_relieved:

am i right in saying install virtualenv then make a folder with that -

pi/home/mycroft-core

and follow steps in post 17 using` pi/home/mycroft-core

then -

cd pi/home/mycroft-core

./dev_setup.sh

am i anywhere close with this please

@Jmh474 Is your MagicMirror set up to start automatically on reboot? If so, it should be starting as the Pi user. To avoid permission problems with mycroft, you need to install the virtualenv where the Pi user would have access to it. Which should be /home/pi/. So you need to be in the /Home/Pi/ folder when you execute the commands to install the Mycroft-core. If you read this entire post, you can see that I had this problem in the beginning and had to start over too.

@Jmh474 You should probably do a little research for your operating system. You said earlier you are using Stretch. You might want to check this out.

@Jmh474 From what I’ve been reading there are some differences between Jesse and Stretch that will probably make this nearly impossible for you to pull off on the same RPi as your Mirror. You may want to consider a seperate RPi with Mycroft, connected to the same network to control your Mirror. You could then install the appropriate Picroft Image on the 2nd RPi and then install the skills you’d like. Would be a much simpler process for sure. There are issues that you could avoid by doing that. Issues that I have been fighting like overheating, slower than expected performance, dependencies, updates etc. In fact, that is how I plan to update to the current MagicMirror and Mycroft on the stretch environment when I can get around to it.

I still think getting them both on the same RPi can be done, but I’m not sure it should be done.

So it can be done but I’m better installing Jesse nothing holding me to stretch, which would make life much simpler, I’m not really in a position to buy another pi :confused: as money is a little tight for me. So I was hoping to get them both running on the same pi

So I have a quick question don’t know if it’s a stupid thing to say or not but on the picroft image can’t we just add a gui using the raspbian light mod for pixel gui??

Well I know that it will work with Jesse (not Jesse lite like the Picroft image), because you need the full Jesse (with GUI) that you’ll need for MagicMirror. If you get the Jesse image, install it, then install MagicMirror, then follow the above steps to install the virtualenv, it will work.

Raspbian Jesse img

MagicMirror

Then follow this post

What RPi are you using. If it’s a RPi 3b+ you will have issues with Jesse.

See this post