Net Anim "show remaining capacity" battery or energy level not working with WifiRadioModel does not shows icon

503 views
Skip to first unread message

Francisco Eduardo Balart Sanchez

unread,
Feb 21, 2017, 9:29:07 AM2/21/17
to ns-3-users
Good day:

John

i have already read and tried the items mentioned in discussions:


At difference of the example (of wireles animation) i´m not using a simpledeviceenergymodel 
Im using a wifiRadioEnergyModel and i use the helpers and the install instead of pointers and add the
attributes manually

when replaying in NetAnim (version 3.107) on Ns.3.25
I don't get the icon of the battery,
John can you please support me?
manet_TxRx_16_feb_2017.cc

Francisco Eduardo Balart Sanchez

unread,
Feb 22, 2017, 9:49:38 AM2/22/17
to ns-3-users
Good day John, is there any pointers here that can aid me
would be greatly appreciated :)

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 4:56:59 PM3/2/17
to ns-3-users
Good day:

So taking a closer look in the disscussion at https://groups.google.com/d/topic/ns-3-users/r96qVKEOVzQ/discussion

The file provided by Tommaso give a lot of insight about the trace conect with context in the file at: 

Nevertheless i still not manage to see the total energy, nor to be able to see the battery when clicking in the "show remaining capacity" icon in netanim

The weird thing is when i try like in the example: energy-model-example.cc

They do the following:

  Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
  NS_ASSERT (basicRadioModelPtr != NULL);
  basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));

But when i implemented within the for loop like in the file Tomasso:

    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (i);
    NS_ASSERT (basicRadioModelPtr != NULL);
    basicRadioModelPtr->TraceConnect ("TotalEnergyConsumption",PrintID(sources.Get(i)->GetNode()), MakeCallback (&TotalEnergy));

assert failed. cond="basicRadioModelPtr != NULL", file=../scratch/manet_TxRx_2_march_2017.cc, line=414
terminate called without an active exception
Command ['/home/balart40/Desktop/balart40/ns/ns-allinone-3.25/ns-3.25/build/scratch/manet_TxRx_2_march_2017'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

And when i implement Tomasso´s solution i don´t get compiling error but i never see the message of totalenergy

    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (i);
    NS_ASSERT (basicSourcePtr != NULL);
    basicSourcePtr->TraceConnect ("TotalEnergyConsumption",PrintID(sources.Get(i)->GetNode()), MakeCallback (&TotalEnergy));

Any help would be grealty appreciated

Thanks

Eduardo

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 5:06:19 PM3/2/17
to ns-3-users
manet_TxRx_2_march_2017.cc

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 6:43:57 PM3/2/17
to ns-3-users
I made some experiments and it seems that the total energy consumption trace callback can only be applied to 1 node?

So for my for loop in which i make all my callbacks i implemented this for debug

  int nodeIndexx = 0;
  for (uint32_t i = 0; i < nDevices; ++i)
  {
    NS_LOG_UNCOND ("%INFO: node "<<i);
    NS_LOG_UNCOND ("%INFO: creating wifidevicepointer callbacks");
    Ptr<WifiNetDevice> wifiNetDevicePointer = DynamicCast<WifiNetDevice> (devices.Get (nodeIndexx)); 
    wifiNetDevicePointer->SetAddress(Mac48Address::Allocate ());  
    devices.Get(nodeIndexx)->SetReceiveCallback(MakeCallback(&ReceivePacket));
    //wifiNetDevicePointer->GetPhy()->TraceConnectWithoutContext ("MonitorSnifferRx", MakeCallback (&ReceivePacketWithRss));
    NS_LOG_UNCOND ("%INFO: creating remaining energy callback");
    Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (nodeIndexx));
    basicSourcePtr->TraceConnect ("RemainingEnergy",PrintID(sources.Get(nodeIndexx)->GetNode()), MakeCallback (&RemainingEnergyTrace)); 
    NS_LOG_UNCOND ("%INFO: creating radiomodel pointer");
    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (nodeIndexx);
    NS_LOG_UNCOND ("%INFO: creating pointer assert to null");
    NS_ASSERT (basicRadioModelPtr != NULL);
    NS_LOG_UNCOND ("%INFO: creating total energy callback");
    basicRadioModelPtr->TraceConnect ("TotalEnergyConsumption",PrintID(sources.Get(nodeIndexx)->GetNode()), MakeCallback (&TotalEnergy));
    //sources.Get (i)->TraceConnectWithoutContext("RemainingEnergy", MakeCallback (&RemainingEnergyTrace<nDevicesIt[i]>));
    //basicSourcePtr->TraceConnectWithoutContext("RemainingEnergy", MakeCallback (&RemainingEnergyTrace)); 
    // This is temporal since at end Nodes will have its own broadcast function below can lead to dead lock, need to see Mutual Exlusion features
    double r =1.0+ ((double) rand() / (RAND_MAX));
    Simulator::ScheduleWithContext (wifiNetDevicePointer->GetNode ()->GetId (),Seconds (r), &GenerateHelloBroadcast, wifiNetDevicePointer, packetSize, interPacketInterval, numPackets);
    nodeIndexx++;
  }

