How to change in existing protocols of MiXim

245 views
Skip to first unread message

Farman Ali

unread,
May 27, 2015, 3:02:01 PM5/27/15
to omn...@googlegroups.com
Hi everybody
I am working on WBAN .
We are stuck  at one point in working with Omnet++ that stop our further progress .

Now a days I am working on Mixim CSMA Mac Layer (NED, INI AND CC file)  coding. During editing the code I am facing a  Problem. 

Problem:
whatever we edit in .CC file that does not effect the result.
for example.
we create a new function in which we calculate the total data and take its result from Finish() function as:
void csmaMaclayer::totaltransdata()
{
    ////
            double timeBackoff =7*aUnitBackoffPeriod + 0.000000128;
            double tFrame = (aMaxPhyPacketSize + PHR )*32;
            tData =timeBackoff + tFrame + turnAtime + tAcktime;
            ////
    }
void csmaMaclayer::finish() {
recordScalar("nbBackoffs", nbBackoffs);
recordScalar("backoffValues", backoffValues);
recordScalar("nbtxFrame",nbTxFrames);

recordScalar("txAttempts", txAttempts);
recordScalar("tData", tData);

BaseMacLayer::finish();
}
But the result show only above three values which it already define.
further more if delete hole function this will not effect the result the output show the same result.


please anyone  tell me why this happen and how can we sold  it?
thanks

Thomas Menzel

unread,
May 28, 2015, 4:59:13 AM5/28/15
to omn...@googlegroups.com
Sorry for the question, but you are compiling and the compiling results in no errors?

Farman Ali

unread,
May 28, 2015, 12:22:52 PM5/28/15
to omn...@googlegroups.com
yes I am compiling it and it give the same result as given before . there is no effect of change on result if I change the coding of .CC file.

Thomas Menzel

unread,
May 28, 2015, 12:27:06 PM5/28/15
to omn...@googlegroups.com
Well, the I guess you're not editing the right file. Which project (e.g. Mixim Example) are you using or is your project based on?

Farman Ali

unread,
May 28, 2015, 12:35:50 PM5/28/15
to omn...@googlegroups.com
I am editing in Mixim Example(CSMAMac). and editing in CSMAMaclayer.cc file ..and also editing in CSMAmac.ned and omnetpp.ini file

--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/ig1XC8Ca898/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Farman Ali

unread,
May 28, 2015, 12:37:29 PM5/28/15
to omn...@googlegroups.com
I am editing in Mixim Example(CSMAMac). and editing in CSMAMaclayer.cc file ..and also editing in CSMAmac.ned and omnetpp.ini file

Michael Kirsche

unread,
May 29, 2015, 5:09:31 AM5/29/15
to omn...@googlegroups.com
Are you correctly registering your scalar before actually call it in your finish() method?
And is your totaltransdata method actually called to write data to tData scalar? Where's txAttempts been set??

Michael Kirsche

unread,
May 29, 2015, 6:34:01 AM5/29/15
to omn...@googlegroups.com
Just to add a note: with "registering the scalar" I meant:
- are the variables that your scalars shall record existing / initialized / created correctly?
- is the recording of scalars enabled in your omnetpp.ini? recording of every scalar (even the new ones) or just the existing ones (directly named for example)?

Farman Ali

unread,
May 29, 2015, 10:48:32 AM5/29/15
to omn...@googlegroups.com
i have initialized the the parameter in initialize() function of .cc file. but it is not enabled to give value from omnetpp.ini. So I initialized the function in ned file this enabled to give value from Omnetpp.ini file.
 But all this change does not effect the result..
 

--

Michael Kirsche

unread,
Jun 1, 2015, 10:42:24 AM6/1/15
to omn...@googlegroups.com
So I just tested it quickly and introduced a new scalar tData into the CSMAMacLayer code and tested it out with the CSMAMac example and the result does appear in the collected statistics.

Either you didn't initialize your variables, put the code in the wrong CSMA module (maybe you are working with the 802.15.4 CSMA MAC), got some compilation errors that you didn't fix or messed up the code somewhere else, but with MiXiM 2.3 (tested) it worked without problems.

