首页 >>  正文

cm311-1sa短接点

来源:baiyundou.net   日期:2024-09-24

作者:营在北京

前面写过《28元玩客云玩转ha》,可能有网友感觉玩客云配置太低了,想用性能更好的设备安装homeassistant来玩转智能家居。今天就给大家带来CM311-1A及M401A、斐讯N1等设备安装home assistant的教程。


一、刷可以USB启动的安卓固件


无论是斐讯N1还是CM311-1A或M401A,大家拿到手的时候固件可能各种各样的都有,所以很难统一给大家写一份教程。但总结起来无非就是安卓固件可以开启adb,然后通过adb输入reboot update或用开心助手连接后选择U盘启动,让设备从U盘启动。

对于N1大家可以选择webpad的2.2固件。对于CM311-1A或M401A大家可以选择网上的CM311-1a_安卓9-S905L3A没无线版沙发桌面线刷包.img刷机包。下面是详细过程。


1、下载安卓线刷包和刷机工具


刷机需要准备线刷固件包,CM311-1A可用的固件包,主要有CM311-1a_安卓9-S905L3A没无线版沙发桌面线刷包.img,线刷CM311-1A和线刷N1一样(毕竟他们都是晶晨S905系CPU) 需要刷机软件Amlogic_USB_Burning_Tool_v2.2.0和双公头USB线


2、加载刷机包


打开Amlogic_USB_Burning_Tool并加载线刷包,并插上双公头USB线,一端插电脑,一端插电视盒子靠近网口的USB


勾选 “擦除flash”和“擦除bootloader”,然后点击开始即可




3、刷机


短接进入线刷模式

拆开设备底部螺丝,拆除电路板,找到4R32用镊子或导线短接,保持短接的同时给机顶盒上电



刷机软件就可以开始刷机了



等待刷机完成,点击停止并拔下USB线和机顶盒电源即可




4、重新上电开机


刷完机之后开机界面如下,进入设置找到CM311-1A或M401A的IP地址待用




二、做U盘armbian固件



1、下载ophub大佬做的armbian固件


ophub大佬的armbian项目支持的设备越来越多,比如常见的斐讯N1或T1,还有最近比较火的M401A及CM311-1A。


从下图网址下载我们要用的CM311-1A固件




2、解压写入U盘


把前面下载的固件解压后用win32diskimager软件写入U盘



修改dtb文件



因为我刷机的设备型号为M401A,所以dtb改为了meson-g12a-s905l3a-m401a.dtb


保存修改然后弹出U盘备用


三、写入emmc



1、putty连接设备


打开开心助手,输入刚才看到的设备IP。点击连接进行连接



连接成功如下图所示




2、USB启动


按照下图选择调试晶晨芯片从U盘/SD卡启



等关机后迅速把前面准备的armbian系统U盘插到盒子USB口

设备会重启,重启后显示屏会跑码显示armbian启动过程


3、写入emmc


等显示器显示启动完成后,输入账号root,密码1024回车或者电脑putty连接盒子





然后再输入armbian-install回车



我的设备是M401A,所以我选择306回车,然后选择文件格式1回车



写入完成后如下图所示



然后可以输入poweroff回车关机了,关机后拔掉U盘重新上电开机即可


四、安装homeassistant



1、换源


可以直接给设备接上键盘和显示器直接操作,也可以在电脑上用putty连接盒子。我以putty连接设备为例操作



输入账号root密码1024后回车



nano /etc/apt/sources.list

删掉原来的内容粘贴如下内容

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse

2、安装必须的软件


apt update
apt install -y  python3-dev  python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev libpcap-dev tzdata




3、创建用户


useradd -rm ha -G dialout
passwd ha
usermod -aG sudo ha


4、创建虚拟环境


mkdir /srv/ha
chown ha:ha /srv/ha
sudo -u ha -H -s


pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
cd /srv/ha
python3 -m venv .
source bin/activate




5、安装homeassistant


继续输入下面的命令安装homeassistant

python3 -m pip install wheel
pip3 install homeassistant



安装成功后如下图所示



输入下面的命令启动homeassistant

hass

此时在同一局域网内的电脑浏览器输入盒子IP:8123,会出现如下创建ha的账号,按提示完成ha账号注册登录




启动完成后输入下面的命令退出




按下ctrl+C终止当前命令
deactivate
su


6、配置自启动


nano /etc/systemd/system/[email protected]

然后粘贴如下内容

