Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
8ac021cf
提交
8ac021cf
authored
7月 24, 2020
作者:
tobyfan1980
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine .gitignore and logs
上级
bb898a89
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
0 行删除
+30
-0
.gitignore
.gitignore
+4
-0
README.MD
opencv-motion-detect/README.MD
+16
-0
evdaemon.cpp
opencv-motion-detect/evdaemon.cpp
+10
-0
没有找到文件。
.gitignore
浏览文件 @
8ac021cf
...
...
@@ -5,7 +5,11 @@
*.pyc
*.so
build/
**/build
__pycache__/
.DS_Store
**/.DS_Store
**/vendor/include
# Random junk
*.sw?
...
...
opencv-motion-detect/README.MD
浏览文件 @
8ac021cf
## 编译环境
目前并没有在 x86 上做交叉编译. 都是直接在 arm 开发板上编译的. 需要先编译所有的依赖库. 可以在 github 下载 依赖库的 sourcecode 然后编译.
## build libs
-
LIBZMQ, LEVELDB
```
...
...
@@ -20,12 +24,24 @@
```
offical ref:
```
- libssh2
put .h files under vender/include
## build executables
```
make -j
```
## build in OSX
* install dependency using brew instead of building from source
```
brew install ffmpeg
brew install opencv
brew install libssh2
```
## deploy edge & cloud systems
- TODO: use systemd or supervisord to auto start on boot and monitoring
- manually: evdaemon will start all other 5 subsystems(evmgr, evpuller, evpusher, evmlmotion, evslicer) on a edge device.
...
...
opencv-motion-detect/evdaemon.cpp
浏览文件 @
8ac021cf
...
...
@@ -510,6 +510,9 @@ private:
z_send
(
pDealer
,
"evcloudsvc"
,
meta
.
dump
(),
data
.
dump
());
}
/**
handle online/offline event of peer module, and msg to cloudsvc from peer module
*/
int
handleEdgeMsg
(
vector
<
vector
<
uint8_t
>
>
&
body
)
{
int
ret
=
0
;
...
...
@@ -565,18 +568,22 @@ private:
j
[
"type"
]
=
EV_MSG_META_CONFIG
;
string
meta
=
j
.
dump
();
vector
<
vector
<
uint8_t
>
>
v
=
{
str2body
(
selfId
),
str2body
(
this
->
daemonId
),
str2body
(
meta
),
str2body
(
cfg
)};
// inform other module that this module is online
z_send_multiple
(
pRouter
,
v
);
spdlog
::
info
(
"evdaemon {} peer {} config sent: {}"
,
devSn
,
selfId
,
cfg
);
}
else
{
// this zmq is offline notice
if
(
selfId
.
find
(
"evmgr"
)
==
string
::
npos
)
{
sendModOfflineMsg
(
modIds
);
}
// abnormal. this module should not be in this box
if
(
peerData
[
"status"
][
selfId
]
==
1
||
peerData
[
"status"
][
selfId
]
==
2
)
{
spdlog
::
warn
(
"evdaemon {} refuse to start {}: it was asked to be stopped, and is removed from cluster config"
,
this
->
devSn
,
selfId
);
}
else
{
// deregister this module
peerData
[
"status"
][
selfId
]
=
0
;
if
(
peerData
[
"pids"
].
count
(
selfId
)
!=
0
)
{
peerData
[
"pids"
].
erase
(
selfId
);
...
...
@@ -618,6 +625,7 @@ private:
return
0
;
}
// body.size = 4, normal msg
meta
=
body2str
(
body
[
2
]);
selfId
=
body2str
(
body
[
0
]);
peerId
=
body2str
(
body
[
1
]);
...
...
@@ -633,6 +641,7 @@ private:
if
(
peerId
==
"evcloudsvc"
)
{
zmqhelper
::
z_send
(
pDealer
,
peerId
,
body
[
2
],
body
[
3
]);
}
// TODO: below logic is dead, in fact peer msg is managed by evmgr
else
{
vector
<
vector
<
uint8_t
>
>
v
=
{
body
[
1
],
body
[
0
],
body
[
2
],
body
[
3
]};
if
(
peerData
[
"status"
].
count
(
peerId
)
!=
0
&&
peerData
[
"status"
][
peerId
]
!=
0
&&
this
->
peerData
[
"status"
][
peerId
][
peerId
]
!=
-
1
)
{
...
...
@@ -668,6 +677,7 @@ private:
}
}
else
{
// TODO: logic below is dead. peer module never send normal message to daemon
// message to mgr
// spdlog::info("evdaemon {} subsystem report msg received: {}; {}; {}", devSn, zmqhelper::body2str(body[0]), zmqhelper::body2str(body[1]), zmqhelper::body2str(body[2]));
if
(
meta
==
"pong"
||
meta
==
"ping"
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论