1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-08 23:20:48 +02:00

18 Commits

Author SHA1 Message Date
Nick Kaijaks
3ccc8bd65c More robust Telegram video handling (#1769) 2021-08-02 18:57:10 +02:00
Matthias Pfefferle
972ba9d5cf the bot should only answer to commands that starts with "/" (#1664)
If a bot is in a group it can be very noisy otherwise.
2021-02-26 05:55:03 +01:00
dewi-ny-je
b0d51becde Merge branch 'beta' 2020-10-28 22:44:34 +01:00
Combie81
5548ab554f Moving config entries/cleanup
Moved some configutation options to the config files

Minor text changes

Converted a lot of spaces to tabs
2020-07-16 10:20:39 +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
/dev/null
3061d9ca8b Update telegram-bot-daemon.sh
Fixxes https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1470.
Its an assignement issue:
on Line 96, the variable messageVal is checked if empty, and if yes, messageAttr is set to "edited_message".
Now on line 97, messageVal is always set to a json value, which may not be there. This line should actually be added to line 96 after it has been checked, it the messageVal is empty.
This fix ensures that messageVal is only set to the json value of '.result[0].edited_message' if messageVal was empty before.
2020-06-08 18:31:28 +02:00
Matthias Pfefferle
d3fa21dffc support channel_post
posts to channels are of the type "channel_post": https://core.telegram.org/bots/api#getting-updates

This MR supports channel posts and should fix problems like #1368 and #1364
2020-05-28 00:43:17 +02:00
jmtatsch
eeb1e75e3c 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-05-08 21:09:36 +02:00
Combie81
d9fde69a60 Disabling SSL / path corrections / misc changes (#1307)
* Disabling SSL / path corrections / misc changes

Lighttpd.conf.dist: Added notes for disabling SSL
SSL left as on by default
Motion.conf.dist: Change pattern to make more sense when items are listed in explorer
Change paths case
resolv.cont.dist: Added public nameservers so that NTP will work by default
rtspserver.conf.dist: Added missing settings that are created after UI page is saved anyway
sendmail.conf.dist: Clarify AUTH entry to match rest of example
recording: Add Recording to path to help seperate/categorise files
Add sub dir with date for faster dir loading
Change from MOV to REC to identify video as "recorting" type
detectionON.sh: Change group/file pattern to make list better/consistent
telegram-bot...: Remove blank line
timelapse.sh: Change path variable name to match rest of code
Add sub directories to help with loaading/filtering of files

* Update resolv.conf.dist

Commented out Publin DNS servers as requested

Co-authored-by: Steven McCombie <smccombie@fugnet.servegame.com>
2020-03-07 21:33:59 +01:00
Fausto
5d505d8e7f little touch-up for telegram-bot-daemon.sh (#1306)
* little touch-up for telegram-bot-daemon.sh

My bot sometimes receives a non-message json (spam I think) like this:

{"ok":true,"result":[{"update_id":271754855, "channel_post":{"message_id":73,"chat" ......

in that case updateId has a value and chatId is empty so the markAsRead is never performed.

In order to avoid that some non-message confusing the bot I propose insert an additional check.

* Update telegram-bot-daemon.sh
2020-03-06 15:09:20 +01:00
jmtatsch
b935053c58 Update telegram-bot-daemon.sh
fix help formatting
2019-10-22 09:04:35 +02:00
jmtatsch
87ab795331 Update telegram-bot-daemon.sh
telegram_alert_type belongs to the motion configuration, make video alert mode configurable
2019-10-22 07:26:40 +02:00
znanev
77e05d4818 Update telegram-bot-daemon.sh (#1124)
Correctly handle situations where commands coming from group chats appear to be substrings of another command (for example /mem will not be matched, if command sent was /members).
2019-08-16 12:28:11 +02:00
m-pavel
7c9dbd464f Support for groups and edited messages (#1093)
* Support to reply on eddited messages

* Support groups
2019-08-05 16:45:25 +02:00
saipsa
4014384d7a Telegram bot: Option to configure alert type - text/image (#855)
* Update common_functions.sh

* Update telegram-bot-daemon.sh

* Update detectionOn.sh
2018-12-29 06:31:29 +01:00
blakadder
d5d86e87d7 Update telegram-bot-daemon.sh (#853) 2018-12-27 03:04:47 +01:00
Liad Shani
caff4f76a1 Improve Telegram bot resistance to temporary network or server issues. (#844) 2018-12-19 03:34:04 +01:00
Eugene
12d0c89a05 Introduce telegram bot service (#772)
* introduce telgram bot service

* move bot daemon to scripts, use full path to call jq, use infinite while instead of watch

* fix typo
2018-11-04 06:56:09 +01:00