提交 8ac021cf authored 作者: tobyfan1980's avatar tobyfan1980

refine .gitignore and logs

上级 bb898a89
......@@ -5,7 +5,11 @@
*.pyc
*.so
build/
**/build
__pycache__/
.DS_Store
**/.DS_Store
**/vendor/include
# Random junk
*.sw?
......
## 编译环境
目前并没有在 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.
......
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论