queuing delay
processing delay
transmission delay
propagation delay
end-to-end delay
packet loss
2010년 1월 18일 월요일
Nodes do not appear when using "lowpower"
1. If you are compiling an application such as Delta using the "lowpower" option like this
make tmote lowpower
2. Then there is a known bug that causes synchronization to fail.
3. To prevent this bug, download this new version of NetSyncM.nc and copy it to the /tos/lib/netsync directory, replacing the existing file.
----------------------------------------------------------------------------------
void setSyncMaster() {
uint32_t now;
// if a find is in progress, disable the find
call SPNeighbor.findDone();
atomic {
m_smsg->hopcount = 0;
m_nexton = m_nextoff = 0;
broadcast.addr = TOS_BCAST_ADDR;
m_smsg->global_time = m_smsg->local_time = call LocalTime.get();
now = m_smsg->global_time & 0xFFFF0000;
broadcast.timeon = now + (TIME_ON 1 PERIOD);
broadcast.timeoff = now + (TIME_OFF 1 PERIOD);
m_smsg->on = TIME_ON;
m_smsg->off = TIME_OFF;
m_timeout = 0;
}
// insert into the neighbor table
call SPNeighbor.insert(&broadcast);
}
----------------------------------------------------------------------------------
4. Recompile and reinstall your application using make tmote lowpower for the changes to take effect.
make tmote lowpower
2. Then there is a known bug that causes synchronization to fail.
3. To prevent this bug, download this new version of NetSyncM.nc and copy it to the /tos/lib/netsync directory, replacing the existing file.
----------------------------------------------------------------------------------
void setSyncMaster() {
uint32_t now;
// if a find is in progress, disable the find
call SPNeighbor.findDone();
atomic {
m_smsg->hopcount = 0;
m_nexton = m_nextoff = 0;
broadcast.addr = TOS_BCAST_ADDR;
m_smsg->global_time = m_smsg->local_time = call LocalTime.get();
now = m_smsg->global_time & 0xFFFF0000;
broadcast.timeon = now + (TIME_ON 1 PERIOD);
broadcast.timeoff = now + (TIME_OFF 1 PERIOD);
m_smsg->on = TIME_ON;
m_smsg->off = TIME_OFF;
m_timeout = 0;
}
// insert into the neighbor table
call SPNeighbor.insert(&broadcast);
}
----------------------------------------------------------------------------------
4. Recompile and reinstall your application using make tmote lowpower for the changes to take effect.
2010년 1월 10일 일요일
Is this a bug in Moteiv Boomerang MultiHop?
In selectParent() function of MultihopLQIM.nc, is the following line a bug?
if (parents[i].cost + parents[i].estimate < newparent) {
---------------------------------------------------------------------------
Should "newparent" be "parentestimate" ??
void selectParent() {
int i;
int newparent = m_parent;
uint16_t parentestimate = parents[m_parent].cost +
parents[m_parent].estimate;
// if our parent is invalid, pick the best parent
if (parents[m_parent].addr == MHOP_INVALID_PARENT) {
for (i = 0; i < MHOP_PARENT_SIZE; i++) {
if (parents[i].cost + parents[i].estimate < newparent) {
newparent = i;
parentestimate = parents[i].cost + parents[i].estimate;
}
}
}
// if we have a parent, don't switch unless they're worthwhile
...
if (parents[i].cost + parents[i].estimate < newparent) {
---------------------------------------------------------------------------
Should "newparent" be "parentestimate" ??
void selectParent() {
int i;
int newparent = m_parent;
uint16_t parentestimate = parents[m_parent].cost +
parents[m_parent].estimate;
// if our parent is invalid, pick the best parent
if (parents[m_parent].addr == MHOP_INVALID_PARENT) {
for (i = 0; i < MHOP_PARENT_SIZE; i++) {
if (parents[i].cost + parents[i].estimate < newparent) {
newparent = i;
parentestimate = parents[i].cost + parents[i].estimate;
}
}
}
// if we have a parent, don't switch unless they're worthwhile
...
tinyos-help
2010년 1월 5일 화요일
interface Intercept...
MultihopRoute 라이브러리에서는 intercept라는 인터페이스를 제공하는데 이 인터페이스는 멀티홉 라우팅 레이어에서 자신에게 전달된 패킷을 상위 레이어에서 참조할 수 있도록 해주는 것으로 데이터를 취합하고자 할 때 사용할 수 있다.
예를 들어 A->B->C->D 와 같이 멀티홉 라우팅을 할 경우
A: sned();
B: intercept();
C: intercept();
D: receive();
와 같이 동작하게 된다.
이 인터페이스는 /opt/tinyos-1.x/tos/interface/Intercept.nc 에 위치하며, 자세한 내용은 해당 파일을 참조하면 된다.
이 인터페이스는 MultihopRoute 라이브러리에서 구현하기 때문에 이 라이브러리로 wiring을 하여 사용하면 된다.
즉,
-----------------------------------------------------------------
configuration Test{
}
implementation {
component LQIMultiHopRouter as multihopM;
TestM.Intercept -> multihopM.Intercept[AM_SURGEMSG];
}
module TestM {
use interface Intercept;
}
implementation {
event result_t Intercept.intercept(...) {
if( LOCAL_ADDRESS == BASE_ADDRESS ) {
if( data > threshhold ) {
Leds.redOn();
}
}
return SUCCESS;
}
}
-----------------------------------------------------------------
와 같은 식으로 구현하면 된다.
intercept 인터페이스에서는 intercept라는 이벤트를 발생시키는데, 이것은 자신에게 전달된 패킷이 도착했다는 것을 알려주는 것이며 이 때, 인수로 넘어온 패킷을 참조하여 데이터를 취합 하는 작업을 수행할 수 있다. intercept 이벤트 핸들러는 성공 여부를 리턴해주어야 하는데
하부에서 이 값에 따라 데이터를 포워딩할지의 여부를 결정한다. 즉 데이터를 취합하는 경우 수신된 데이터를 그대로 포워딩 하는 것이 아니라 자신에 데이터나 다른 노드에서 수신된 데이터들과 함께 취합한 다음 새로운 패킷으로 전송해야하기 때문에 단순한 포워딩이 아닌 Send()함수를 이용해서 전송을 해주어야 한다. 이를 위해 intercept 이벤트 핸들러에서 리턴 값으로 SUCCESS를 할 경우 단순히 포워딩을 하지만 FAIL을 리턴할 경우 포워딩을 안하기 때문에 상위레이어에서 취합한 데이터를 Send함수를 이용해서 전송할 수 있다. 상위에서 데이터 취합을 하면서 SUCCESS값을 넘겨주면 단순 포워딩도 하고 데이터 취합도 하는 것이기 때문에 중복된 데이터가 전송되는 경우가 발생하므로 주의해야 한다.
예를 들어 A->B->C->D 와 같이 멀티홉 라우팅을 할 경우
A: sned();
B: intercept();
C: intercept();
D: receive();
와 같이 동작하게 된다.
이 인터페이스는 /opt/tinyos-1.x/tos/interface/Intercept.nc 에 위치하며, 자세한 내용은 해당 파일을 참조하면 된다.
이 인터페이스는 MultihopRoute 라이브러리에서 구현하기 때문에 이 라이브러리로 wiring을 하여 사용하면 된다.
즉,
-----------------------------------------------------------------
configuration Test{
}
implementation {
component LQIMultiHopRouter as multihopM;
TestM.Intercept -> multihopM.Intercept[AM_SURGEMSG];
}
module TestM {
use interface Intercept;
}
implementation {
event result_t Intercept.intercept(...) {
if( LOCAL_ADDRESS == BASE_ADDRESS ) {
if( data > threshhold ) {
Leds.redOn();
}
}
return SUCCESS;
}
}
-----------------------------------------------------------------
와 같은 식으로 구현하면 된다.
intercept 인터페이스에서는 intercept라는 이벤트를 발생시키는데, 이것은 자신에게 전달된 패킷이 도착했다는 것을 알려주는 것이며 이 때, 인수로 넘어온 패킷을 참조하여 데이터를 취합 하는 작업을 수행할 수 있다. intercept 이벤트 핸들러는 성공 여부를 리턴해주어야 하는데
하부에서 이 값에 따라 데이터를 포워딩할지의 여부를 결정한다. 즉 데이터를 취합하는 경우 수신된 데이터를 그대로 포워딩 하는 것이 아니라 자신에 데이터나 다른 노드에서 수신된 데이터들과 함께 취합한 다음 새로운 패킷으로 전송해야하기 때문에 단순한 포워딩이 아닌 Send()함수를 이용해서 전송을 해주어야 한다. 이를 위해 intercept 이벤트 핸들러에서 리턴 값으로 SUCCESS를 할 경우 단순히 포워딩을 하지만 FAIL을 리턴할 경우 포워딩을 안하기 때문에 상위레이어에서 취합한 데이터를 Send함수를 이용해서 전송할 수 있다. 상위에서 데이터 취합을 하면서 SUCCESS값을 넘겨주면 단순 포워딩도 하고 데이터 취합도 하는 것이기 때문에 중복된 데이터가 전송되는 경우가 발생하므로 주의해야 한다.
피드 구독하기:
덧글 (Atom)