小米摄像机升级失败,小米摄像机黄灯常亮修复,全网最硬核修复

小米摄像机升级失败,小米摄像机黄灯常亮修复,全网最硬核修复

背景

2020年买了个小米云台相机pro,后来搬家没怎么用,放家里吃灰一年多,前两天突然翻到想着拿来用一用,结果开机后提示要升级,我就点了升级,结果升级好重启后就一直没反应了,一直黄灯常亮。升级期间也没断电干啥的,结果就不能开机了。然后网上找方法说可以下载固件放到sd卡里重启就能恢复,结果试了下,几个小时过去了,也没能修好,于是打电话给小米客服,说可以寄过去帮忙修。东西寄过去两天后,售后来电话说试了不能用tf卡自动升级,要换主板,这个机器过了一年保修了,换主板要收80。然后我说这个主板硬件是好的,你能不能拆开来刷个固件修下,他说不行。听到这瞬间就来气了,主板肯定是好的,升级失败肯定是软件问题并不是硬件问题,我以我做软硬件工程师的经验来看,这绝对是软件的BootLoader有个bug,升级时写flash数据错误导致的。软件工程师的责任,出了问题居然要消费者来买单,这点责任都担不起,售后维修连个最基础的刷固件的方案都给不出,真的时失望至极,果断拒绝维修。不知道这个售后是真不会刷固件还是假的不会刷固件,还是说要以换主板的名义来收费,实际换主板的操作只是刷了个固件。收到相机后各种爬网找资料,找方法,看见遇到我这个问题的人不在少数,所以把我总结的方法分享给大家。

刷机方法

准备

  • linux系统的电脑,推荐使用ubuntu
  • 十字螺丝刀
  • 吹风机,或者热风枪
  • ch341a 编程器,没这个可以去淘宝买,几十块一个,如下图
    编程器

相机拆机

  1. 准备十字螺丝刀,热风枪
  2. 用吹风机把底部贴纸吹热,脚垫吹热,
  3. 趁热去除相机底部四个脚垫,脚垫里隐藏着四个螺丝,用十字螺丝刀拧下
  4. 趁热撕下贴纸,防止二维码损坏,坏了就不能扫码链接了,贴纸下也有一颗螺丝,直接拧下。
  5. 从底部往相机内部拆,遇到螺丝拆螺丝,遇到排线小心取下排线,最后把主板拆出来。

主板如下图所示
相机主板

下图所示的xh25l12833f是flash芯片,相机固件就存这里。
主板背面

修补固件

这里的主要思路是,将原相机损坏部分的数据通过其他能用的相机的完好的数据来替换,并且保留原相机数据。其实如果有其他相机的整个固件直接刷进去应该也能用,但是我估计会导致你的相机的序列号和别人的冲突。下面我也把修补好的固件分享给大家,供大家使用

  1. 连接相机,如下图所示,注意不要接反了,接反了编程器的红灯不会亮。
    在这里插入图片描述

  2. 读取原相机固件 ,得到backup.bin文件

 sudo apt update
 sudo apt install flashrom
 sudo flashrom -p ch341a_spi -r backup.bin -c MX25L12805D
  1. 去这里 下载对应相机的的恢复固件,我的型号是MJSXJ06CM,下载解压开得到tf_update.img
  2. 去网上找一个自己对应型号相机的能用的固件dumped_firmware.bin,我的MJSXJ06CM在这里找到的
  3. 使用binwalk工具分析backup.bin,tf_update.img,的内容
$ binwalk backup.bin 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
80649         0x13B09         xz compressed data
81388         0x13DEC         CRC32 polynomial table, little endian
327744        0x50040         xz compressed data
2424832       0x250000        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 7370730 bytes, 2104 inodes, blocksize: 131072 bytes, created: 2020-09-15 08:29:51
10158080      0x9B0000        JFFS2 filesystem, little endian
11804260      0xB41E64        JFFS2 filesystem, little endian
15387028      0xEAC994        JFFS2 filesystem, little endian
16646255      0xFE006F        Unix path: /usr/share/zoneinfo/Asia/Shanghai
$ binwalk tf_update.img 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
64            0x40            xz compressed data
2097152       0x200000        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 7370730 bytes, 2104 inodes, blocksize: 131072 bytes, created: 2020-09-15 08:29:51
9830400       0x960000        JFFS2 filesystem, little endian

说明:
这里的DECIMAL,代表十进制的起始地址,如要提取tf_update.img 中Squashfs filesystem文件系统,就在终端输入
dd if=tf_update.img of=rootfs.bin bs=1 count=7733248 skip=2097152
这里的skip代表起始地址,count代表读取内容的大小,bs代表块的大小设为1计算简单点一个块一个字节,通过下一个数据的起始地址减当前数据起始地址得到9830400-2097152 = 7733248

最后一个分区的count 使用文件大小的size来减去这个分区起始地址来计算

  1. 编辑一个脚本文件run.sh,根据以上分析内容,添加如下内容
#!/bin/bash
mkdir files
mkdir out
dd if=tf_update.img of=files/kernel.bin bs=1 count=2097152 skip=0 #从文件tf_update.img,读取从地址0开始,大小为2097152字节的数据
dd if=tf_update.img of=files/rootfs.bin bs=1 count=7733248 skip=2097152 #读取从地址2097152开始,大小为7733248字节的数据
dd if=tf_update.img of=files/data.bin bs=1 count=6488144 skip=9830400
dd if=dumped_firmware.bin of=files/vendor1.bin bs=1 count=131072 skip=16646144 
dd if=backup.bin of=files/vendor2.bin bs=1 count=65536 skip=16711680