Where are your variables (aUnitBackoffPeriod, aMaxPhyPacketSize, PHR, turnATime, ...) actually coming from? Some of them are not existent in MiXiM 2.3, did you add them on your own?
Also the function name (e.g. void csmaMaclayer::finish()...) would be wrong as the CSMA MAC Layer module is written with a different capitalization (CSMAMacLayer), but maybe you are using a different MiXiM version?

Farman Ali

unread,
Jun 10, 2015, 1:48:30 AM6/10/15
to omn...@googlegroups.com
the variables (aUnitBackoffPeriod, aMaxPhyPacketSize, PHR, turnATime, ...) are define in CSMAMacLayer.cc file ..Yes I add them Myself.....
please tell me I running the CSMAmac from mixim example and changing CSMAMacLayer.cc. Is this correct?? and the CSMAMacLayer is in (mixim->src->module->mac)?
Am I doing right change change??

Michael Kirsche

unread,
Jun 10, 2015, 3:05:35 AM6/10/15
to omn...@googlegroups.com
Yes those are the files that I've changed in my test and everything worked without problems.

Farman Ali

unread,
Jun 10, 2015, 5:08:48 AM6/10/15
to omn...@googlegroups.com
please if you don't mind send me the .ned .cc and .ini file that you have change. So that I can compare it with my files and try to know the error in my file

Michael Kirsche

unread,
Jun 10, 2015, 6:33:52 AM6/10/15
to omn...@googlegroups.com
I just added some test code in the .h and .cc files, NED and INI files were unchanged.
I've attached bot changes files.
CSMAMacLayer.cc
CSMAMacLayer.h

Farman Ali

unread,
Jun 10, 2015, 10:33:05 PM6/10/15
to omn...@googlegroups.com
I used these files but the result does not effect . I am checking the result from from generate result folder ->perfect test . is this correct??

Michael Kirsche

unread,
Jun 11, 2015, 5:32:00 AM6/11/15
to omn...@googlegroups.com
If doesn't matter which configuration you execute as the statistics are collected in the nodes independent from a configuration/scenario.

Everything works fine for me, so either you didn't compile your code successfully or I don't know... tData is collected as a scalar in my changed code, I can see the values after I run the example for a while and finish the simulation.

iratxe esparza chueca

unread,
Jun 11, 2015, 10:08:26 AM6/11/15
to omn...@googlegroups.com
I have the same problem!!
I'm trying to change code in SimpleServerApp (Veins-LTE) to get the delay, and the same happens: no matter what i change, nothing happens in the simulation. 
I tried just changing a cout to see if that changed but it didn't... 

Michael Kirsche

unread,
Jun 11, 2015, 10:22:57 AM6/11/15
to omn...@googlegroups.com
For both of you, if you are using Windows or Linux, make sure that your code is actually (re-)compiled successfully.
Delete the compiled exe/library (if necessary) to make sure that a recompilation was done.
If you change a file, you should see that the file is compiled again in the command line window.

iratxe esparza chueca

unread,
Jun 11, 2015, 10:39:33 AM6/11/15
to omn...@googlegroups.com
I'm sure it's a dumb question...but what do I have to delete in Ubuntu??

--

Michael Kirsche

unread,
Jun 12, 2015, 7:49:12 AM6/12/15
to omn...@googlegroups.com
For the case of MiXiM, delete (for example) the MiXiM Library under out/gcc-debug/src -> libmixim.so or under examples the miximexamples.

Simply cleaning the project should also work without problems as the output folder is deleted in that case.

iratxe esparza chueca

unread,
Jun 12, 2015, 12:10:29 PM6/12/15
to omn...@googlegroups.com
Thanks, but I cleaned and rebuilt the project and now I got this errors:

<!> Warning: opp_run: Cannot check library ../../src/veins: ../../src//libveins.so: cannot open shared object file: No such file or directory
<!> Error during startup: Cannot load library '../../src//libveins.so': ../../src//libveins.so: cannot open shared object file: No such file or directory.