[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/ha/bin/hass -c "/home/%i/.homeassistant"
RestartForceExitStatus=100
[Install]
WantedBy=multi-user.target

输入下面的命令让ha自启动服务生效

systemctl --system daemon-reload
systemctl enable home-assistant@ha
systemctl restart home-assistant@ha


五、搞定蓝牙



1、winscp上传蓝牙文件到设备




先上传蓝牙所需文件rtl8761b_config





再上传rtk_hciattach文件



然后赋予该文件执行权限




添加开机自动设置蓝牙程序 



ctrl+X 退出Y回车保存退出


2、安装蓝牙软件


在命令行输入armbian-config回车

按下图安装蓝牙软件






3、重启


蓝牙出现了



ha蓝牙自动发现的小米蓝牙设备






总结


CM311-1A和M401A等设备2+16G的配置比玩客云的1+8高了一倍,非常适合用来安装homeassistant开源智能家居,并且自带蓝牙,可以作为蓝牙网关,把小米米家蓝牙传感器设备接入homeassistant成为超级中枢网关。

本文为homeassistant玩转智能家居文章的第二篇

第一篇《28元玩客云玩转全屋智能-安装homeassistant最新版保姆教程》主要介绍了我们为什么需要homeassistant以及玩客云安装homeassistant的方法

","gnid":"95f924e8db19b4cb1","img_data":[{"flag":2,"img":[{"desc":"","height":"422","title":"","url":"https://p0.ssl.img.360kuai.com/t01685284e4572bcd12.webp","width":"600"},{"desc":"","height":"422","title":"","url":"https://p0.ssl.img.360kuai.com/t011e29a7059ce71c45.webp","width":"600"},{"desc":"","height":"422","title":"","url":"https://p0.ssl.img.360kuai.com/t01e2ce9719aa2f5e1f.webp","width":"600"},{"desc":"","height":"478","title":"","url":"https://p0.ssl.img.360kuai.com/t01a0d476538b62424a.webp","width":"600"},{"desc":"","height":"418","title":"","url":"https://p0.ssl.img.360kuai.com/t0186f281f506019f92.webp","width":"600"},{"desc":"","height":"422","title":"","url":"https://p0.ssl.img.360kuai.com/t01075b865e28c0af72.webp","width":"600"},{"desc":"","height":"338","title":"","url":"https://p0.ssl.img.360kuai.com/t01339e371df9c162a5.webp","width":"600"},{"desc":"","height":"369","title":"","url":"https://p0.ssl.img.360kuai.com/t018169abc177c1c785.webp","width":"600"},{"desc":"","height":"375","title":"","url":"https://p0.ssl.img.360kuai.com/t01c3b14d50ef8bd3bf.webp","width":"600"},{"desc":"","height":"295","title":"","url":"https://p0.ssl.img.360kuai.com/t01c98a7aec86c0cc36.webp","width":"600"},{"desc":"","height":"340","title":"","url":"https://p0.ssl.img.360kuai.com/t011b0d1374cd0da408.webp","width":"480"},{"desc":"","height":"307","title":"","url":"https://p0.ssl.img.360kuai.com/t01b0c35dc72ca38413.webp","width":"600"},{"desc":"","height":"262","title":"","url":"https://p0.ssl.img.360kuai.com/t010401c0a0034df290.webp","width":"531"},{"desc":"","height":"395","title":"","url":"https://p0.ssl.img.360kuai.com/t0199981265bdf8f096.webp","width":"600"},{"desc":"","height":"399","title":"","url":"https://p0.ssl.img.360kuai.com/t01d43db5832af6a972.webp","width":"600"},{"desc":"","height":"398","title":"","url":"https://p0.ssl.img.360kuai.com/t013bfd952cf6ba9c8b.webp","width":"600"},{"desc":"","height":"540","title":"","url":"https://p0.ssl.img.360kuai.com/t01d500b75717fc928d.webp","width":"600"},{"desc":"","height":"323","title":"","url":"https://p0.ssl.img.360kuai.com/t015acc038a02f7c51e.webp","width":"600"},{"desc":"","height":"266","title":"","url":"https://p0.ssl.img.360kuai.com/t01b5c613e501120871.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t0137ecaceb1e438e38.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t01098f76d0213f315e.webp","width":"600"},{"desc":"","height":"540","title":"","url":"https://p0.ssl.img.360kuai.com/t01d500b75717fc928d.webp","width":"600"},{"desc":"","height":"230","title":"","url":"https://p0.ssl.img.360kuai.com/t01debee0a8df932fa9.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t01befd2e9122a3e18f.webp","width":"600"},{"desc":"","height":"205","title":"","url":"https://p0.ssl.img.360kuai.com/t01d7f596f2d9dec4da.webp","width":"600"},{"desc":"","height":"220","title":"","url":"https://p0.ssl.img.360kuai.com/t010be9593174b15d6a.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t01830a7d4f48aa2a97.webp","width":"600"},{"desc":"","height":"321","title":"","url":"https://p0.ssl.img.360kuai.com/t01262dcddd8fcd2cd7.webp","width":"600"},{"desc":"","height":"293","title":"","url":"https://p0.ssl.img.360kuai.com/t0101efa5c212bd5786.webp","width":"600"},{"desc":"","height":"293","title":"","url":"https://p0.ssl.img.360kuai.com/t01a76672f04af07b2a.webp","width":"600"},{"desc":"","height":"406","title":"","url":"https://p0.ssl.img.360kuai.com/t012789a73ada90056a.webp","width":"600"},{"desc":"","height":"481","title":"","url":"https://p0.ssl.img.360kuai.com/t01f474238aa5eda04f.webp","width":"600"},{"desc":"","height":"481","title":"","url":"https://p0.ssl.img.360kuai.com/t011b37ed77b472724a.webp","width":"600"},{"desc":"","height":"361","title":"","url":"https://p0.ssl.img.360kuai.com/t013c28b614f054b0a6.webp","width":"600"},{"desc":"","height":"156","title":"","url":"https://p0.ssl.img.360kuai.com/t01b07944256a15df3d.jpg","width":"600"},{"desc":"","height":"361","title":"","url":"https://p0.ssl.img.360kuai.com/t016039fe0b6f226978.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t019d98cb44e3d20a66.webp","width":"600"},{"desc":"","height":"292","title":"","url":"https://p0.ssl.img.360kuai.com/t0104da5d1040b1b3ca.webp","width":"600"},{"desc":"","height":"293","title":"","url":"https://p0.ssl.img.360kuai.com/t014e5bfb2df4771e21.webp","width":"600"},{"desc":"","height":"293","title":"","url":"https://p0.ssl.img.360kuai.com/t01d85be00ff8db3249.webp","width":"600"},{"desc":"","height":"370","title":"","url":"https://p0.ssl.img.360kuai.com/t012fb3a0644e1e2e30.webp","width":"600"}]}],"original":0,"pat":"otherc,xmc,art_src_1,fts0,sts0","powerby":"hbase","pub_time":1681873813000,"pure":"","rawurl":"http://zm.news.so.com/a6933129fd9c56eba3ca6b475618f0cf","redirect":0,"rptid":"5bffd31ee58e532a","rss_ext":[],"s":"t","src":"什么值得买","tag":[{"clk":"kdigital_1:智能家居","k":"智能家居","u":""},{"clk":"kdigital_1:小米","k":"小米","u":""}],"title":"CM311-1A M401A变身超级智能家居中枢homeassistant,还要什么小米蓝牙中枢网关

崔蒋吕8404g流量卡插CM311笔记本电脑连接了网速快不快
刘元毛19423062893 ______ 您好,这个要看在什么地方使用,和什么时间使用.首先我们要明确知道无线的网速肯定相对于有线要慢很多,因为无线传送数据丢失率会比较高.中国目前只有一线城市和少数二线城市有支持4G无线网络.如在上海市内 和 北京市内 与农村 山沟沟里相比,肯定是城市的速度快很多.另外一个就是网络高峰期时对流量速度也是有影响的.这样给您分析之后.您还有什么问题吗? 希望我的回答对您有所帮助

崔蒋吕840mifi中国移动cm311支持联通3g吗? -
刘元毛19423062893 ______ cm311是移动自有品牌产品,支持移动4G 3G 2G 网络,不支持联通3G.wifi速率70M,支持10人同时上网.

崔蒋吕840分析说明运行中的电流互感器二次为何不能开路?若开路怎么处理?
刘元毛19423062893 ______ 电流互感器一次绕组匝数少,使用时一次绕组串联在被测线路里,二次绕组匝数多,... 故障点应该就在短接点以下的回路中,可进一步查找.若短接时没有火花,则可能短...

崔蒋吕840中国移动cm311无线移动数据终端后盖如何打开 -
刘元毛19423062893 ______ 貌似充电用的USB接口旁边有个凹口,用指甲扣住这个地方就可以了啊.我就是这样开的.

崔蒋吕840为什么使用移动MIFI设备CM311?为什么使用移动MIFI设备
刘元毛19423062893 ______ 上网伴侣(MIFI)一款硬件设备,其作用是将移动网络发射的TD(3G)通信信号转化为WIFI信号,供各类具备接收WIFI信号的通信设备(如笔记本、智能手机、PSP等)使用,使其达到无线高速上网的目的.

崔蒋吕840cm311 - 1和cm311 - 1a区别 -
刘元毛19423062893 ______ CM311-1A 硬件配置:CPU【四核2Ghz S905-L3A】容量【2G RAM+16G ROM 】网口【百兆网口】wifi【无wifi】蓝牙【有】USB【2.0*2个】 电源【12V1A】CM311-1硬件配置:CPU【四核2Ghz S905-L3】 容量【2G RAM+8G ROM 】 网口【百兆】wifi【有wifi】蓝牙【有】

崔蒋吕840SLECT在行场扫描中是什么作用叫什么
刘元毛19423062893 ______ 短接点(英文标记为SLECT)

崔蒋吕840移动cm311怎么查流?移动cm311怎么查流量
刘元毛19423062893 ______ 编辑短信“查流量”发送到10086就可以了

(编辑:自媒体)
关于我们 | 客户服务 | 服务条款 | 联系我们 | 免责声明 | 网站地图 @ 白云都 2024