Skip to content
Hugh Barnard edited this page Nov 17, 2022 · 38 revisions

Welcome to the mema3 wiki!

Build Your Own Mema3

This probably won't completely 'work', but I'll keep it updated. It will need an Ubuntu system with camera, microphone and speakers. Probably a USB webcam + microphone will work for some of it.

First git clone https://github.com/hbarnard/mema.git

Next Docker Installs for Rhasspy, Mimic3 and Node-Red.

Rhasspy

docker run -d -p 12101:12101 --name rhasspy --restart unless-stopped -v "$HOME/.config/rhasspy/profiles:/profiles" -v "/etc/localtime:/etc/localtime:ro" --device /dev/snd:/dev/snd rhasspy/rhasspy --user-profiles /profiles --profile en

Mimic3

This is the 'better' text to speech rather than, for example, espeak. It must be configured in Rhasspy as MaryTTS, a cheat, external http.

sudo docker run --privileged -d --restart unless-stopped -p 59125:59125 -v "${HOME}/.local/share/mycroft/mimic3:/home/mimic3/.local/share/mycroft/mimic3" 'mycroftai/mimic3'

This seems to work on the Pi4 but have problems with the Rhasspy interface on the Laptop. Therefore I've kept espeak on the Laptop for the moment, more robotic but lots of languages and very stable.

Node-Red

Docker install is broken on Raspberry Pi but should be OK elsewhere:

docker run -d -p 1880:1880 -v node_red_data:/data --restart unless-stopped --name mema_nodered nodered/node-red

I'm currently running it outside docker as a normal process on the Laptop, gives more access to debugging.

Docker note: You only want -it if debugging otherwise -d. `

Mosquitto

Started to use an external instance of this, rather than the one in Rhasspy. Gives more flexbility and also offloads some tasks from the centre. Also can examine and tune messages. Bit more complexity though.

Python3 and Libraries

I'll put these into a requirements file at some stage, but they haven't stabilised yet. Please use the classic method of letting Python complain about things that are missing. Some may also be surplus to requirements now, but there are no big libraries currently. ntlk may get used soon though.

import sys
import subprocess
import requests
import sqlite3
from pathlib import Path
from time import sleep
import board
import datetime
#import threading
import replicate
from picamera import PiCamera
# FastApi
from fastapi import FastAPI, Request
from fastapi import UploadFile, File, Form
from fastapi import APIRouter, Query, HTTPException
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware

Clone this wiki locally