在cooja上使用collectview(二)
来源:互联网 发布:ps for mac如何破解 编辑:程序博客网 时间:2024/05/23 20:52
上一篇文章中通过运行contiki2.7提供的关于collectview的例子,简单了解了collectview的效果。本文主要通过将collectview功能集成到其他网络项目中,达到数据统计的目的。
这里以contiki2.7自带的另一个例子/examples/ipv6/hello-world为例,介绍如何使用collectview。
- 首先,修改hello-world的Makefile文件,添加如下内容:
APPS = serial-shell powertrace collect-view
然后修改hello-world.c文件,在里面添加头文件:
#include "contiki.h"#include "shell.h"#include "serial-shell.h"#include "collect-view.h"#include "net/rime.h"
添加代码:
PROCESS(collect_view_shell_process, "Contiki Collect View Shell");AUTOSTART_PROCESSES(&hello_world_process,&collect_view_shell_process);PROCESS_THREAD(collect_view_shell_process, ev, data){ PROCESS_BEGIN(); serial_shell_init(); shell_blink_init();#if WITH_COFFEE shell_file_init(); shell_coffee_init();#endif /* WITH_COFFEE */ /* shell_download_init(); */ /* shell_rime_sendcmd_init(); */ /* shell_ps_init(); */ shell_reboot_init(); shell_rime_init(); shell_rime_netcmd_init(); /* shell_rime_ping_init(); */ /* shell_rime_debug_init(); */ /* shell_rime_debug_runicast_init(); */ shell_powertrace_init(); /* shell_base64_init(); */ shell_text_init(); shell_time_init(); /* shell_checkpoint_init(); */ /* shell_sendtest_init(); */#if CONTIKI_TARGET_SKY shell_sky_init();#endif /* CONTIKI_TARGET_SKY */ shell_collect_view_init(); PROCESS_END();}
- Makefile文件和.c文件修改完之后,通过make生成相应的.ihex文件: make TARGET=sky hello-world.ihex。(其中hello-world应该与makefile文件中的名称相对应) 运行之后,会在该目录下生成hello-world.ihex文件。
- 将上一步生成的hello-world.ihex文件复制到contiki/tools/collect-view/dist目录下,并将原有的.ihex文件删除。
- 修改/tools/collect-view下的build.xml文件,将所有collect例子相关的名称、路径改为hello-world的,如将路径/examples/collect改为/examples/hello-world, collect.ihex改为hello-world.ihex,将collect.exists改为hello-world.exists。
- 修改完成之后,在/tools/collect-view目录下运行$ant命令,如下图所示:
- 成功运行之后,将dist目录复制到/examples/hello-world目录下。
- 在cooja中正常模拟运行hello-world sky节点(笔者添加了5个节点),并选择Tools->Collect View->Sky1,然后会新弹出sensor data collect界面,在界面中选择File->Clear Sensor Data,清除历史数据。然后点击Start Collect , Send command to nodes。等待一段时间会显现相应的数据统计结果。
0 0
- 在cooja上使用collectview(二)
- 在cooja上使用collectview
- 如何在cooja下使用collectview
- 封装tableView、collectView,简化使用
- 在dll上使用资源(二)
- Cooja 中自定义 Java Mote 使用 Collect-View
- Cooja Simulator
- Cooja Simulator
- 使用Java在Web上实现简易干特图之二
- 在QtCreator上使用版本控制系统Git(二)
- LinPhone开发文档二:在Android/iPhone上使用linphone
- 在QtCreator上使用版本控制系统Git(二)
- 在QtCreator上 使用版本控制系统Git(二)
- 在QtCreator上 使用版本控制系统Git(二)
- [Python 学习] 二、在Linux平台上使用Python
- 在Mac上Git的使用(二)
- tensorflow在mnist集上的使用示例(二)
- redux在react-native上使用(二)--加入redux-saga
- SpringIOC,DI+dynamic proxy 实现盗版AOP
- python核心编程-作用域
- 响应式图片 <img src=,srcset=,sizes=>
- 美团推荐系统整体框架与关键工作
- zabbix监控报错zabbix server is not running: the information displayed may not be current的解决
- 在cooja上使用collectview(二)
- 如何打包python文件为exe程序
- php字符串分割
- 社交网络分析:微博得到最终用户标签的十一种假设
- HDU 1059 Dividing(多重背包二进制优化)
- 图论入门(3):最小生成树之Prim算法(以及优先队列的bug修正)
- Java基础——Java重点基础之IO流(一)
- JavaScript事件绑定
- 扩展欧几里德问题