File tree 16 files changed +87
-31
lines changed
16 files changed +87
-31
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ sshは物理的にSD-Cardへアクセスして公開鍵を書かないとlogin
41
41
42
42
## 使用法
43
43
44
- https://github.com/mnakada/atomcam_tools/releases/tag/v1.0RC4
44
+ https://github.com/mnakada/atomcam_tools/releases/tag/v1.0RC5
45
45
からatomcam_tools.zipをダウンロードし、適当なツールで解凍します。
46
- <img src =" https://github.com/bakueikozo /atomcam_tools/blob/main/images/extract.png " >
46
+ <img src =" https://github.com/mnakada /atomcam_tools/blob/main/images/extract.png " >
47
47
48
48
解凍されて出てきたすべてのファイルを、ATOMCam2で使用可能なmicroSDカードのルートフォルダに保存します
49
49
保存したmicroSDカードをATOMCam2に入れて電源を入れます
@@ -158,10 +158,18 @@ WebHookを受け取るURLを指定します。今のところ実験的な実装
158
158
159
159
動体検知での録画が終了した時に通知URLに type: uploadVideoFinish をpostします。
160
160
161
+ ##### - 動体検知録画転送
162
+
163
+ 動体検知での録画が終了した時に通知URLに mime: video /mp4で録画ファイル をpostします。
164
+
161
165
##### - 動体検知静止画保存
162
166
163
167
動体検知での静止画保存完了時に通知URLに type: uploadPictureFinishをpostします。
164
168
169
+ ##### - 動体検知静止画転送
170
+
171
+ 動体検知での静止画保存完了時に通知URLに mime: image /jpegで静止画ファイルをpostします。
172
+
165
173
##### - 定常録画保存
166
174
167
175
1分間の定常録画が終了するたびに通知URLに type: recordEventをpostします。
Original file line number Diff line number Diff line change 1
1
#
2
2
# Automatically generated make config: don't edit
3
3
# Busybox version: 1.24.1
4
- # Sun Oct 17 13:49:01 2021
4
+ # Sun Nov 14 14:53:07 2021
5
5
#
6
6
CONFIG_HAVE_DOT_CONFIG=y
7
7
@@ -869,9 +869,9 @@ CONFIG_TCPSVD=y
869
869
CONFIG_TELNET=y
870
870
CONFIG_FEATURE_TELNET_TTYPE=y
871
871
CONFIG_FEATURE_TELNET_AUTOLOGIN=y
872
- CONFIG_TELNETD=y
873
- CONFIG_FEATURE_TELNETD_STANDALONE=y
874
- CONFIG_FEATURE_TELNETD_INETD_WAIT=y
872
+ # CONFIG_TELNETD is not set
873
+ # CONFIG_FEATURE_TELNETD_STANDALONE is not set
874
+ # CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
875
875
CONFIG_TFTP=y
876
876
CONFIG_TFTPD=y
877
877
Original file line number Diff line number Diff line change 5
5
6
6
start () {
7
7
printf " Starting crond: "
8
- start-stop-daemon -b -S -q -m -p /var/run/crond.pid --exec /usr/sbin/crond -- -l 4
8
+ TZ=JST-9 start-stop-daemon -b -S -q -m -p /var/run/crond.pid --exec /usr/sbin/crond -- -l 4
9
9
echo " OK"
10
10
}
11
11
File renamed without changes.
Original file line number Diff line number Diff line change 3
3
# rtsp server
4
4
#
5
5
HACK_INI=/media/mmc/hack.ini
6
+ touch $HACK_INI
6
7
RTSPSERVER=$( awk -F " =" ' /RTSPSERVER *=/ {print $2}' $HACK_INI )
7
8
8
9
case " $1 " in
Original file line number Diff line number Diff line change 4
4
mkdir -p /var/log/samba
5
5
6
6
HACK_INI=/media/mmc/hack.ini
7
+ touch $HACK_INI
7
8
STORAGE_SDCARD_PUBLISH=$( awk -F " =" ' /STORAGE_SDCARD_PUBLISH *=/ {print $2}' $HACK_INI )
8
9
9
10
start () {
Original file line number Diff line number Diff line change 2
2
3
3
include /etc/logrotate.d
4
4
5
- /var/log/messages /var/log/autonight .log /var/log/videocapture.log /var/log/ lighttpd-access .log {
5
+ /var/log/messages /var/log/lighttpd-access .log /var/log/lighttpd-error .log {
6
6
rotate 7
7
7
daily
8
8
delaycompress
Original file line number Diff line number Diff line change @@ -39,3 +39,11 @@ chmod 777 /tmp/log
39
39
LD_PRELOAD=/tmp/system/modules/libcallback.so /system/bin/iCamera_app >> /tmp/log/atom.log 2>&1 &
40
40
41
41
/system/bin/dongle_app >> /tmp/log/dongle.log &
42
+
43
+ (
44
+ while sleep 3600
45
+ do
46
+ TZ=JST-9 date >> /media/mmc/atomhack.log
47
+ free >> /media/mmc/atomhack.log
48
+ done
49
+ ) &
Original file line number Diff line number Diff line change 17
17
reboot
18
18
cmd=" "
19
19
fi
20
+ if [ " $cmd " = " scheduleReboot" ]; then
21
+ cat << EOF | crontab -
22
+ */15 * * * * /usr/sbin/logrotate /etc/logrotate.conf
23
+ ${params} /scripts/reboot.sh
24
+ EOF
25
+ fi
20
26
if [ " $cmd " = " setwebhook" ]; then
21
27
kill -9 ` pidof webhook.sh`
22
28
/scripts/webhook.sh &
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
3
HACK_INI=/media/mmc/hack.ini
4
+ touch $HACK_INI
5
+ touch /tmp/log/atom.log
4
6
tail -F /tmp/log/atom.log | TZ=JST-9 awk '
5
7
BEGIN {
6
8
FS = "=";
7
9
while(getline < HACK_INI) {
8
10
ENV[$1]=$2;
9
11
}
10
- if(ENV["WEBHOOK"] != "on") exit;
11
- if(ENV["WEBHOOK_URL"] == "") exit;
12
+ }
13
+
14
+ /__NTP Set SysTime To/ {
15
+ gsub(/^.*__NTP Set SysTime To /, "");
16
+ gsub(/__.*$/, "000");
17
+ print strftime("Reboot Time : %Y/%m/%d %H:%M:%S") >> "/media/mmc/atomhack.log";
18
+ fflush("/media/mmc/atomhack.log");
19
+ }
20
+
21
+ {
22
+ if(ENV["WEBHOOK"] != "on") next;
23
+ if(ENV["WEBHOOK_URL"] == "") next;
12
24
}
13
25
14
26
/alarm_uploadNotify/ {
@@ -37,12 +49,6 @@ BEGIN {
37
49
/time_lapse_stop_job/ {
38
50
if(ENV["WEBHOOK_TIMELAPSE_FINISH"] == "on") Post("timelapseFinish");
39
51
}
40
- /__NTP Set SysTime To/ {
41
- gsub(/^.*__NTP Set SysTime To /, "");
42
- gsub(/__.*$/, "000");
43
- print strftime("Reboot Time : %Y/%m/%d %H:%M:%S") >> "/media/mmc/atomhack.log";
44
- fflush("/media/mmc/atomhack.log");
45
- }
46
52
47
53
function Post(event, data) {
48
54
if(data == "") {
Original file line number Diff line number Diff line change @@ -20,20 +20,6 @@ if [ "$REQUEST_METHOD" = "POST" ]; then
20
20
}
21
21
' > /media/mmc/hack.ini
22
22
23
- REBOOT_SCHEDULE = ` awk ' /REBOOT_SCHEDULE *=/ { gsub(/^REBOOT_SCHEDULE *=/, ' ' ); print; }' /media/mmc/hack.ini`
24
- awk '
25
- /\/scripts\/reboot\.sh/ {
26
- next;
27
- }
28
- {
29
- print;
30
- }
31
- END {
32
- if(REBOOT_SCHEDULE != "") print REBOOT_SCHEDULE " /scripts/reboot.sh";
33
- }
34
- ' -v REBOOT_SCHEDULE=" $REBOOT_SCHEDULE " /var/spool/cron/crontabs/root > /var/spool/cron/crontabs/root.new
35
- busybox mv /var/spool/cron/crontabs/root.new /var/spool/cron/crontabs/root
36
-
37
23
awk '
38
24
BEGIN {
39
25
FS=";";
Original file line number Diff line number Diff line change @@ -9,5 +9,24 @@ cp -a staging/lib/* target/lib/
9
9
cp -a staging/usr/lib/* target/usr/lib/
10
10
rm -f build/.root
11
11
find . -name " .stamp_target_installed*" -print | xargs rm -f
12
- cd ..
12
+
13
+ # build libcallback.so
14
+ PATH=$PATH :/openmiko/build/mips-gcc472-glibc216-64bit/bin
15
+ cd /src/atomcam_configs/libcallback
16
+ mips-linux-uclibc-gnu-gcc -fPIC -shared -o libcallback.so filesnooper.c setlinebuf.c -ldl
17
+ mkdir -p /src/atomcam_configs/overlay_rootfs/lib/modules/
18
+ cp libcallback.so /src/atomcam_configs/overlay_rootfs/lib/modules/
19
+
20
+ # build webpage
21
+ PATH=$PATH :/root/.nvm/versions/node/v16.10.0/bin
22
+ cd /src/atomcam_configs/web
23
+ npm install -g npm
24
+ npm install
25
+ ./node_modules/.bin/webpack --mode production --progress
26
+ cp -pr frontend/* /src/atomcam_configs/overlay_rootfs/var/www
27
+
28
+
29
+ cd /openmiko/build/buildroot-2016.02
13
30
make
31
+ cp /openmiko/build/buildroot-2016.02/output/images/rootfs.ext2 /src
32
+ cp /openmiko/build/buildroot-2016.02/output/images/uImage.lzma /src
Original file line number Diff line number Diff line change 572
572
str += ` DelFlags=1;` ;
573
573
}
574
574
this .config .RECORDING_LOCAL_SCHEDULE_LIST = str;
575
+ if (this .config .SDCARD !== " on" ) this .config .STORAGE_SDCARD_PUBLISH = " off" ;
575
576
576
577
str = parseInt (this .reboot .time .slice (- 2 )) + ' ' ;
577
578
str += parseInt (this .reboot .time .slice (0 , 2 )) + ' * * ' ;
600
601
if (Object .keys (this .config ).some (prop => (prop .search (/ WEBHOOK/ ) === 0 ) && (this .config [prop] !== this .oldConfig [prop]))) {
601
602
execCmds .push (' setwebhook' );
602
603
}
604
+ if (this .config .REBOOT_SCHEDULE !== this .oldConfig .REBOOT_SCHEDULE ) {
605
+ execCmds .push (` scheduleReboot ${ this .config .REBOOT_SCHEDULE } ` );
606
+ }
603
607
if (this .config .HOSTNAME !== this .oldConfig .HOSTNAME ) {
604
608
execCmds .push (` hostname ${ this .config .HOSTNAME } ` );
605
609
if (window .location .host === ` ${ this .oldConfig .HOSTNAME } .local` ) {
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -x
4
+
5
+ cp -pr atomcam_configs openmiko
6
+ cd openmiko
7
+ cp -pr atomcam_configs/overlay_initramfs/* initramfs_skeleton
8
+
9
+ if ! docker ps | grep openmiko_builder_1 ; then
10
+ docker-compose up -d
11
+ fi
12
+ docker-compose exec builder /src/atomcam_configs/scripts/rebuild_rootfs
13
+
14
+ mv uImage.lzma ../factory_t31_ZMC6tiIDQN
15
+ mv rootfs.ext2 ../rootfs_hack.ext2
16
+ cd ..
17
+ zip -ry atomcam_tools.zip factory_t31_ZMC6tiIDQN rootfs_hack.ext2 hostname authorized_keys
You can’t perform that action at this time.
0 commit comments