cp dumped_firmware.bin -f out/flash.bin 

dd if=files/kernel.bin of=out/flash.bin bs=1 count=2097152 seek=327680 # 把数据kernel.bin从地址327680覆盖2097152个数据到flash.bin
dd if=files/rootfs.bin of=out/flash.bin bs=1 count=7733248 seek=2424832
dd if=files/data.bin of=out/flash.bin bs=1 count=6488144 seek=10158080
dd if=files/vendor1.bin of=out/flash.bin bs=1 count=131072 seek=16646144 #这里的seek由上面data的地址加数据大小得到10158080 + 6488144 = 16646144
dd if=files/vendor2.bin of=out/flash.bin bs=1 count=65536 seek=16711680 

注意:型号是如果是MJSXJ06CM的相机这个脚本可以直接使用,如果是其他型号,需要对照着修改以上参数,flash.bin的数据大小必须保证为16,777,216字节。

  1. 执行修复固件,将上面准备的文件run.sh dumped_firmware.bin tf_update.img backup.bin 放在同一个文件夹下,在终端输入sh run.sh,等待脚本执行完毕,在文件夹out下找到flash.bin,即为修好的固件。

刷入固件

直接在终端执行

$ sudo flashrom -p ch341a_spi -w  out/flash.bin -c MX25L12805D

如果嫌麻烦,并且和我的相机型号一样,同为MJSXJ06CM的也可以直接刷我修补好的固件,放心没有添加任何后门程序的哈。
上一步操作执行完后装机,不出意外相机应该能正常启动了。

破解相机

破解相机,登录相机后台,参考连接

A firmware hack is possible, but requires some tools:

CH341A flash programmer
SOIC8 clip and some dupont wires
Complete device teardown
Basic steps are:

Create a flash backup:
flashrom -p ch341a_spi -r backup.bin

Download the firmware and put it into the same folder.

Run this script to patch the backup:

#!/bin/bash
# extract firmware
mkdir -p files
dd if=tf_recovery.img of=files/kernel.bin bs=1 count=2097152
dd if=tf_recovery.img of=files/rootfs.bin bs=1 count=7733248 skip=2097152
dd if=tf_recovery.img of=files/data.bin bs=1 count=6488064 skip=9830400
dd if=backup.bin of=files/vendor.bin bs=1 count=131072 skip=16646144

# patch jffs2 partition
sudo modprobe mtdblock
sudo modprobe mtdram total_size=6336
sudo dd if=files/data.bin of=/dev/mtdblock0 bs=1
mkdir mount
sudo mount -t jffs2 /dev/mtdblock0 mount
echo '#!/bin/sh' | sudo tee -a mount/bin/log_diag_platform.sh
echo '/mnt/sdcard/override.sh' | sudo tee -a mount/bin/log_diag_platform.sh
sudo chmod 755 mount/bin/log_diag_platform.sh
sudo umount mount
rmdir mount
sudo dd if=/dev/mtdblock0 of=files/data.bin bs=1

# update flash backup
mkdir -p out
cp backup.bin -f out/flash.bin
dd if=files/kernel.bin of=out/flash.bin bs=1 count=2097152 seek=327680
dd if=files/rootfs.bin of=out/flash.bin bs=1 count=7733248 seek=2424832
dd if=files/data.bin of=out/flash.bin bs=1 count=6488064 seek=10158080
dd if=files/vendor.bin of=out/flash.bin bs=1 count=131072 seek=16646144
Re-flash the modified backup:
flashrom -p ch341a_spi -w out/flash.bin

Prepare the sdcard script:

/sdcard/override.sh

#!/bin/sh
main() {
  # start telnet
  /mnt/sdcard/busybox telnetd
}

if [ ! -f /tmp/.override ]; then
 touch /tmp/.override
 main
fi
Press the reset button (briefly) on the camera to launch the override script.
### MJSXJ07HL Firmware Download and Installation Guide For devices requiring the MJSXJ07HL firmware, ensuring proper functionality involves downloading and installing this specific version of firmware correctly. The process typically includes several key stages. #### Preparation Before Installation Before proceeding with the firmware update, it is important to ensure that all necessary drivers such as `ice` and `irdma` are properly installed and configured on the system[^1]. These drivers facilitate communication between hardware components and the operating system, which can be crucial during a firmware upgrade operation. #### Obtaining the Correct Firmware Version To obtain the correct firmware file for model MJSXJ07HL, visit the official support website or repository dedicated to maintaining software updates for compatible network adapters. Search specifically using keywords like "MJSXJ07HL firmware". Ensure downloads come from trusted sources only to avoid potential security risks associated with unofficial versions. #### Performing the Update Process Once downloaded, follow any provided documentation closely when performing the actual installation. Typically, executing an executable script or running commands via command line interface may apply depending upon platform specifics. For Linux systems especially, having administrative privileges might also prove necessary while applying changes at low levels within device configurations. ```bash sudo ./install_firmware.sh /path/to/MJSXJ07HL.fw ``` This example assumes there exists an installer named `install_firmware.sh`, where `/path/to/MJSXJ07HL.fw` represents the location path containing your newly acquired firmware image file. After completing these procedures successfully, rebooting the machine ensures new settings take effect immediately without residual issues lingering over previous states before updating took place.
评论 39
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值