contiki

How to calculate the throughput in Cooja simulator

假装没事ソ 提交于 2021-01-28 18:00:45
问题 Hi All, I work with example/ipv6/rpl-udp files in cooja simulator. How do I measure the amount of throughput in the network? With the command "powertrace_start(CLOCK_SECOND * 60); " in the client.c code, I get the Powertrace output. Can I use this method? throughput= packet received / Simulation time Simulation time = (ENERGEST_TYPE_TRANSMIT + ENERGEST_TYPE_LISTEN) / 32768 Is the method correct? Thanks in advance, Nasrin 回答1: No, that is not correct as ENERGEST_TYPE_* are constants. One way

How to enable message encryption in Contiki / Cooja simulator?

自闭症网瘾萝莉.ら 提交于 2020-08-21 18:56:27
问题 I want to encrypt the messages that are exchanged between sensor nodes. Can I do it without having access to real hardware sensor nodes, such as Tmote Sky? Can software encryption/block ciphers only be simulated on Tmote Sky nodes? If I need to use hardware encryption algorithms, then should I have a real sensor node? Also, I read that for symmetric encryption one must have real sensor nodes, but asymmetric encryption can work with emulated nodes as well? Any documentation or description

How to calculate total energy consumption using Cooja

不羁的心 提交于 2020-02-20 06:01:43
问题 I'm working with wireless sensor network lead to evaluate its performance in my work. I want to measure the latency and total energy consumption to find the remaining energy in each node. So my problem is that I have some values of tx rx cpu cpu_idle and I don't how to use them to calculate what I need. I found some rules that take the calculation but i don't understand exactly how to apply it in my case. Energy consumed in communication: Energy consumed by CPU: What is the meaning of 32768,

Contiki的内核分析-协程机制(一)

血红的双手。 提交于 2020-02-16 23:33:33
导读 本文通过分析Contiki的源码,梳理Contiki的process-event模型中的process机制。 通过前文的阐述我们贯通了event机制的原理。从本文开始,分析Contiki的process机制。 综述 Contiki的process机制实质上是一种协程调度机制,区别于抢占式调度,它只使用了2个字节的变量保存了process的“栈环境[1]”。所有的process以链表的形式保存。官方对此的称呼是protothread,即轻量级线程。但是协程是对它更好的诠释。在协程的环境下,每个process被动的获得cpu执行权,主动的放弃cpu执行权。因此在编程时务必要小心,防止产生死循环,导致整个系统宕机。 为了完全贯通Contiki中的协程机制,我们需要分为2个方面去阐述它:协程逻辑和协程实现,本篇主要阐述协程的逻辑层面,下篇阐述协程的语法实现层面。 协程运行的预备工作 在旅程的最开始,我们先来看一看Contiki的协程----process的类型定义。删除了一些无关紧要的部分,使代码更简洁。 # define PT_THREAD(name_args) char name_args struct process { //链接域 struct process * next ; //和process绑定的函数指针 PT_THREAD ( ( * thread ) (

How to return middle bits from random number generator?

北城以北 提交于 2020-01-05 03:47:09
问题 I have a random_rand() function which produces a random number between 0 and RANDOM_RAND_MAX. RANDOM_RAND_MAX is defined to be 65535. I would like to use the middle bits from the result of random_rand() instead of lowest-order bits so that I can make the randomiztion better. Could you please show me a quick way to do this. Thanks 回答1: That's naughty. Linear congruential generators work in such a way that the "most random" part comprises the lower order bits. A very famous IBM implementation

On the Air programming for Contiki

折月煮酒 提交于 2020-01-03 03:28:14
问题 I'm new Sky Motes on contiki and i'm trying to reprogram the nodes at run time. I've tried the Deluge and it's example in test-deluge.c which is found under examples/sky/test-deluge.c but i don't know what to do after uploading the code to node. So any Help Please ! My main target to reprogram the node on the Air Thanks in advance 回答1: Deluge only distributes the data to the nodes. You still need to link the file on the node. This is done by passing a coffee-file-descriptor to elfloader_load(

Adding my own library to Contiki OS

馋奶兔 提交于 2020-01-02 04:07:09
问题 I want to add some third party libraries to Contiki, but at the moment I can't. So I wanted to just test with a simple library. I wrote two files hello.c hello.h, in hello.c I have: printf(" Hello everbody, library call\n"); In hello.h I have: extern void print_hello(); I created hello.o using the command: msp430-gcc -mmcu=msp430f1611 hello.c -o hello.o I created an archive file: ar -cvq libhello.a hello.o I move to contiki, i write a simple program that calls hello.h to execute a function.I

Configuration msp430-unknown-none not supported

耗尽温柔 提交于 2019-12-25 08:33:07
问题 How do I get rid of the error I got on make TARGET=sky ? ERROR 1: ( .text will not fit in region rom ) 1.c: At top level: 1.c:14:57: warning: ‘last_informer’ defined but not used [-Wunused-variable] /usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: 1.sky section `.text' will not fit in region `rom' /usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: section .vectors loaded at [000000000000ffe0,000000000000ffff] overlaps section .text loaded at [0000000000004000,00000000000110eb] /usr/lib

Writing in the physical memory contiki

♀尐吖头ヾ 提交于 2019-12-25 07:26:49
问题 I'm using Linux distribution contiki OS,, I want to write info into file in the physical memory not logical ,, I try this ex using CFS (Coffee contiki file system) and it work fine (write (cfs_write) and read (cfs_read)),, but i could not find where is the file store (the path) ,, then i found that it's store in the logical memory _ , https://github.com/contiki-os/contiki/wiki/Coffee-filesystem-example ,, 来源: https://stackoverflow.com/questions/36607089/writing-in-the-physical-memory-contiki