1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-09 07:30:57 +02:00

112 Commits

Author SHA1 Message Date
David Buezas
6e1729539a Multiple fixes & improvements related to volume and audio. (#1848) 2023-04-29 19:46:18 +02:00
Greg Thornton
43d73c3c77 Allow custom firmware repositories (#1651)
* Add repo option to autoupdate.sh

* Fix repo option in autoupdate.sh

* Use local repo when checking for updates

* Use default repo if non given in VERSION file in autoupdates.sh

* Pass custom repo to web ui and update cgi

* Add custom firmware update to web ui

* Fix update messages

* Fix update start arguments

* Fix update input labels

* Add custom upgrade button when on custom firmware
2020-12-22 07:48:59 +01:00
Greg Thornton
3fa69c9b79 GitHub token for updates (#1650)
* Add github token option to autoupdate.sh

* Use github token to check updates

* Add github token to web ui

* Use github token in web updates

* Add github tab in web ui

* Fix curl in autoupdate.sh

* Fix github curl auth
2020-12-21 12:57:23 +01:00
Julian Tatsch
61a02eaec9 Remove traces of distinction between rtsp_h264 and rtsp_mjpeg because everything is handled now by rtsp service and both cant run at the same time anyhow. 2020-11-14 11:18:25 +01:00
Julian Tatsch
267419e100 Change remaining RTSPH264OPTS and RTSPH264OPTS to the new RTSPOPTS fixes #1574 2020-09-30 06:41:49 +02:00
jmtatsch
7059874e27 Merge beta into master (#1415)
* New binaries:
   - lighttpd
   - openssl
   - busybox
   - v4l2rtspserver-master
       latest live libs included
       bug correction for motion detection at startup
       MJPG is back (there is still an issue with the OSD: it is
flickering)

* Manage FPS for MJPG

* Dropbear new version  (#1348)

* Dropbear new bin

* New version of Dropbear (v2019.78)

* New version of dropbear

- Use v2019.78 from https://secure.ucc.asn.au/hg/dropbear
- Change default path to "/usr/bin:/bin:/system/bin:/system/sdcard/bin/"

* Merge dropbearmulti

* New version of server:
According to PR: https://github.com/Dafang-Hacks/Main/pull/54
- Reduce video buffers per channel to two
- And enable poolsize fix by default

* Add mod_alias to lighttpd

* New binaries:
   - lighttpd
   - openssl
   - busybox
   - v4l2rtspserver-master
       latest live libs included
       bug correction for motion detection at startup
       MJPG is back (there is still an issue with the OSD: it is
flickering)

* Manage FPS for MJPG

* Dropbear new version  (#1348)

* Dropbear new bin

* New version of Dropbear (v2019.78)

* New version of dropbear

- Use v2019.78 from https://secure.ucc.asn.au/hg/dropbear
- Change default path to "/usr/bin:/bin:/system/bin:/system/sdcard/bin/"

* New version of server:
According to PR: https://github.com/Dafang-Hacks/Main/pull/54
- Reduce video buffers per channel to two
- And enable poolsize fix by default

* Add mod_alias to lighttpd

* Add directory listing of DCIM directory via lighttpd mod_alias, needs lighttpd.conf reset.

* Motion detection was not working if reduce pool was activated

* Update openRTSP according to last version of Live555 libs (#1383)

* Add night mode on/off options for the Telegram bot (#1386)

Co-authored-by: Jelle Posthuma <jelle@beyonit.nl>

* Bump bulma 0.8.2

* Merge stuff into beta that should have went there all along (#1393)

* PTZpresets.sh should not use inverted logic for motor control. (#1366)

* Allow example userscripts, with calibratePTZ example script. (#1371)

* PTZpresets.sh should not use inverted logic for motor control.

* Allow example userscripts, calibrate at boot example.

This commit changes run.sh to only execute files in /system/sdcard/config/userscripts/startup/
if they do not end with .dist. This allows example scripts to be included in the repository.

This commit also includes an example script calibratPTZ.sh.dist that will perform a PTZ calibration at boot
and if a /system/sdcard/config/cameraposition file exists it will also move the camera to the position it defines.

To enable the calibratePTZ.sh.dist demo, or any other script, copy or rename it to NOT end in .dist.
Example:
cp /system/sdcard/config/userscripts/startup/calibratePTZ.sh.dist /system/sdcard/config/userscripts/startup/calibratePTZ.sh

* enable zram by default as per the original firmware (#1323)

* enable zram by default as per the original firmware

this prevents crashes due to memory exhaustion on xiaofeng and other
64mb models

* Keep old swap variable names for backwards compatability

* Use zram swap with higher priority than sd-card swapfile

* Add configuration option for zram size

Co-authored-by: jmtatsch <jmtatsch@users.noreply.github.com>

* Update README.md

mention pull request should be against beta branch

* Add documentation about ram (#1375)

* Autoupgrade (#1374)

* New menu organisation

* Improve upgrade process by creation a VERSION file

* Add commit info in status overview

* Improve update process with VERSION file

* Typo fixies

* Fix typo in status_overview.cgi (#1388)

Latest commit leads to blank content on Overview page under the Information tab. Based on below, I think it is a typo.

/var/log/lighttpd-cgi-stderr.log
/system/sdcard/www/cgi-bin/status_overview.cgi: line 59: syntax error: unexpected "else" (expecting ")")

* remove no original f/w note from Neos SmartCam (#1389)

2 versions are available

* Minor changes / correcting labeling (#1391)

* Minor changes / correcting labeling
run.sh: blue_led also off by default
common_functions.sh: fix typo
api.cgi, system_led.cgi, index.html: Correct display of cut_ir to IR Filter
sw_night.css: make some text easier to read
index.html.js: remove blank line

Co-authored-by: Steven McCombie <smccombie@fugnet.servegame.com>

* PTZ Presets - go home (#1387)

* Complete rewrite of PTZpresets.sh

Rewrite PTZpresets.sh to have better PID handling and full posix compatibility.

* left and right ptz presets where flipped

* Fix creation of PID file

Overly aggressive search and replace error, switch out logger to echo so PID is written to fille.

* Use full path to jq

Use full path to jq so that it still works when called from action.cgi and api.cgi

* Create Xiaomi.pm

Updated Xiaomi.pm that includes basic PTZ presets support.

* Update zoneminder.md

Co-authored-by: Solomon S <slm4996@users.noreply.github.com>
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.me>
Co-authored-by: Yannik Sembritzki <yannik.sembritzki@gmail.com>
Co-authored-by: Gysmo <frederic@leroux.im>
Co-authored-by: fhl206 <fhl206@gmail.com>
Co-authored-by: Combie81 <classified_one@hotmail.com>
Co-authored-by: Steven McCombie <smccombie@fugnet.servegame.com>

* Hide dpad if camera have no PTZ

* Add topic update to start update from mqtt (#1399)

Co-authored-by: gysmo38 <frederic@leroux.im>

* Viewer (#1401)

* Add html page to show files in Recording directory

* more generic code and add timelapse files

* Rebased on latest version on https://github.com/mpromonet/v4l2rtspserver
- No more memory leak (hopefully)
- latest version of live555

* Add test for update process (#1405)

* Add test for update process

* Update action.cgi

* Bug fix for Fimware commit on status overview page (#1406)

Co-authored-by: root <nicolas.ebele@gmail.com>
Co-authored-by: nik0 <1867654+nik0@users.noreply.github.com>
Co-authored-by: J Posthuma <jposthuma25@gmail.com>
Co-authored-by: Jelle Posthuma <jelle@beyonit.nl>
Co-authored-by: gysmo38 <frederic@leroux.im>
Co-authored-by: Solomon S <slm4996@users.noreply.github.com>
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.me>
Co-authored-by: Yannik Sembritzki <yannik.sembritzki@gmail.com>
Co-authored-by: fhl206 <fhl206@gmail.com>
Co-authored-by: Combie81 <classified_one@hotmail.com>
Co-authored-by: Steven McCombie <smccombie@fugnet.servegame.com>
2020-07-16 09:19:09 +02:00
Gysmo
22a8cb6676 Autoupgrade (#1374)
* New menu organisation

* Improve upgrade process by creation a VERSION file

* Add commit info in status overview

* Improve update process with VERSION file

* Typo fixies
2020-04-29 21:04:33 +02:00
nik0
8947c91864 Add updating to beta branch (#1339) 2020-04-08 13:41:08 +02:00
fhl206
ae49233bdb Save correct SW auto night command line arguments (#1312)
autonight.conf.dist has arguments enclosed with ' but SW night configuration page passes arguments without. Currently, updating autonight.conf sw parameters using the SW night configuration page will stop autonight working correctly.
2020-03-15 13:20:57 +01:00
Knurlnheim
d9336ab637 Motionvideo2mqtt (#1298)
* Add 768x432 video resolution

* Update system_video.cgi

sort

* Add options to send motion video to MQTT

* Missing pieces

Co-authored-by: jmtatsch <jmtatsch@users.noreply.github.com>
Co-authored-by: Marc Fundenberger <38658442+MarcFundenberger@users.noreply.github.com>
2020-03-01 20:49:40 +01:00
Dmytro Drozdov
2a12aa9801 Add some more useful commands (#1293)
* Add some more useful commands

Add some more useful commands for more flexible integration with IoT
Fix bug in parsing comments for motion.conf Add grep '^[^#;]' for ignore comments line.

Add new functions in common_functions.sh

motion_led [on|off|status]
motion_snapshot [on|off|status]
motion_video [on|off|status]
motion_mqtt_publish [on|off|status]
motion_mqtt_snapshot [on|off|status]

Add new MQTT topics in mqtt-control.sh

{TOPIC}/motion/led
{TOPIC}/motion/snapshot
{TOPIC}/motion/video
{TOPIC}/motion/mqtt_publish
{TOPIC}/motion/mqtt_snapshot

Add new cmd in action.cgi
     motion_detection_led_on
     motion_detection_led_off
     motion_detection_led_status

     motion_detection_snapshot_on
     motion_detection_snapshot_off
     motion_detection_snapshot_status

     motion_detection_video_on
     motion_detection_video_off
     motion_detection_video_status

     motion_detection_mqtt_publish_on
     motion_detection_mqtt_publish_off
     motion_detection_mqtt_publish_status

     motion_detection_mqtt_snapshot_off
     motion_detection_mqtt_snapshot_on
     motion_detection_mqtt_snapshot_status

* Update mqtt-status-interval.sh

add new topic

* Update common_functions.sh

fix typo

* Update common_functions.sh

fix one more typo

Co-authored-by: jmtatsch <jmtatsch@users.noreply.github.com>
2020-02-28 22:42:12 +01:00
Dmytro Drozdov
0007298f6f Update action.cgi (#1284)
Add some more useful commands for more flexible integration with IoT
Used functions from ./system/sdcard/scripts/common_functions.sh

All commands will return "ON" or "OFF"
Usage:
https://.../cgi-bin/action.cgi?cmd=blue_led_status
https://.../cgi-bin/action.cgi?cmd=yellow_led_status
https://.../cgi-bin/action.cgi?cmd=ir_led_status
https://.../cgi-bin/action.cgi?cmd=ir_cut_status
https://.../cgi-bin/action.cgi?cmd=h264_status
https://.../cgi-bin/action.cgi?cmd=mjpeg_status
https://.../cgi-bin/action.cgi?cmd=auto_night_mode_status
https://.../cgi-bin/action.cgi?cmd=night_mode_status
https://.../cgi-bin/action.cgi?cmd=motion_detection_status
https://.../cgi-bin/action.cgi?cmd=motion_detection_mail_status
https://.../cgi-bin/action.cgi?cmd=motion_detection_telegram_status

https://.../cgi-bin/action.cgi?cmd=show_HWmodel
it return "Xiaomi Dafang" or "Xiaomi Xiaofang 1S" or "Wyzecam V2"
2020-02-19 00:06:22 +01:00
jmtatsch
bad6b1fa8c Update action.cgi
Avoid splitting the parameter night_mode_conf into several arguments. Fixes #1145.
2020-02-13 10:45:05 +01:00
Julian Tatsch
d4bfab99e3 Refactor autonight hw/sw mode handling, add flag for nightmode without IR leds for window installations. Fixes #1245 #1259. 2020-02-04 11:04:20 +01:00
Marcio Granzotto Rodrigues
88cf55cce1 Add nightmode toggle to actions.cgi (#1247)
* Add nightmode toggle to actions.cgi

This fixes https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/673 as it was a problem for me too. Since MQTT spams too much the broker with connections/disconnections, a HTTP API is needed.

* Update action.cgi

use common functions

* Update action.cgi

Co-authored-by: jmtatsch <jmtatsch@users.noreply.github.com>
2020-01-08 17:13:52 +01:00
dagrider
29dcbc03f2 Misc fixes (#1036)
* Update configureMotion

* Update sw_night_configure.html

* Update action.cgi
2019-05-02 07:08:56 +02:00
dagrider
483d7a4c63 Fixed OSD display (#1015) 2019-05-01 08:17:42 +02:00
Julian Tatsch
5d041e4f05 fix motion activation, check box still not displaying correct info 2019-02-18 23:20:06 +01:00
Julian Tatsch
e656f06138 fix recovery of motion sensitivity after switching on/off 2019-02-18 21:17:35 +01:00
Jelmer Tiete
eab95ca47f web interface menu reshuffel (#910)
* web interface menu reshuffel. Added network info panel. Removed missile launcher files.

* removed start original firmware button
2019-02-02 21:09:40 +01:00
Jelmer Tiete
f1047c7f5e timezone selector fix (#909)
* Added time zone selection in web config based on time zone name.

* Added default timezone config file. Default is Abidjan because first in list that is GMT0, which probably matches the default in `/etc/TZ`

* Update timezone.conf

* Added default timezone config file. Default is Abidjan because first in list that is GMT0, which probably matches the default in `/etc/TZ`

* improved time zone changes with seperate function. timezone is now set at boot time to avoid time zone name and actual system time zone mismatch
2019-02-02 18:29:27 +01:00
Jelmer Tiete
7e1dc69786 Improved time zone selection (#901)
* Added time zone selection in web config based on time zone name.

* Added default timezone config file. Default is Abidjan because first in list that is GMT0, which probably matches the default in `/etc/TZ`

* Update timezone.conf
2019-01-31 15:59:50 +01:00
Tsvi Mostovicz
fa5a7959ce Log by default to /tmp so as to avoid SD card corruption (#899)
* Log by default to /tmp so as to avoid SD card corruption

I discovered that the errors I was getting about the SD card similar to #880 were always related to the v4l2rtspserver log.
It seems to me that especially when turning detection tracking due to the high number of writes, writing to the log causes SD card corruption. I suppose that the SD card controller is not built for such a speed.
Since changing logging to log to /tmo which is mounted as tmpfs, I hadn't had any issues.

* Don't create a log subdirectory

* Apply same changes for mjpeg

* Update log view actions as well
2019-01-29 21:53:14 +01:00
blakadder
77e3ac8b7c Added Telegram functionality to HA and webui (#866)
* Update telegram-bot-daemon.sh

* Update common_functions.sh

* Update mqtt-autodiscovery.sh

* Update action.cgi

* Update index.html

* Update index.html.js

* Update index.html

* Update mqtt-status-interval.sh

* Update mqtt-autodiscovery.sh

* Update mqtt-control.sh

* Update state.cgi

* Added Send to telegram switches to HA and web ui
2018-12-30 21:06:37 +01:00
Julian Tatsch
c68d626d81 improve naming consistency 2018-12-24 10:42:45 +01:00
Julian Tatsch
ef89075cb0 improve led handling, refactor action.cgi to use more common functions, codestyle 2018-11-14 20:38:09 +01:00
Mike Miller
0741fb33b9 Add a new parameter 'publish_mqtt_snapshot' (#791)
Currently, publish_mqtt_message is used to decide whether we send a
notification about motion. save_snapshot is used to save the image
locally. And if both are set, the image is also sent to mqtt

This PR decouples the mqtt image send from the snapshot saving. There
are now three parameters:

publish_mqtt_message -- send notification that there was motion
publish_mqtt_snapshot -- send notification containing the motion.
save_snapshot -- saves to disk, doesn't necessarily notify

No MQTT topics are changed; this is purely configuration bookkeeping.
2018-11-13 20:11:30 +01:00
Julian Tatsch
a150effb32 Remove outdated calibration options, renamed the api to reset_pos_counts because there isnt actually calibration going on. 2018-11-11 08:22:57 +01:00
Mike Miller
9e9b0d3a94 Use common_function for action.cgi's motor calls (#786) 2018-11-11 07:38:00 +01:00
chisht
8076a88133 Updating autonight software method (#752)
* Integrating sw_night_configure.html to main index.html
Adding GUI option to select SW/HW mode for autonight in setting page
Adding capability to read current configuation and save the new configuation back to the sdcard in sw_night_configure

* Removing autonight.conf.sw Instead we now only add or remove -S to autonight.conf
2018-10-24 07:23:45 +02:00
Julian Tatsch
0038e23f21 call action.cgi directly, fixes #600 2018-09-05 08:15:41 +02:00
nik0
92fc6cb7db TTF font support !! 2018-07-25 23:16:11 +02:00
nik0
616afb05e5 Make image flip persist on reboot (#569)
* Basic keep image flip at reboot
settings page could be improved

* Basic keep image flip at reboot
settings page could be improved
2018-07-14 09:47:27 +02:00
jmtatsch
301dadc183 Update action.cgi
Current motor driver does not differentiate between horizontal and vertical calibration
2018-07-02 10:31:52 +02:00
jmtatsch
5891d5164c Update action.cgi
Fix #535 rtsp-h264-with-segmentation stop not existing anymore
2018-06-30 03:56:09 +02:00
nik0
44ca9999fe Update action.cgi 2018-06-27 13:59:00 +02:00
nik0
d60788f08b Add web ui for actions on motion (#528) 2018-06-26 19:02:50 +02:00
nik0
f029ce0fe0 Audio and framerate settings (#523)
* Audio and framerate settings
- Enable audio AES filter
- Now can choose more audio in/out bitrate
  Please note the constraints:
   * Filtering AES, NS is available with in bitrate under or egal 16000
   * When select OPUS out birate is 48000
   * When select PCM or PCMU in bitrate shall be egal to out bitrate

- Can now control video FPS
     * I noticed that some configuration freeze the video (for example 1/1)

* Delete webrtc_profile.ini

* Update status.cgi

* Update rtspserver.conf.dist
2018-06-25 21:25:33 +02:00
Dave Walker (Daviey)
b95be6ebbc Fix CGI execution and add cgi stderr logging
Change #478 introduced a regression with the updated busybox where ".",
seems not be part of the default $PATH.

The cgi scripts were sourcing "func.cgi", but this could not be found in
the new default $PATH, and therefore failed to execute. This meant that
the web-ui was unable to make changes and execute commands.

This has been resolved by putting a leading "./" for the script, making
it now ./func.cgi.

In addition, this also adds the lighttpd option server.breakagelog,
which enables stderr logging to /tmp/lighttpd-cgi-stderr.log (so 500
internal errors output is now logged to file (previously just the error
500 was in the webserver logs).

Closes: #491

Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
2018-06-17 21:35:03 +01:00
nik0
7165239069 Script execution (#462)
* Restore audio test
add the possibility to choose audio from audio delivered with original firmware
or choose audio from /system/sdcard/Media folder

* OSD was not displayed anymore if AXIS not set in OSD
I guess it is a regresion from previous commit (add the value in file with rewrite_config)

* Change the way the scripts (detection are launched)
2018-06-15 08:19:04 +02:00
MarkDownPhotos
19d6d7877a Fixes #454 (#458)
* Fix syntax errors,(fixes #454)

* Prevent writing axis to osd.conf
2018-06-13 05:06:15 +02:00
nik0
6d74d6a65c Restore audio test (#442)
add the possibility to choose audio from audio delivered with original firmware
or choose audio from /system/sdcard/Media folder
2018-06-11 04:49:10 +02:00
nik0
45dfeeb998 Restore audio test (#440)
* Restore audio test
add the possibility to choose audio from audio delivered with original firmware
or choose audio from /system/sdcard/Media folder

* Update action.cgi

Fix a typo and add missing quotes
2018-06-09 07:29:45 +02:00
nik0
282e04e911 New auto updatepage (#428)
* Update update.html

* New autoupdate page
- Autoupdate with progress bar (approximative as based on files already on card)
- associated log tab
- version in settings

* New autoupdate page
- Autoupdate with progress bar (approximative as based on files already on card)
- associated log tab
- version in settings
2018-06-07 20:40:55 +02:00
MarkDownPhotos
4e82215ba9 Add PTZ presets and other optimizations. (#389)
* add PTZperset function

* Display asix to OSD

* delete source

* add motor_PTZ function

* Motor adds f parameter (calibrate) and is compatible with the new version of DAFANG.

* calibrate,compatible newer models.

* OSD set POSY 0

* Wait for the previous command to run before running

* Disable Statements That Cause MQTT Alerts

* fix mqtt

* Fixed issue where multi-tasking motor was not moved to the specified position and was interrupted

* Add limit on the number of snapshots

* Add OSD Display AXIS

* Repair Limit Snapshot Number Does Not Take Effect..

* Enable log option

* Keep the original time style

* Keep default osd settings

* Modify loger as a logger

* Api.cgi is not in use

* Clear the old DAFANG calibration failure code.

New DAFANG Run the `/system/sdcard/bin/motor -d f` command to calibrate.

Old and generous Please run `/system/sdcard/bin/motor -d h && /system/sdcard/bin/motor -d v` command to calibrate

* Change the zero point of the motor calibration coordinate to the middle point of the motor.

* Fix the coordinate display of the new motor command.

* fix typo
2018-06-07 07:34:34 +02:00
nik0
9552b8349e Update action.cgi 2018-06-05 18:17:14 +02:00
nik0
9b017cded2 Fix video settings merge (#408)
* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs

* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs

* New video settings
- Can configure bitrate and video format

* Bad merge of videosettings
2018-06-04 13:42:48 +02:00
nik0
9c94f42ee9 Video settings (#405)
* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs

* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs

* New video settings
- Can configure bitrate and video format
2018-06-03 17:46:04 +02:00
nik0
0d05a26f3e Add configuration for audio (#404)
* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs

* Add configuration for audio
- New sub menu for audio in (mic)
- Add birate configuration
- double click on tabs name in log page will clear the logs
2018-06-03 14:48:46 +02:00
Julian Tatsch
fe3097b33d add tinyCam integration 2018-05-24 21:10:07 +02:00