2
votes

In my omnetpp.ini file, I have these lines describing cmdenv:

[General]
cmdenv-express-mode = false
cmdenv-output-file = log.txt
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s

So my outputs are redirected to a log file. To run my simulation I access to run -> run configurations -> user interface command line

Now, I need to run the omnetpp.ini file using a server so I need to run the .ini file in command line and not using the previous steps mentioned. I followed these two solutions that I found in the mailing list but they do not work:

1) ./run -u Cmdenv -f omnetpp.ini

2) opp_run -u Cmdenv -f omnetpp.ini

This is what display:

HP-ProBook-650-G2:~/WorkspaceThese/Veins-4a2/examples/veins$ opp_run -u     Cmdenv -f omnetpp.ini 
OMNeT++ Discrete Event Simulation  (C) 1992-2014 Andras Varga, OpenSim     Ltd.
Version: 4.6, build: 141202-f785492, edition: Academic Public License --     NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Cmdenv...
Cmdenv: redirecting output to file `/home/yosra/WorkspaceThese/Veins-        4a2/examples/veins/log.txt'...

End.

Can someone help me to fix this issue please?

1
I do not understand your problem, can you edit your question again? - Julian Heinovski
I need to run the omnetpp.ini file using the linux terminal and not the interface of Omnet++. I tried the two commands but they don't work. - Joe
What do you mean by "they do not work"? What does the error message display? Did you compile the code beforehand? Usually you also need to specify a config which should be executed '-c <config>'. - Julian Heinovski
The returned message is: HP-ProBook-650-G2:~/WorkspaceThese/Veins-4a2/examples/veins$ opp_run -u Cmdenv -f omnetpp.ini OMNeT++ Discrete Event Simulation (C) 1992-2014 Andras Varga, OpenSim Ltd. Version: 4.6, build: 141202-f785492, edition: Academic Public License -- NOT FOR COMMERCIAL USE See the license for distribution terms and warranty disclaimer Setting up Cmdenv... Cmdenv: redirecting output to file `/home/yosra/WorkspaceThese/Veins-4a2/examples/veins/log.txt'... End. Can you pleasse tell me the full command that I should type in the terminal? - Joe
Can you update your question and put this message and the content of the log file which is mentioned there as well? - Julian Heinovski

1 Answers

3
votes

If you are able to run your simulation in Cmdenv mode from Eclipse, you may see what Eclipse uses to run the simulation. To do it add the Console ( Window | Show View | Other | Console) and start your simulation in Cmdenv mode. In the console you will see something like this:

Starting...

$ cd /opt/omnetpp/omnetpp-4.6/samples/tictoc/simulations
$ ../src/tictoc -r 0 -u Cmdenv -c General -n ../src;. omnetpp.ini

OMNeT++ Discrete Event Simulation  (C) 1992-2014 Andras Varga, OpenSim Ltd.
...

Here are the commands you are looking for.