And the output was:

%INFO: Starting Test now...
%INFO: Creating Nodes...
%INFO: Size of vector of vectors 3
%INFO: Configuring PHY Loss model and connecting to PHY...
%INFO: Configuring PHY Loss model...
%INFO: Connecting PHY with Channel...
%INFO: Configuring PHY STD and RSM...
%INFO: Configuring MAC...
%INFO: configuring mobility...
%INFO: configuring Energy...
%INFO: Assign Mac48Address Addresses & Generating Traffic hello world broadcast
%INFO: node 0
%INFO: creating wifidevicepointer callbacks
%INFO: creating remaining energy callback
%INFO: creating radiomodel pointer
%INFO: creating pointer assert to null
%INFO: creating total energy callback
%INFO: node 1
%INFO: creating wifidevicepointer callbacks
%INFO: creating remaining energy callback
%INFO: creating radiomodel pointer
%INFO: creating pointer assert to null
assert failed. cond="basicRadioModelPtr != NULL", file=../scratch/manet_TxRx_2_march_2017.cc, line=420
terminate called without an active exception
Command ['/home/balart40/Desktop/balart40/ns/ns-allinone-3.25/ns-3.25/build/scratch/manet_TxRx_2_march_2017'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

I then ran the same code just changing the line
    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
And it worked
Does this min that we cannot set a trace of total energy consumption to each node, or  i´m missing something in the implementation?

John, Tomasso or Cristiano Tapparello  any hint or support would be happily appreciated

Thanks in advance and best regards

Eduardo

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 6:48:29 PM3/2/17
to ns-3-users

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 7:21:55 PM3/2/17
to ns-3-users
I thought  it would be because i use the same pointer name so i made an array of pointers but i´m still getting the same error:

int nodeIndexx = 0;
  Ptr<DeviceEnergyModel> basicRadioModelPtr[nDevices];
  Ptr<BasicEnergySource> basicSourcePtr[nDevices];
  for (uint32_t i = 0; i < nDevices; ++i)
  {
    NS_LOG_UNCOND ("%INFO: node "<<i);
    NS_LOG_UNCOND ("%INFO: creating wifidevicepointer callbacks");
    Ptr<WifiNetDevice> wifiNetDevicePointer = DynamicCast<WifiNetDevice> (devices.Get (nodeIndexx)); 
    wifiNetDevicePointer->SetAddress(Mac48Address::Allocate ());  
    devices.Get(nodeIndexx)->SetReceiveCallback(MakeCallback(&ReceivePacket));
    //wifiNetDevicePointer->GetPhy()->TraceConnectWithoutContext ("MonitorSnifferRx", MakeCallback (&ReceivePacketWithRss));
    NS_LOG_UNCOND ("%INFO: creating remaining energy callback");
    basicSourcePtr[nodeIndexx] = DynamicCast<BasicEnergySource> (sources.Get (nodeIndexx));
    basicSourcePtr[nodeIndexx]->TraceConnect ("RemainingEnergy",PrintID(sources.Get(nodeIndexx)->GetNode()), MakeCallback (&RemainingEnergyTrace)); 
    NS_LOG_UNCOND ("%INFO: creating radiomodel pointer");
    basicRadioModelPtr[nodeIndexx] = basicSourcePtr[nodeIndexx]->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (nodeIndexx);
    NS_LOG_UNCOND ("%INFO: creating pointer assert to null");
    NS_ASSERT (basicRadioModelPtr[nodeIndexx] != NULL);
    NS_LOG_UNCOND ("%INFO: creating total energy callback");
    basicRadioModelPtr[nodeIndexx]->TraceConnect ("TotalEnergyConsumption",PrintID(sources.Get(nodeIndexx)->GetNode()), MakeCallback (&TotalEnergy));
    //sources.Get (i)->TraceConnectWithoutContext("RemainingEnergy", MakeCallback (&RemainingEnergyTrace<nDevicesIt[i]>));
    //basicSourcePtr->TraceConnectWithoutContext("RemainingEnergy", MakeCallback (&RemainingEnergyTrace)); 
    // This is temporal since at end Nodes will have its own broadcast function below can lead to dead lock, need to see Mutual Exlusion features
    double r =1.0+ ((double) rand() / (RAND_MAX));
    Simulator::ScheduleWithContext (wifiNetDevicePointer->GetNode ()->GetId (),Seconds (r), &GenerateHelloBroadcast, wifiNetDevicePointer, packetSize, interPacketInterval, numPackets);
    nodeIndexx++;
  }
%INFO: Starting Test now...
%INFO: Creating Nodes...
%INFO: Size of vector of vectors 3
%INFO: Configuring PHY Loss model and connecting to PHY...
%INFO: Configuring PHY Loss model...
%INFO: Connecting PHY with Channel...
%INFO: Configuring PHY STD and RSM...
%INFO: Configuring MAC...
%INFO: configuring mobility...
%INFO: configuring Energy...
%INFO: Assign Mac48Address Addresses & Generating Traffic hello world broadcast
%INFO: node 0
%INFO: creating wifidevicepointer callbacks
%INFO: creating remaining energy callback
%INFO: creating radiomodel pointer
%INFO: creating pointer assert to null
%INFO: creating total energy callback
%INFO: node 1
%INFO: creating wifidevicepointer callbacks
%INFO: creating remaining energy callback
%INFO: creating radiomodel pointer
%INFO: creating pointer assert to null
assert failed. cond="basicRadioModelPtr[nodeIndexx] != NULL", file=../scratch/manet_TxRx_2_march_2017.cc, line=422
terminate called without an active exception
Command ['/home/balart40/Desktop/balart40/ns/ns-allinone-3.25/ns-3.25/build/scratch/manet_TxRx_2_march_2017'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


I´m really getting out of ideas, please any support or hint will be appreciated

Eduardo

Francisco Eduardo Balart Sanchez

unread,
Mar 2, 2017, 10:16:05 PM3/2/17
to ns-3-users
Good day:

So i think i figure it out, it will nice though to get a confirmation of the following:

  • With the sourcePointer we get the energy source of the node
    • Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (nodeIndexx));
  • And with the radiomodel pointer we get the device energy model of that node, if it had more than one we could access 1,2...n but since we only have one we will iterate to all the sources of the nodes (in this case nodeIndexx) but only access the only one energy model that they have which is 0 in this case.
    • Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
I hope to be right and somebody plz confirm the aforementioned

Regards

Eduardo

Francisco Eduardo Balart Sanchez

unread,
Mar 3, 2017, 5:47:35 PM3/3/17
to ns-3-users
John: 

Regardless i made it to work both the remaining energy and the total energy consumption (both callback are getting triggered)
The battery icon reflecting the battery level on the node is not working

 Or attached the code.

NS3 version: 3.25
Netanim version: 3.107

My remainingEnergy and TotalEnergyConsumption are workinng
The network is adhoc, i´m missing some attribute so i can see the battery level on the netanim when
clicking on  the "show remaining capacity" icon?
manet_TxRx_2_march_2017.cc

John Abraham

unread,
Mar 10, 2017, 4:53:28 PM3/10/17
to ns-3-...@googlegroups.com
Hi 

I apologize for the delay. Were you able to solve this issue? I tried your code, but main-packet-header is missing. 

John

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Francisco Eduardo Balart Sanchez

unread,
Mar 10, 2017, 5:52:08 PM3/10/17
to ns-3-users
Good day John:

Noup, the problem hasn't been solved, the last file you should use should be
manet_TxRx_2_march_2017.cc
But to be shure i ran again the file with a new filename: 
manet_TxRx_10_march_2017.cc
I´m putting at your disposition all the files of the run at:

My ran command was: sudo ./waf --run scratch/manet_TxRx_10_march_2017 2>log.out
NS3 version: ns-allinone-3.25
NetAnim verison: 3.107

Or attached in this reply.

Sorry about that file the main_packet_header.h is attached, you should be able to run it from scratch now

I appreaciate your follow up and support, also posted a pick in moment of transmission not showing battery icon :)

