Cooja Can t add multiple motes in simulation script

0 votes

I am attempting to modify the RPL algorithm in Contiki using Cooja for the simulations. Basically what I'm trying to do is to assess the efficiency of my algorithm by adding nodes to the network randomly by a certain distribution (like Gamma distribution). To do this I've written a script. The problem is, I can't add more than one mote using this script. Here is what I have so far:

var motes_array = new Array(); 
moteType = mote.getType();
for (i = 0; i < 5; i++) {
    motes_array[i] = moteType.generateMote(mote.getSimulation());
    mote.getSimulation().addMote(motes_array[i]);
} 
log.testOK();

The above code adds only one mote, although the loop is executed 5 times as expected.

Can anyone help me out?

Thanks.

Apr 29, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
1,747 views

1 answer to this question.

0 votes

I can't really find an immediate problem with the code. 

Is it necessary to use YIELD, by the way? Why not simply execute the loop body 5 times?

answered Apr 29, 2019 by Upasana
• 8,620 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer
0 votes
1 answer

Setting-up a RFID RC522 chip in Raspberry Pi?

First, let me congratulate you on buying ...READ MORE

answered Jul 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,708 views
0 votes
1 answer

Display time in a Windows Core IoT app with a clock!

It is possible, but you should understand ...READ MORE

answered Jul 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,571 views
0 votes
1 answer

Faster communication between two ESP8266 in client-server setup

Try following. Server loop void loop() { // ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
6,862 views
0 votes
1 answer

Decryption Technique of LORA IOT AES-128

It's not clear what you are using ...READ MORE

answered Sep 4, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,455 views
0 votes
1 answer

serial communication

You can try downloading the npm and node.js through ...READ MORE

answered Nov 22, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
745 views
0 votes
1 answer

Contiki-OS : CoAP protocol and CoRE link implementation

I don't think there's a standard way ...READ MORE

answered Jan 21, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
1,487 views
0 votes
1 answer

What is the time taken by a 200 byte message for transmission in a beacon-enabled network?

Now, data rates of IEEE 802.15.4 are ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
920 views
0 votes
1 answer

How to trigger Python script on Raspberry Pi from Node-Red

Node-RED supplies an exec node as part ...READ MORE

answered Sep 14, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
3,289 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP