《开源精选》是我们分享Github、Gitee等开源社区中优质项目的栏目,包括技术、学习、实用与各种有趣的内容。本期推荐的MagicMirror²是一个开源的模块化智能镜子平台。
MagicMirror 是一个开源的模块化智能镜子平台。随着可安装模块列表的增加, MagicMirror²可让您将走廊或浴室镜子转换为您的个人助理。
硬件
MagicMirror² 是为在 Raspberry Pi 上运行而开发的。它可能(并且将会)在各种不同类型的硬件上运行,但新版本只能在 Raspberry Pi 上进行测试。
Electron是 MagicMirror² 的应用程序包装器,仅支持 Raspberry Pi 2、3 和 4。目前不支持 Raspberry Pi 0/1。如果您想在 Raspberry Pi 1 上运行它,请使用仅服务器功能并自己设置全屏浏览器。
操作系统
请注意,您需要安装最新的完整版 Raspbian,不要使用 Lite 版本。
节点
虽然旧版本的 Node 可能会工作,但我们建议您使用 Node 16。
手动安装
自动安装脚本
sudo apt install libffi-dev nginx-full -ypython3 -m pip install --upgrade --no-cache-dir mmpmmmpm --guided-setupecho 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
码头工人形象
Kubernetes Helm 图表
魔镜操作系统
这是一个基于 Raspbian 的完整操作系统。
要求
MagicMirrorOS 可以使用在英特尔或 RaspberryPi 上运行的 docker 构建(列出了支持的)。构建需要大约 4.5 GB 的可用空间。您可以假设您已经安装了 docker 和 docker-compose 并发出以下命令来构建它:
git 克隆 https://github.com/guysoft/MagicMirrorOS.gitcd MagicMirrorOS/src/imagewget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_armhf_latest'光盘..sudo docker-compose up -dsudo docker exec -it magicmirroros-build build
MagicMirrorOS 支持构建变体,这些变体是在主版本构建中进行了更改的构建。文件夹中提供了示例和其他变体src/variants/example。
要构建变体,请使用:
sudo docker exec -it magicmirroros-build build [变体]
有一个 vagrant 机器配置可以让您构建 MagicMirrorOS,以防您的构建环境表现不同。除非您进行额外配置,否则 vagrant 必须以 root 身份运行才能使 nfs 文件夹同步工作。
要使用它:
sudo apt-get install vagrant nfs-kernel-serversudo vagrant 插件安装 vagrant-nfs_guestsudo modprobe nfscd MagicMirrorOS/src/vagrantsudo vagrant up
配置机器后,还可以运行从 devel 更新的每晚构建,使用:
cd MagicMirrorOS/src/vagrantrun_vagrant_build.sh
要在机器上构建一个变体,只需运行:
cd MagicMirrorOS/src/vagrantrun_vagrant_build.sh [变体]
视窗:
要让 MagicMirror 软件在 Windows 上运行,除了上述步骤之外,您还需要做两件事:
4a。在供应商和字体目录中安装依赖项:
电源外壳:
命令提示符:
否则启动 MagicMirror 时屏幕将保持黑色。
5a。修复文件中的启动脚本package.json:
如果您想将您的 MagicMirror² 更新到最新版本,请使用您的终端转到您的 Magic Mirror 文件夹并输入以下命令:
git pull && npm install --only=prod --omit=dev
键入git status以查看您的更改,如果有任何更改,您可以使用 重置它们git reset --hard。在那之后,git pull应该是可以的。
该clock模块是魔镜的默认模块之一。此模块显示当前日期和时间。信息将实时更新。
截屏
使用模块
要使用此模块,请将其添加到config/config.js文件中的 modules 数组中:
modules: [ { module: "clock", position: "top_left", // This can be any of the regions. config: { // The config property is optional. // See 'Configuration options' for more information. }, },];
该calendar模块是魔镜的默认模块之一。此模块显示来自公共 .ical 日历的事件。它可以组合多个日历。
使用模块
要使用此模块,请将其添加到config/config.js文件中的 modules 数组中:
modules: [ { module: "calendar", position: "top_left", // This can be any of the regions. Best results in left or right regions. config: { // The config property is optional. // If no config is set, an example calendar is shown. // See 'Configuration options' for more information. }, },];
该currentweather模块是魔镜的默认模块之一。该模块显示当前天气,包括风速、日落或日出时间、温度和显示当前状况的图标。
截屏
使用模块
要使用此模块,请将其添加到config/config.js文件中的 modules 数组中:
modules: [ { module: "currentweather", position: "top_right", // This can be any of the regions. // Best results in left or right regions. config: { // See 'Configuration options' for more information. location: "Amsterdam,Netherlands", locationID: "", //Location ID from https://bulk.openweathermap.org/sample/city.list.json.gz appid: "abcde12345abcde12345abcde12345ab", //openweathermap.org API key. }, },];
截图
使用模块
要使用此模块,请将其添加到config/config.js文件中的 modules 数组中:
modules: [ { module: "weatherforecast", position: "top_right", // This can be any of the regions. // Best results in left or right regions. config: { // See 'Configuration options' for more information. location: "Amsterdam,Netherlands", locationID: "", //Location ID from https://bulk.openweathermap.org/sample/city.list.json.gz appid: "abcde12345abcde12345abcde12345ab", //openweathermap.org API key. }, },];
模块结构
所有模块都加载到modules文件夹中。modules/default默认模块在文件夹中组合在一起。您的模块应放置在modules. 请注意,您在文件夹中创建的任何文件或文件modules夹都将被 git 忽略,从而允许您升级 MagicMirror² 而不会丢失文件。
一个模块可以放在一个文件夹中。或者可以将多个模块分组到一个子文件夹中。请注意,模块的名称必须是唯一的。即使将具有相似名称的模块放在不同的文件夹中,也无法同时加载它们。
文件
—END—
开源协议:MIT License
开源地址:https://github.com/MichMich/MagicMirror
留言与评论(共有 0 条评论) “” |