Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
400 commits
Select commit Hold shift + click to select a range
deb0eed
merging_conf
gysmo38 Jun 11, 2020
a2650a7
Update unpacker.py
gadget78 Jun 12, 2020
a756ab1
Merge pull request #1491 from gadget78/patch-1
jmtatsch Jun 12, 2020
f4f0e5b
Multi delete files
gysmo38 Jun 14, 2020
14adf5e
Merge pull request #1495 from gysmo38/ui_multidelete
jmtatsch Jun 14, 2020
b3d0281
Merge pull request #1489 from gysmo38/mergeconfig
jmtatsch Jun 14, 2020
abb6407
Add flip button on live ptz
gysmo38 Jun 15, 2020
2064bf6
Merge pull request #1496 from gysmo38/ui_flipimage
jmtatsch Jun 15, 2020
7aa5231
Bug fix OSD
gysmo38 Jun 15, 2020
970d809
Merge pull request #1498 from gysmo38/ui_osd
jmtatsch Jun 15, 2020
5f6bb0d
Change rtsp and autoupdate
gysmo38 Jun 16, 2020
86a3906
Change pid filename for UI service
gysmo38 Jun 17, 2020
1f87fea
Bug fix in merge script
gysmo38 Jun 18, 2020
e8eae2f
Compact storage motion settings page
gysmo38 Jun 18, 2020
52bb5f4
Bug fix in sending path
gysmo38 Jun 18, 2020
cc31a29
Merge pull request #1499 from gysmo38/ui_video
jmtatsch Jun 18, 2020
81d0390
Correct bug while setting maxSameScenCut from v4l2rtspserver-master.ini
nik0 Jun 21, 2020
cbace4f
Merge pull request #1507 from nik0/beta
nik0 Jun 21, 2020
29ae390
Use the full chain instead of only the certificate
mjrider Jun 21, 2020
652365d
Merge pull request #1510 from mjrider/patch-1
jmtatsch Jun 21, 2020
5f0b207
Adding motion events graph
andrempo Jun 23, 2020
d8c0b26
Fix html
andrempo Jun 23, 2020
f29a6f1
Fix wrong identation
andrempo Jun 23, 2020
0e033fa
Merge pull request #1518 from andrempo/beta
jmtatsch Jun 23, 2020
ecb0b74
Check branch from VERSION File
gysmo38 Jun 27, 2020
535065f
Merge pull request #1524 from gysmo38/mqtt_update
jmtatsch Jun 27, 2020
90817ef
hard crash on if [[ ${i: -3}... replaced with find
fundef1 Jul 6, 2020
8021f27
Merge pull request #1 from fundef1/fundef1-run.sh-userscripts
fundef1 Jul 6, 2020
2c2990b
Merge pull request #1531 from fundef1/master
jmtatsch Jul 6, 2020
7059874
Merge beta into master (#1415)
jmtatsch May 8, 2020
22fe3b5
New binaries:
nik0 Apr 8, 2020
ce1ae5a
Manage FPS for MJPG
nik0 Apr 10, 2020
8130c1c
Dropbear new version (#1348)
nik0 Apr 11, 2020
52788c2
New version of dropbear
nik0 Apr 13, 2020
37ccab1
New version of server:
nik0 Apr 13, 2020
d231631
Add mod_alias to lighttpd
nik0 Apr 13, 2020
a891a5a
New binaries:
nik0 Apr 8, 2020
aa17555
Manage FPS for MJPG
nik0 Apr 10, 2020
f5e985f
Dropbear new version (#1348)
nik0 Apr 11, 2020
45926be
Merge dropbearmulti
nik0 Apr 13, 2020
10fef84
New version of server:
nik0 Apr 13, 2020
459615c
Add mod_alias to lighttpd
nik0 Apr 13, 2020
18dae07
Motion detection was not working if reduce pool was activated
nik0 Apr 18, 2020
bf13fcf
Update openRTSP according to last version of Live555 libs (#1383)
nik0 Apr 27, 2020
eef192f
Merge stuff into beta that should have went there all along (#1393)
jmtatsch Apr 30, 2020
d7ff110
Add topic update to start update from mqtt (#1399)
jmtatsch May 1, 2020
8afd18c
Rebased on latest version on https://github.com/mpromonet/v4l2rtspserver
nik0 May 2, 2020
4b8ef01
Update openRTSP according to last version of Live555 libs
nik0 Apr 26, 2020
0780fc8
Rebased on latest version on https://github.com/mpromonet/v4l2rtspserver
nik0 May 2, 2020
798af91
OSD improvment
nik0 May 6, 2020
09909b5
new ui proposal
gysmo38 May 5, 2020
9627122
State side finish
gysmo38 May 5, 2020
f9d9477
Control and system config page finish :)
gysmo38 May 8, 2020
8a94ef9
Add link to switch between ui
gysmo38 May 8, 2020
64a1100
Finish cam settings, motion detection & soft night
gysmo38 May 9, 2020
672ce45
remove slider css for now
gysmo38 May 9, 2020
a85f0d8
Finish status pages.
gysmo38 May 10, 2020
7c017d2
Service page ok.
gysmo38 May 11, 2020
ff574d9
update page finish
gysmo38 May 12, 2020
d51434e
New UI first release ready :)
gysmo38 May 14, 2020
ea9f2f3
Bug fixes
gysmo38 May 21, 2020
51fb381
Fix bug in camera settings
gysmo38 May 22, 2020
152f8b7
reduce font awesome foorprint
gysmo38 May 22, 2020
dbbc452
Change FPS calulation
nik0 May 23, 2020
d31d196
Manage several detection region
nik0 May 23, 2020
5d306a1
Finish motion detection page with multi zones detection
gysmo38 May 24, 2020
936fc5f
Finish net services page
gysmo38 May 24, 2020
e4adda9
Add notification and check filesystem status
gysmo38 May 25, 2020
a13f7d7
Improve SD Card files
gysmo38 May 25, 2020
bb3d289
Improve SD Card pages
gysmo38 May 26, 2020
5ef7691
New footer with theme selection
gysmo38 May 26, 2020
afa03ec
Bug fixes
gysmo38 May 27, 2020
3a34439
Add accordion in Update page
gysmo38 May 27, 2020
0518e44
Bug fixes in dark theme css
gysmo38 May 28, 2020
1470b6c
Adding reboot redirection on control page
gysmo38 May 28, 2020
005fb59
Update control.html
jmtatsch May 28, 2020
3d93cae
Update index2.html
jmtatsch May 28, 2020
9230eed
Update control.js
jmtatsch May 28, 2020
a2ee96c
Add flash_eraseall to busybox
nik0 May 28, 2020
41d1b8e
Improvements
gysmo38 May 28, 2020
f6e1baf
Change page title to hostname
gysmo38 May 28, 2020
53cbc0e
sliders update
gysmo38 May 29, 2020
49ee94a
Add record icon on camera image
gysmo38 May 29, 2020
705c3e9
Text updates and grammer changes
Combie81 May 29, 2020
468de4d
Bug fix autostart control
gysmo38 May 30, 2020
5548ab5
Moving config entries/cleanup
Combie81 May 30, 2020
e57d467
Update telegram.conf.dist
Combie81 May 31, 2020
d489ad0
Update camera.js
Combie81 May 31, 2020
92b7105
Add Backup/Restore function
gysmo38 May 30, 2020
3a37e57
Bug fix in net services and mqtt control service
gysmo38 May 30, 2020
2312d1b
New UI as main + Clean previous UI
gysmo38 Jun 2, 2020
b6a380d
New lighttpd with setenv mod
nik0 Jun 7, 2020
2fc981e
v4l2rtspserver-master update
nik0 Jun 7, 2020
af52ce4
Add toggle for control
gysmo38 Jun 7, 2020
5a53c53
Change pid filename
gysmo38 Jun 7, 2020
c691f86
Multi delete files
gysmo38 Jun 14, 2020
1d817a5
merging_conf
gysmo38 Jun 11, 2020
a363ce8
Add flip button on live ptz
gysmo38 Jun 15, 2020
a1c08ba
Bug fix OSD
gysmo38 Jun 15, 2020
1e2f966
Change rtsp and autoupdate
gysmo38 Jun 16, 2020
895ff32
Change pid filename for UI service
gysmo38 Jun 17, 2020
bef6c75
Bug fix in merge script
gysmo38 Jun 18, 2020
341bc2e
Compact storage motion settings page
gysmo38 Jun 18, 2020
0e07651
Bug fix in sending path
gysmo38 Jun 18, 2020
dbddfc0
Correct bug while setting maxSameScenCut from v4l2rtspserver-master.ini
nik0 Jun 21, 2020
58514bc
Adding motion events graph
andrempo Jun 23, 2020
474ed26
Fix html
andrempo Jun 23, 2020
942aa37
Fix wrong identation
andrempo Jun 23, 2020
d33209f
Check branch from VERSION File
gysmo38 Jun 27, 2020
c63a43a
rebase beta on master
jmtatsch Jul 16, 2020
bcfe0b4
Correct problem with multiple detection areas
nik0 Jul 16, 2020
3199829
Merge pull request #1538 from nik0/beta
nik0 Jul 16, 2020
d7f82ea
Minor memory/cpu usage improvement
mjrider Jul 20, 2020
c49946e
Merge pull request #1541 from mjrider/patch-1
jmtatsch Jul 30, 2020
53fda01
Update run.sh
mariorossi77 Aug 5, 2020
138d0a9
Bug fix for multi areas and trash img
gysmo38 Aug 5, 2020
32a82b7
Merge pull request #1552 from gysmo38/motion
jmtatsch Aug 5, 2020
0f34248
Fixes the disk_space information gathering command
zyph00 Aug 21, 2020
cfb2cd5
Merge pull request #1558 from thmspl/patch-1
jmtatsch Aug 21, 2020
e08af9f
Add list view for captured motion files
Aug 24, 2020
2ce34a7
Merge pull request #1560 from magnealvnor/view_motion
jmtatsch Aug 24, 2020
62781e5
Set expiration date of 2038 for cookies
mikeage Aug 25, 2020
5c07eb3
Merge pull request #1562 from mikeage/cookie_expiration
jmtatsch Aug 25, 2020
6bbbdea
Correcting motion link
Douuuglas Sep 1, 2020
52a1f71
Merge pull request #1566 from Douuuglas/master
jmtatsch Sep 1, 2020
dcfa5b8
Merge pull request #1551 from im-deep/patch-1
jmtatsch Sep 1, 2020
64f219b
Add t20l drivers and uenv mem allocation
jmtatsch Sep 8, 2020
54da4d5
Write down additional instructions for the T20L
juriansluiman Sep 9, 2020
5930f05
Update install docs for T20L
juriansluiman Sep 9, 2020
8c176df
Fix link text
juriansluiman Sep 9, 2020
c2b7864
Add T20L to README
juriansluiman Sep 9, 2020
1169b21
Merge pull request #1568 from juriansluiman/T20L-docs
jmtatsch Sep 9, 2020
486362c
Update mqtt-autodiscovery.sh
stoickish Sep 12, 2020
2946d03
Merge pull request #1572 from stoickish/master
jmtatsch Sep 12, 2020
1127052
Adds the current motor position to the api systeminfo. (#1579)
zyph00 Sep 15, 2020
95734d9
Exposes the motor speed attribute in the api endpoint
zyph00 Sep 26, 2020
406cf52
Merge pull request #1584 from thmspl/patch-3
jmtatsch Sep 26, 2020
416896e
Add video file to the motion detection user scripts
psykzz Sep 29, 2020
166be09
Merge pull request #1588 from psykzz/patch-1
jmtatsch Sep 30, 2020
267419e
Change remaining RTSPH264OPTS and RTSPH264OPTS to the new RTSPOPTS fi…
jmtatsch Sep 30, 2020
954329a
Update timezones.tsv
Geek-MD Oct 1, 2020
74480c8
Merge pull request #1590 from MrAndersonMD/beta
jmtatsch Oct 1, 2020
1e71c66
Update mqtt-control.sh
josephdouce Oct 1, 2020
40ceb7f
Update autoupdate.sh
radinsky Oct 2, 2020
2948300
Merge pull request #1594 from radinsky/patch-1
jmtatsch Oct 2, 2020
b0d51be
Merge branch 'beta'
dewi-ny-je Oct 28, 2020
064aff2
Merge pull request #1612 from dewi-ny-je/master
jmtatsch Nov 6, 2020
ac7e2ba
Merge branch 'master' into patch-1
jmtatsch Nov 6, 2020
02d5523
Merge pull request #1592 from josephdouce/patch-1
jmtatsch Nov 6, 2020
17095b7
Merge pull request #1618 from EliasKotlyar/master
jmtatsch Nov 6, 2020
cc3c060
Fixed the timezone: Europe/Amsterdam
OhMyGuus Nov 7, 2020
914b46e
Fix a typo in camera.cgi so that setconf is called correctly when sav…
jmtatsch Nov 12, 2020
61a02ea
Remove traces of distinction between rtsp_h264 and rtsp_mjpeg because…
jmtatsch Nov 14, 2020
853a392
fix autostart of rtsp
jmtatsch Nov 14, 2020
ede5abe
Merge pull request #1620 from OhMyGuus/Fixes
jmtatsch Nov 14, 2020
b590eef
Update index.html
jmtatsch Nov 14, 2020
f299b6c
Update osd.conf
jmtatsch Nov 14, 2020
00ae38f
Fix 'rtsp-h264' still set as an autostart entry when 'rtsp' is now th…
benru Dec 8, 2020
7b88be2
Added button to the live page that downloads a JPEG screenshot (#1638)
benru Dec 8, 2020
1c92630
Full master fixes also into beta (#1639)
jmtatsch Dec 8, 2020
04edd48
Merge branch 'beta'
jmtatsch Dec 8, 2020
be44026
Fix differences between Web UI services and MQTT (#1640)
benru Dec 8, 2020
d43eb62
Update Readme (#1642)
coby Dec 10, 2020
50a937c
Update install_cfw.md
jmtatsch Dec 13, 2020
49d1e33
Save snapshots/videos on motion vales are not saved. (#1645)
drkdoesgit Dec 20, 2020
6a13b28
Fix select elements in safari (#1647)
xdissent Dec 21, 2020
74360b8
Ignore motion events when night mode is switched on/off (#1648)
xdissent Dec 21, 2020
3fa69c9
GitHub token for updates (#1650)
xdissent Dec 21, 2020
4f30404
Mdns responder (#1649)
xdissent Dec 21, 2020
43d73c3
Allow custom firmware repositories (#1651)
xdissent Dec 22, 2020
e7c84dd
Network config web ui and fallback wifi hotspot (#1655)
xdissent Dec 22, 2020
90173ea
add mDNSResponder binary
jmtatsch Dec 23, 2020
8eb23eb
Update motion.html
jmtatsch Dec 23, 2020
69e0126
Update control.js
jmtatsch Dec 23, 2020
7d2eeba
Update camera.html (#1656)
jcgoette Dec 26, 2020
ccdfd4d
Update motion.html
jmtatsch Dec 27, 2020
5fc16fb
Update ui_motion.cgi
jmtatsch Dec 27, 2020
67794f2
Merge branch 'master' into beta
jmtatsch Dec 27, 2020
fe18a97
Update motion.html
jmtatsch Jan 1, 2021
e5520d0
Update technical.md (#1683)
fhl206 Feb 10, 2021
0b6a19a
typo fix (#1685)
claud9999 Feb 12, 2021
174b2d5
fix #1674 - typo in ui_motion.cgi (#1676)
claud9999 Feb 26, 2021
972ba9d
the bot should only answer to commands that starts with "/" (#1664)
pfefferle Feb 26, 2021
d79a153
SSH management panel (#1692)
tim-devel Mar 7, 2021
8065bd5
Added nano binary
jmtatsch Mar 8, 2021
1e393e1
Update install_cfw.md (#1673)
aque0us Mar 8, 2021
5ef8548
Refactor dtectionOn.sh (#1698)
tim-devel Mar 8, 2021
7457537
Update mqtt-autodiscovery.sh (#1700)
Fietspomp86 Mar 8, 2021
bae6374
Fix controlscripts/rtsp (#1701)
yerlandinata Mar 8, 2021
4a2af3a
Add dropbox uploads on motion detection (#1703)
tim-devel Mar 12, 2021
fbb903d
Fix changing dropbox folders (#1705)
tim-devel Mar 13, 2021
f7c4a0e
Merge branch 'master' into beta
jmtatsch Mar 13, 2021
00ffa10
Add LD_LIBRARY_PATH to .profile (#1704)
tim-devel Mar 15, 2021
55a85cc
Remove audio and convert to mp4 so videos play in Telegram app (#1709)
tim-devel Mar 19, 2021
a163f44
SSH Control script (#1711)
tim-devel Mar 21, 2021
90b8a89
Update w3.css (#1713)
maxemoose Mar 21, 2021
7aa86b9
Add web server control script (#1714)
tim-devel Mar 21, 2021
116c1ad
Fix wifi (re)connection when available SSID is not the first one in w…
psallandre Mar 23, 2021
3935ddf
Fix: waiting for all background jobs to finish before send snapshot (…
Nazim-ua Apr 13, 2021
a4a8bdc
Fix small typo in OSD save log (#1722)
joeybab3 Apr 21, 2021
0ded516
Typo fix (#1723)
Apocrathia Apr 22, 2021
1de5ae1
Fix update w3.css (#1721)
maxemoose Apr 22, 2021
6bfe58e
Fix missing directory structure on letsencrypt (#1724)
TheRealWaldo Apr 27, 2021
799c2a4
Letsencrypt fix path (#1725)
TheRealWaldo Apr 27, 2021
1090a1f
Root CA updates and more cron fixes (#1726)
TheRealWaldo Apr 29, 2021
90076db
Updated cfw for newest wyzev2 (#1729)
McNutnut May 11, 2021
c153709
Merge branch 'master' into beta
jmtatsch May 11, 2021
c33bb63
Update README.md
jmtatsch May 11, 2021
62c8990
Update install_cwf_t20l.md (#1734)
fhl206 May 17, 2021
adbaffb
install_cfw: update Wyzecam V2 firmware version (#1735)
nfd May 22, 2021
a358264
Add Push To Talk (#1743)
StevenJonSmith Jun 9, 2021
634ce58
Fix video recording when using FTP or Dropbox (#1744) (#1745)
c--- Jun 18, 2021
2fa9ac0
This adds a new feature "Dropbox URL" so you can specify the URL to b…
c--- Jun 18, 2021
b6a93e9
Added clarification for LOCATION and DEVICE_NAME (#1747)
stephanfuchs Jun 21, 2021
c5e1444
Change all absolute URL's to relative (#1748)
c--- Jun 22, 2021
c344b8e
Fix deleteFile in sdcard.js (#1749)
c--- Jun 22, 2021
ac6991e
Imporove security of Dropbox emulating web script (#1765)
c--- Jul 23, 2021
21f00d7
Add full support for Matrix image and video #1756 (#1766)
c--- Jul 26, 2021
3ccc8bd
More robust Telegram video handling (#1769)
Aug 2, 2021
7db553f
Some cleanup in detectionOn.sh (#1764)
c--- Aug 5, 2021
d2fa6d7
Change Telegram ico (#1785)
tim-devel Oct 24, 2021
f1cf7da
Merge beta into master (#1786)
tim-devel Oct 24, 2021
0cde105
Update WyzeCam v1.2 `sha3sum -a 256` (#1791)
caraar12345 Dec 5, 2021
ff72612
Fixes "sh: bad number" in detectionOn.sh #1777 (#1813)
dewi-ny-je May 15, 2022
acfbd74
Update install_cfw.md (#1806)
szqt May 15, 2022
0c06dc3
Update install_cfw_cn.md (#1805)
szqt May 15, 2022
41e7e41
fix typo in file name
jmtatsch May 15, 2022
c5b0a23
fix link to tut
jmtatsch May 15, 2022
d474afb
minor spelling fix (#1818)
bish0polis May 30, 2022
9a75450
Add stream URLs and MQTT messages to documentation (#1822)
towerofpower256 Sep 17, 2022
b4f4c86
Add proper firmware for Neos Smartcam (#1820)
bengris32 Sep 17, 2022
0d0ca1c
Merge remote-tracking branch 'origin/master' into beta
jmtatsch Sep 17, 2022
ede2588
Merge beta into master (#1825)
jmtatsch Sep 17, 2022
9ac7b41
Update icon for motion notification in mqtt (#1826)
mikeage Sep 21, 2022
a6832b2
Add details to configure WPA2 Wi-Fi set-up (#1827)
mixpc Oct 14, 2022
e41fdbb
doc: fix typo for T20L link (#1831)
zaki-hanafiah Nov 26, 2022
b1da54b
Update control.js (#1832)
Nemesis24 Nov 28, 2022
d32b5e1
fixes #1833
jmtatsch Dec 30, 2022
982cdaa
Merge branch 'master' into beta
jmtatsch Dec 30, 2022
5d70997
Merge beta into master (#1835)
jmtatsch Dec 30, 2022
9b661e7
Speed up listing saved images #1804
jmtatsch Dec 30, 2022
6e17295
Multiple fixes & improvements related to volume and audio. (#1848)
dbuezas Apr 29, 2023
7fc144b
Prevent HTTPS redirects for 127.0.0.1 (#1846)
unqueued May 23, 2023
4339f8c
Update ui_motion.cgi (#1858)
Nemesis24 Jun 7, 2023
3ac640a
Fix message for telegram user chat id (#1864)
PhilippFr Jul 16, 2023
688b320
Remove device name from entity (#1871)
TheZoker Aug 4, 2023
652e90e
Update Gitter URLs as old ones returned a HTTP 404 Not Found (#1874)
numericOverflow Aug 9, 2023
03338b9
Improve install_sdcard.md documentation (#1865)
jcplaza Aug 13, 2023
b848ff6
Pull changes from master into beta (#1880)
jmtatsch Nov 5, 2023
cd80244
Merge remote-tracking branch 'origin/master' into beta
jmtatsch Nov 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is an issue tracking system only.
If you have general questions or are a newbie, please ask for help in our [chat channel](https://gitter.im/Xiaomi-Dafang-Hacks).
If you have general questions or are a newbie, please ask for help in our [chat channel](https://gitter.im/Xiaomi-Dafang-Hacks/Lobby).

To make sure your issue can be resolved as quickly as possible please state your

Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@ firmware_mod/config/rtspserver.conf
firmware_mod/config/ntp_srv.conf
firmware_mod/config/lighttpd.user
firmware_mod/config/lighttpd.pem
firmware_mod/config/userscripts/*/*
firmware_mod/config/userscripts/motiondetection/*
!firmware_mod/config/userscripts/motiondetection/*.dist
firmware_mod/config/userscripts/startup/*
!firmware_mod/config/userscripts/startup/*.dist
firmware_mod/root/.ssh/*

# avoid committing OSX .DS_Store files
.DS_Store
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

[![Join the chat at https://gitter.im/Xiaomi-Dafang-Hacks/Lobby](https://badges.gitter.im/Xiaomi-Dafang-Hacks/Lobby.svg)](https://gitter.im/Xiaomi-Dafang-Hacks/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This repository contains custom firmwares for the following devices:
This repository contains custom firmware for the following devices:

Name | Picture
--- | ---
Xiaomi Dafang | ![Dafang](/dafang.png)
Xiaomi Xiaofang 1S (only old Version with T20, newer Version with T20L not supported yet!) | ![XiaoFang](/xiaofang.png)
Xiaomi Xiaofang 1S (old Version with T20 is supported, newer Version with T20L is in beta) | ![XiaoFang](/xiaofang.png)
Wyzecam Pan | ![Dafang](/dafang.png)
Wyzecam V2 | ![XiaoFang](/xiaofang.png)
Neos SmartCam (NB The original firmware is not yet available, proceed with caution!) | ![XiaoFang](/xiaofang.png)
Neos SmartCam | ![XiaoFang](/xiaofang.png)
Sannce I21AG, MixSight HX-I2110T2, WanScam HW0036, Digoo BB-M2 | ![XiaoFang](/sannce.jpg)
Any other Device with Ingenic T10/T20 Device https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/980 | ![T20](/t20.png)

If you want to test the Xiaofang T20L (newer version) please check out the [additional instructions](https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/hacks/install_cfw_t20l.md).

If you have a classic XiaoFang with a ARM-Processor, consider using https://github.com/samtap/fang-hacks

### Attentention: Do not install the latest Firmware on your Device. It will disable the support of this hack.
### Attention: Do not install the latest Firmware on your Device. It will disable the support of this hack.

Further information about this topic can be found here: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/669

Expand All @@ -32,7 +34,7 @@ After that, continue to the
### Support

If you encounter a problem, please see first if you find similiar open/closed issues.
Or ask in our [Gitter channel](https://gitter.im/Xiaomi-Dafang-Hacks) for help.
Or ask in our [Gitter channel](https://gitter.im/Xiaomi-Dafang-Hacks/Lobby) for help.

If you don't find anything related, feel free to open a new issue.
If you/we solve your issue, please condense your gained insights into a pull request for continuous self-improvement.
Expand Down Expand Up @@ -78,4 +80,4 @@ It is possible to run your own scripts on motion detection. See [here](/integrat

## Contributions:

Any contribution to the development is highly welcome. Simply open a pull request on GitHub.
Any contribution to the development is highly welcome. Simply open a pull request against our beta branch on GitHub.
109 changes: 83 additions & 26 deletions firmware_mod/autoupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ DESTOVERRIDE="/tmp/Update"
EXCLUDEFILTER="*.conf|*.user|passwd|shadow"
GITHUBURL="https://api.github.com/repos"
GITHUBURLRAW="https://raw.githubusercontent.com"
CURL="/system/sdcard/bin/curl -k"
CURL="/system/sdcard/bin/curl -k -L"
JQ="/system/sdcard/bin/jq"
SHA="/system/sdcard/bin/openssl dgst -sha256"
BASENAME="/system/sdcard/bin/busybox basename"
FIND="/system/sdcard/bin/busybox find"
VERSION_FILE='/system/sdcard/VERSION'
COMMITS_FILE='/tmp/.lastcommit'



TMPFILE=/tmp/update.tmp
BACKUPEXT=.backup
Expand All @@ -41,16 +45,19 @@ usage()
{
echo "Usage: $1 [OPTIONS]"
echo "$1 will update a local folder with the ${REPO} github repo (first copy all the files in ${DESTOVERRIDE}, stop services and reboot"
echo "Usage this script to update the ${REPO} github repo from ${BRANCH} branch"
echo "Usage this script to update the ${REPO} github repo from ${BRANCH} (default) branch"
echo "Options:"
echo "-b (--backup) backup erased file (add extension ${BACKUPEXT} to the local file before ovewrite it) "
echo "-x (--repo) to set the repo"
echo "-r (--branch) to set the branch"
echo "-f (--force) force update"
echo "-d (--dest) set the destination folder (default is ${DESTFOLDER})"
echo "-p (--print) print action only, do nothing"
echo "-s (--steps) add progress in file /tmp/progress"

echo "-v (--verbose) for verbose"
echo "-u (--user) githup login/password (not mandatory, but sometime anonymous account get banned)"
echo "-t (--token) github API token"
echo "-h (--help) for this help"
echo
echo "Note that ${EXCLUDEFILTER} will be excluded"
Expand Down Expand Up @@ -124,13 +131,6 @@ ismatch()

echo notmatch
}
##########################################################################
# Return the current (last) commit from the specified repo and branch
getCurrentCommitDateFromRemote()
{
LASTCOMMITDATE=$(${CURL} -s ${GITHUBURL}/${REPO}/commits/${BRANCH} | grep date | head -1 | cut -d'"' -f 4)
echo ${LASTCOMMITDATE}
}

##########################################################################
# Print the files from repo of the folder $1
Expand All @@ -148,7 +148,7 @@ getfiles()

for row in $(echo "${1}" | ${JQ} '.[]| select(.type == "dir") | .path' ); do
flder=$(echo "${row}" | tr -d '"')
next=$(${CURL} -s https://api.github.com/repos/${REPO}/contents/${flder}?ref=${BRANCH})
next=$(curl -s https://api.github.com/repos/${REPO}/contents/${flder}?ref=${BRANCH})
getfiles "${next}"
done
fi
Expand All @@ -167,6 +167,24 @@ countdownreboot()
action reboot
}
##########################################################################
# Generate VERSION file
generateVersionFile ()
{
echo "{\"date\":\"${REMOTECOMMITDATE}\",\"repo\":\"${REPO}\",\"branch\":\"${BRANCH}\",\"commit\":\"${REMOTECOMMITID}\"}" > $VERSION_FILE
}
##########################################################################
# Curl with optional authentication
curl ()
{
if [ -n "$_TOKEN" ]; then
$CURL -H "Authorization: token $_TOKEN" "$@"
elif [ -n "$_USER" ]; then
$CURL -u "$_USER" "$@"
else
$CURL "$@"
fi
}
##########################################################################
# Script real start

while [ $# -gt 0 ]
Expand Down Expand Up @@ -198,22 +216,43 @@ do
shift
;;
-u | --user)
CURL="${CURL} -u $2"
_USER="$2"
shift
shift
;;
-t | --token)
_TOKEN="$2"
shift
shift
;;
-s | --steps)
_PROGRESS=1;
shift
;;
-x | --repo)
REPO=$2;
shift
shift
;;
-r | --branch)
BRANCH=$2
shift
shift
;;
*|-h |\? | --help)
usage $0
exit 1
;;
esac
done

log "Starting AutoUpdate"
log "Starting AutoUpdate on branch ${BRANCH}"

######################################################""
# Get date and last commit ID from Github
curl -s ${GITHUBURL}/${REPO}/commits/${BRANCH} --output $COMMITS_FILE
REMOTECOMMITDATE=$(${JQ} -r '.commit .author .date' ${COMMITS_FILE})
REMOTECOMMITID=$(${JQ} -r '.sha[0:7]' ${COMMITS_FILE} )

if [ ${_FORCE} = 1 ]; then
log "Forcing update."
Expand All @@ -229,11 +268,30 @@ fi

action "rm -rf ${DESTOVERRIDE} 2>/dev/null"



log "Getting list of remote files."
FIRST=$(${CURL} -s ${GITHUBURL}/${REPO}/contents/${REMOTEFOLDER}?ref=${BRANCH})
FILES=$(getfiles "${FIRST}")
if [ -f "$VERSION_FILE" ]; then
LOCALCOMMITID=$(${JQ} -r .commit ${VERSION_FILE})
LOCALREPO=$(${JQ} -r .repo ${VERSION_FILE})
if [ -z "$LOCALREPO" ]; then LOCALREPO="$REPO"; fi
if [ ${LOCALREPO} = ${REPO} ] && [ ${LOCALCOMMITID} = ${REMOTECOMMITID} ]; then
logerror "You are currently on the latest version"
echo "You are currently on the latest version"
exit 1
elif [ ${LOCALREPO} = ${REPO} ]; then
echo "Need to upgrade from ${LOCALCOMMITID} to ${REMOTECOMMITID}"
log "Getting list of remote files."
FILES=$(curl -s ${GITHUBURL}/${REPO}/compare/${LOCALCOMMITID}...${REMOTECOMMITID} | ${JQ} -r '.files[].raw_url' | grep ${REMOTEFOLDER})
else
echo "Repo has changed. Upgrade to last commit ${REMOTECOMMITID}"
log "Getting list of remote files."
FIRST=$(curl -s ${GITHUBURL}/${REPO}/contents/${REMOTEFOLDER}?ref=${BRANCH})
FILES=$(getfiles "${FIRST}")
fi
else
echo "Version file missing. Upgrade to last commit ${REMOTECOMMITID}"
log "Getting list of remote files."
FIRST=$(curl -s ${GITHUBURL}/${REPO}/contents/${REMOTEFOLDER}?ref=${BRANCH})
FILES=$(getfiles "${FIRST}")
fi

if [ $_PROGRESS = 1 ]; then
_NBTOTALFILES=$(echo $FILES | wc -w)
Expand All @@ -246,26 +304,25 @@ for i in ${FILES}
do
progress
# String to remove to get the local path
REMOVE="${GITHUBURLRAW}/${REPO}/${BRANCH}/${REMOTEFOLDER}/"
LOCALFILE="${i#$REMOVE}"
LOCALFILE=$(echo ${i} | awk -F ${REMOTEFOLDER}/ '{print $2}')
# Remove files that match the filter
res=$(ismatch ${LOCALFILE})
if [ "$res" == "match" ]; then
echo "${LOCALFILE} is excluded due to filter."
continue
fi
# Get the file temporally to calculate SHA
${CURL} -s ${i} -o ${TMPFILE} 2>/dev/null
curl -s ${i} -o ${TMPFILE} 2>/dev/null
if [ ! -f ${TMPFILE} ]; then
echo "Can not get remote file $i, exiting."
exit 1
fi
# sometimes zero byte files are received, which overwrite the local files, we ignore those files
# exception: files that are hidden i.e. start with dot. Ex: files like ".gitkeep"
if [[ ! -s ${TMPFILE} ]] && [[ $(basename ${LOCALFILE} | cut -c1-1) != "." ]]; then
echo "Received zero byte file $i, exiting."
exit 1
fi
if [[ ! -s ${TMPFILE} ]] && [[ $(basename ${LOCALFILE} | cut -c1-1) != "." ]]; then
echo "Received zero byte file $i, exiting."
exit 1
fi
# Check the file exists in local
if [ -f "${DESTFOLDER}/${LOCALFILE}" ]; then
REMOTESHA=$(${SHA} ${TMPFILE} 2>/dev/null | cut -d "=" -f 2)
Expand Down Expand Up @@ -345,7 +402,7 @@ if [ -d ${DESTOVERRIDE} ] && [ $(ls -l ${DESTOVERRIDE}/* | wc -l 2>/dev/null) >
action "rm -Rf ${DESTOVERRIDE}/* 2>/dev/null"

# Everythings was OK, save the date
echo $(getCurrentCommitDateFromRemote) > /system/sdcard/.lastCommitDate
generateVersionFile
echo "--------------- Reboot ------------"
if [ ${_FORCEREBOOT} = 1 ]; then
countdownreboot
Expand All @@ -358,6 +415,6 @@ if [ -d ${DESTOVERRIDE} ] && [ $(ls -l ${DESTOVERRIDE}/* | wc -l 2>/dev/null) >
fi
fi
else
echo $(getCurrentCommitDateFromRemote) > /system/sdcard/.lastCommitDate
generateVersionFile
echo "No files to update."
fi
Binary file modified firmware_mod/bin/bftpd
Binary file not shown.
Binary file modified firmware_mod/bin/busybox
Binary file not shown.
Binary file modified firmware_mod/bin/dropbearmulti
Binary file not shown.
Binary file modified firmware_mod/bin/fatlabel
Binary file not shown.
Binary file modified firmware_mod/bin/fsck.fat
Binary file not shown.
Binary file modified firmware_mod/bin/lighttpd.bin
Binary file not shown.
Binary file added firmware_mod/bin/mDNSResponder
Binary file not shown.
52 changes: 44 additions & 8 deletions firmware_mod/bin/matrix
Original file line number Diff line number Diff line change
@@ -1,18 +1,54 @@
#!/bin/sh

CURL="/system/sdcard/bin/curl --silent"
JQ="/system/sdcard/bin/jq"

what="$1"
shift
data="$@"
CURL="/system/sdcard/bin/curl"

if [ "$what" = "m" ]; then
shift
sendtext="${@//\"/\\\"}"
else
filename="$2"
datafile="$3"
fi

. /system/sdcard/config/matrix.conf

uploadData() {
mimetype="$1"
msgtype="$2"

mxcuri="$($CURL -XPOST -H "Content-Type: $mimetype" --data-binary @"$datafile" "https://$host:$port/_matrix/media/r0/upload?filename=$filename&access_token=$access_token" | $JQ -cMr ".content_uri")"
if [ -n "$mxcuri" ] && [ "$mxcuri" != "null" ]; then
$CURL -XPOST -d '{"msgtype":"'"$msgtype"'", "body":"'"$filename"'", "url":"'"$mxcuri"'"}' "https://$host:$port/_matrix/client/r0/rooms/$room_id/send/m.room.message?access_token=$access_token"
fi
}

sendFile() {
echo "Sending file: $datafile"
uploadData "application/octet-stream" "m.file"
}

sendMessage() {
text="$(echo "${@}" | sed 's:\\n:\n:g')"
echo "Sending message: $text"
echo "Sending message: $sendtext"
$CURL -XPOST -d '{"msgtype":"m.notice", "body":"'"$sendtext"'"}' "https://$host:$port/_matrix/client/r0/rooms/$room_id/send/m.room.message?access_token=$access_token"
}

sendPicture() {
echo "Sending picture: $datafile"
filename="$filename.jpg"
uploadData "image/jpeg" "m.image"
}

$CURL -XPOST -d '{"msgtype":"m.text", "body":"'$text'"}' "https://$host:$port/_matrix/client/r0/rooms/$room_id/send/m.room.message?access_token=$access_token"
sendVideo() {
echo "Sending video: $datafile"
filename="$filename.mp4"
uploadData "video/mp4" "m.video"
}

[ "$what" = "m" ] && sendMessage $data
[ -z "$what" ] && echo -e "$0 <m|f|p> <data>\n m: message\n f: file\n p: picture"
[ "$what" = "f" ] && sendFile
[ "$what" = "m" ] && sendMessage
[ "$what" = "p" ] && sendPicture
[ "$what" = "v" ] && sendVideo
[ -z "$what" ] && echo -e "$0 <m|f|p|v> <data|filename>\n m: message\n f: file\n p: picture\n v: video"
Binary file modified firmware_mod/bin/mkfs.fat
Binary file not shown.
Binary file added firmware_mod/bin/nano
Binary file not shown.
Binary file modified firmware_mod/bin/openRTSP
Binary file not shown.
Binary file modified firmware_mod/bin/openssl
Binary file not shown.
Binary file modified firmware_mod/bin/setconf
Binary file not shown.
Loading