Finally, I tried doing "make makefiles" and "make" again and that worked!! So, anytime I want to make changes I'll have to do that...

Michael Kirsche

unread,
Jun 13, 2015, 11:43:32 AM6/13/15
to omn...@googlegroups.com
Simply "building the project" from the IDE is the same as calling make makefiles and make from the console.
Are you constantly working from the shell? Then you have to use those commands, from the IDE the build and clean project commands are enough.
If they don't work correctly, maybe something in your project settings is wrong.

Farman Ali

unread,
Jul 6, 2015, 2:54:53 AM7/6/15
to omn...@googlegroups.com
this problem is solved the main thing after change the file you should delete the libraries file from binaries folder and then rebuilt the project the result will be change..
 

Handril Wulan

unread,
Apr 18, 2016, 3:16:42 AM4/18/16
to OMNeT++ Users
Hello Mr Michael. You Said, that "with MiXiM 2.3 (tested) it worked without problems."  what you means with work without problem, it is include with their template, examples. Because I have tried so many times, that feature not run, I desperate, I use it MiXim with Omnet 4.6 and windows 8 64 bit and ubuntu 12.4 on VM ware.

But fortunately I succeed try the Mixim project template (analogue and basic network) and also example folder with Mixim older version that is mixim 2.2.1, but still just succed on ubuntu, not windows.. how do you think, maybe I have some mistake???

thanks before.
Message has been deleted

INdyCinderella

unread,
Apr 24, 2016, 9:04:58 PM4/24/16
to OMNeT++ Users


بتاريخ الاثنين، 25 أبريل، 2016 2:52:29 ص UTC+2، كتب INdyCinderella:

 Farman Ali
 @

  Its first time I use omnet with MiXiM.  I searched for MiXim's examples I found that CSMAMac will benefit me om my project. you said that you edited on it. Please tell me, You 
 edited its code directly in the example code files or you took its code and attached it on a new omnet project under MiXiM example??! please reply as soon as possible   
.I Would deeply appreciated any other opinions.. or helping




?While I applied CSMAMac codes on a new omnet project , this error appeared to me!(attached picture) . What this mean

Farman Ali

unread,
Apr 26, 2016, 1:05:19 AM4/26/16
to omn...@googlegroups.com
when you change the source file (CSMA802154.cc) or any other file of Mixim in omnet++. you should delete all the .exe files of binaries folder (which form during debug all) and rebuilt the mixim again....the .exe file will again form....and your project will run according to your change in the code.....

--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/ig1XC8Ca898/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.

aya elshazly

unread,
May 4, 2016, 8:51:37 AM5/4/16
to omn...@googlegroups.com
Thanks for your response. I also use another example connected with tictoc16 that describe number of nodes can forward messages to others. Do you know how I can do to connect those nodes with server as sender and receiver their data in whether CSMA (MiXim ex.) or tictoc16??
I did source and header files with codes but did not work.

I hope you'll help me soon.
Thanks in advance.

aya elshazly

unread,
May 21, 2016, 6:28:12 PM5/21/16
to omn...@googlegroups.com
Hey @Farman Ali
When I applied your suggest and delete all the .exe files of binaries folder of CSMA ex. this problem appeaed.
Can you tell me how can I fix it please? 



2016-04-26 7:05 GMT+02:00 Farman Ali <alib...@gmail.com>:

Farman Ali

unread,
May 23, 2016, 4:40:15 AM5/23/16
to omn...@googlegroups.com
hi..
there is simpleNetLayer.cc and simpleNetLayer.hh files in the CSMA folder. I think you ma have change these file... so check these file. 

aya elshazly

unread,
Jun 1, 2016, 11:37:57 AM6/1/16
to omn...@googlegroups.com
Please if you don't mind, send me CSMA example after deleting all the .exe files of binaries folder. So that I can compare it with my files and try to know the error in my file
Reply all
Reply to author
Forward
0 new messages