M.S. Francisco Eduardo Balart Sanchez

Manet_TxRx_16_feb_2017.xml
WifiSimpleAdhoc-0-0.pcap
WifiSimpleAdhoc-1-0.pcap
WifiSimpleAdhoc-2-0.pcap
log.out
netanimnotshowsbattery.png
main_packet_header.h

John Abraham

unread,
Mar 10, 2017, 6:33:06 PM3/10/17
to ns-3-...@googlegroups.com
any idea about this

./waf --run fran

Waf: Entering directory `/Users/johnabraham/ws/ns3push/ns-3-dev/build'

[ 958/2478] Compiling scratch/fran.cc

../scratch/fran.cc:205:181: error: variable has incomplete type 'struct mpduInfo'

void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)

                                                                                                                                                                                    ^

../scratch/fran.cc:205:172: note: forward declaration of 'mpduInfo'

void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)

                                                                                                                                                                           ^

../scratch/fran.cc:205:210: error: variable has incomplete type 'struct signalNoiseDbm'

void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)

                                                                                                                                                                                                                 ^

../scratch/fran.cc:205:195: note: forward declaration of 'signalNoiseDbm'

void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)

                                                                                                                                                                                                  ^

2 errors generated.



Francisco Eduardo Balart Sanchez

unread,
Mar 10, 2017, 6:42:57 PM3/10/17
to ns-3-users
Good day John:

I apologize i didn't uploaded the .cc file

please use the one provided in the github link or attached in this reply:
 
My run command was: sudo ./waf --run scratch/manet_TxRx_10_march_2017

regards

also posted a pic showing no problems of compilation from my part
NS3 version: ns-allinone-3.25

thanks for the quick response

Eduardo
manet_TxRx_10_march_2017.cc
Screen Shot 2017-03-10 at 5.39.58 PM.png

John Abraham

unread,
Mar 11, 2017, 1:55:22 PM3/11/17
to ns-3-...@googlegroups.com
Hi Eduardo,

1. I think you are probably the first person to use the BasicEnergySourceHelper along with tracing. I'm guessing we can't do much with tracing here as the energy module aggregates EnergySourceContainer to the node. EnergySourceContainer does not offer any trace sources. Only energy source offers a trace source. The wireless-animation example aggregates the EnergySource to the node. This assumption is what the original authors of the RemainingEnergy trace used. In short, using the helper instead of directly aggregating the source to the node, does not trigger any traces.
This seems to be more of an issue with "energy" module rather than "netanim".


2. I attached a slightly modified animation-interface module, which tries to explicitly attach tracing. It assumes there is only one energy source per node

3.  The other issue, is that the animator scales down the battery image so much it is not visible.  We should open a bug to track it. For now in animnode.cpp, 10x scaling.

replace: 

painter->drawPixmap (bottomLeft.x (), bottomLeft.y (), 1, 1, m_batteryPixmap);


with:

painter->drawPixmap (bottomLeft.x (), bottomLeft.y (), 10, 10, m_batteryPixmap);



john



--
fran2.cc
animation-interface.cc
animation-interface.h

John Abraham

unread,
Mar 11, 2017, 1:55:39 PM3/11/17
to ns-3-...@googlegroups.com
Screen Shot 2017-03-11 at 9.55.53 AM.png
Screen Shot 2017-03-11 at 10.36.01 AM.png

Francisco Eduardo Balart Sanchez

unread,
Mar 23, 2017, 9:40:06 PM3/23/17
to ns-3-users
Good day John:

Thanks for the detailed response, so we have 2 "possible bugs"

1- An energy module bug involving the basicEnergySource (can you involve the Energy Module developer(s)), either way i will modigy the install method so it does the "manual" adding in a for loop as a partial patch (maybe this should be in the next release as patch so others doesn't encounter with this) while this is fixed

2 - The netAnim bug 

Can you please add me to the mailing list so i can keep posted about this items, since they affect my code and i´m really interested in these two, specially the first one :)

Francisco Eduardo Balart Sanchez

unread,
Mar 24, 2017, 9:01:04 PM3/24/17
to ns-3-users
Good day John:

In the mean while i "patched" my test after futile tries of modifying the basic energy source,
my futile tries were to add the

<NodeContainer>.Get (i)->AggregateObject (energySource);

instruction In the install method this brought me 2 questions

  1. What is the difference between these two approaches which i think do the same

    • <NodeContainer>.Get (i)->AggregateObject (energySource);
      and
      source->SetNode (node);
                relationship should be bi-directional right?
  2. Regardless that EnergySourceContainer Rdoes not bring tracing with it we bring the energy source with the comman
    • Ptr<BasicEnergySource>  basicSourcePtr  =  wifiNetDevicePointer->GetNode ()->GetObject<BasicEnergySource>();
    • So that one sohuld have the tracing with it right?


While this "possible bugs" are fixed i "patched" my test with the following


  Time t1 = Seconds (1.0);
  int nodeIndexxx = 0;

  for (uint32_t i = 0; i < nDevices; ++i)
  {
    Ptr<BasicEnergySource> energySource = CreateObject<BasicEnergySource>();
    Ptr<WifiRadioEnergyModel> radioenergyModel = CreateObject<WifiRadioEnergyModel>();
    energySource->SetInitialEnergy (double (5));
    energySource->SetEnergyUpdateInterval (t1);
    radioenergyModel->SetEnergySource (energySource);
    energySource->AppendDeviceEnergyModel (radioenergyModel);
    radioenergyModel->SetTxCurrentA (double (0.0174));
    radioenergyModel->SetRxCurrentA (double (0.0174));
    c.Get (nodeIndexxx)->AggregateObject (energySource);
    nodeIndexxx++;
  }


And the tracing with

    Ptr<BasicEnergySource>  basicSourcePtr  =  wifiNetDevicePointer->GetNode ()->GetObject<BasicEnergySource>();
    basicSourcePtr->TraceConnect ("RemainingEnergy",PrintID(wifiNetDevicePointer->GetNode ()), MakeCallback (&RemainingEnergyTrace));
    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
NS_ASSERT (basicRadioModelPtr != NULL);
    basicRadioModelPtr->TraceConnect ("TotalEnergyConsumption",PrintID(wifiNetDevicePointer->GetNode ()), MakeCallback (&TotalEnergy));


Which seems to do the trick

Attached the test and pic showing energy

thanks again
manet_TxRx_24_march_2017.cc
screenshot.png

Francisco Eduardo Balart Sanchez

unread,
Oct 21, 2018, 10:32:30 PM10/21/18
to ns-3-users
John:

i have the following test on ns 3.25 with your modification on the animation interface and made the changes on the test 
Nevertheless now the problem is that i require to have the energy levels of ALL nodes at time T but now with your setup i get the energy levels of the nodes that triggered the tracecallback at such time T regardless in the setup i  put to have a update of 1 second


 Energy setup
  TimeValue t1 = Seconds (1.0);
  /* energy source */
  BasicEnergySourceHelper basicSourceHelper;
  // configure energy source
  basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (100));
  basicSourceHelper.Set ("PeriodicEnergyUpdateInterval", t1);
  // install source
  EnergySourceContainer sources = basicSourceHelper.Install (nodes);
  /* device energy model */
  WifiRadioEnergyModelHelper wifiRadioEnergyModelHelper;
  // configure radio energy model
  wifiRadioEnergyModelHelper.Set ("TxCurrentA", DoubleValue (0.0174));
  wifiRadioEnergyModelHelper.Set ("RxCurrentA", DoubleValue (0.0174));
  // install device model
  DeviceEnergyModelContainer deviceModels = wifiRadioEnergyModelHelper.Install (devices, sources);

Traceback on the test case besides yours on the setup you mentioned above

  int iii = 0;
  uint32_t nDevices = devices.GetN ();
  for (uint32_t i = 0;i < nDevices; ++i)
  {
    Ptr<WifiNetDevice> p = DynamicCast<WifiNetDevice> (devices.Get (i)); 
   
    p->SetAddress(Mac48Address::Allocate ());  
    Ptr<EESOA> macN = DynamicCast<EESOA> (p->GetMac());
    macN->SetNodeId(p->GetNode ()->GetId ());
    prev_role[i]= 100; //this role does not exists.
    prev_nNodes[i]= 0;
    Simulator::ScheduleWithContext (p->GetNode ()->GetId (), MilliSeconds(90), &modify, p, &anim);
    Simulator::ScheduleWithContext (p->GetNode ()->GetId (), Seconds(1), &printNonEESOAtx, p);
    p->GetPhy()->TraceConnect ("PhyTxBegin",PrintID(p->GetNode ()), MakeCallback (&PhyTxBegin));
    // energy model
    Ptr<BasicEnergySource>  basicSourcePtr  =  DynamicCast<BasicEnergySource>(p->GetNode ()->GetObject<EnergySourceContainer>()->Get(0));
    NS_ASSERT (basicSourcePtr != NULL);
    basicSourcePtr->TraceConnect ("RemainingEnergy",PrintID(p->GetNode ()), MakeCallback (&RemainingEnergyTrace)); 
    Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get(0);
    NS_ASSERT (basicRadioModelPtr != NULL);
    //basicRadioModelPtr->TraceConnect ("TotalEnergyConsumption",PrintID(p->GetNode ()), MakeCallback (&TotalEnergy));
    iii++;
  }

I just get a few not all
so something is not working on the periodic interval 

see my log

%INFO: TimeStamp: 60.988 segs Node: ID: 97   Current Remaining energy = 54.1867 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 69   Current Remaining energy = 54.366 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 75   Current Remaining energy = 54.9593 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 3   Current Remaining energy = 53.0506 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 38   Current Remaining energy = 52.698 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 76   Current Remaining energy = 53.2712 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 54   Current Remaining energy = 52.6771 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 22   Current Remaining energy = 52.641 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 47   Current Remaining energy = 55.0897 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 16   Current Remaining energy = 52.896 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 43   Current Remaining energy = 53.0377 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 49   Current Remaining energy = 55.104 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 61   Current Remaining energy = 55.0461 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 89   Current Remaining energy = 55.5411 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 26   Current Remaining energy = 54.9403 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 63   Current Remaining energy = 53.2001 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 90   Current Remaining energy = 53.2118 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 8   Current Remaining energy = 55.4874 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 42   Current Remaining energy = 56.2636 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 57   Current Remaining energy = 55.0819 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 48   Current Remaining energy = 53.6125 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 55   Current Remaining energy = 52.7304 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 13   Current Remaining energy = 56.2103 Joules
%INFO: TimeStamp: 60.988 segs Node: ID: 68   Current Remaining energy = 53.0735 Joules
%INFO: TimeStamp: 60.9884 segs Node: ID: 97   Current Remaining energy = 54.1867 Joules
%INFO: TimeStamp: 60.9884 segs Node: ID: 69   Current Remaining energy = 54.3659 Joules



Reply all
Reply to author
Forward
0 new messages