How to make loRaNode move using FLoRA and inet? - omnet++

I tried adding the following lines to the .ini file in order to test loRaNode mobility after installing both FloRA and inet. But it remains still during the simulation.
**.loRaNodes[0].mobility.typename = "ChiangMobility"
**.loRaNodes[0].mobility.stateTransitionUpdateInterval = 3s
**.loRaNodes[0].mobility.speed = 10mps

Related

Parameter unassigned error in OMNeT++ and INET examples on installation

I have installed OMNeT++ 5.6.2 and added the INET 4.2.1 framework.
I followed the setup instructions as per the doc given and compiled and did make.
On running ./aloha I seem to encounter parameter unassigned error as follows :
Setting up Cmdenv...
Loading NED files from .: 4
Preparing for running configuration General, run #0...
Assigned runID=General-0-20201227-14:11:08-9189
Setting up network "Aloha"...
<!> Error: The simulation wanted to ask a question, set cmdenv-interactive=true to allow it: "Enter parameter 'Aloha.host[0].iaTime' (unassigned):" -- in module (aloha::Host) Aloha.host[0] (id=3), during network setup
End.
Even on running a different example from INET, from examples, adhoc, seem to get a similar error as follows :
Preparing for running configuration General, run #0...
Assigned runID=General-0-20201223-00:37:38-95889
Setting up network "Net80211"...
<!> Error: The simulation wanted to ask a question, set cmdenv-interactive=true to allow it: "Enter parameter 'Net80211.numHosts' (unassigned):" -- in module (omnetpp::cModule) Net80211 (id=1), during network setup
End.
Simulation terminated with exit code: 1
I did set cmdenv-intercative=true in the config file and yet the error does not go away.
Please do let me know if you need any additional information. Any help, direction or pointer to some resources would be greatly appreciated and will be really really helpful.
You need to set "cmdenv-intercative=true" for the [General] section.

How to queue patches in Yocto

Background
I have a microcontroller board which has STM32MP157 chip on it, with a development board. The manufacturer provides a Yocto BSP layer for this device and the development board and it is found on an open Github repository.
The important thing to note is that the BSP layer applies important devicetree patches to the stable release of the Linux kernel.
What I want
I would like to modify parts of the devicetree that is provided by the manufacturer's BSP layer, basically add to it.
What I have done
I have created a layer, named meta-mx-dts, put it after the manufacturer supplied layer in the build/conf/bblayers.conf file, and made it with higher priority by setting BBFILE_PRIORITY_meta-mx-dts in meta-mx-dts/conf/layer.conf (so that it applies after the manufacturer supplied layer). Finally, I made a file linux-stable_5.4.bbappend as follows:
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
SRC_URI_append = "file://dts.patch"
and placed the dts.patch file properly.
The error I get
The error stack can be summarized by this line (from the error stack):
error: arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dts: does not exist in index
Where stm32mp157c-dhcom-pdk2.dts is the devicetree file to be created by the patches in the manufacturer's BSP layer. My patch applies to that file specifically.
What I have tried so far
I have tried different ways to append/prepend the dts.patch to the SRC_URI variable, until I got it appear after the patches directory applied by the BSP layer, by checking in the following ways in the treminal:
bitbake -e linux-stable | grep SRC_URI
bitbake -e virtual/kernel | grep SRC_URI
However, that didn't solve the issue. I also tried to make the SRC_URI append operation to be specific to the machine:
SRC_URI_append_dh-stm32mp1-dhcom-pdk2 = "file://dts.patch"
That didn't help either.
UPDATE
I have also tried to append to KERNEL_FEATURES variable and use .scc file, where I specify patches, as follows:
# The .bbappend file
KERNEL_FEATURES_append = " mx.scc "
SRC_URI_append = " file://mx.scc;type=kmeta "
with the file mx.scc being like:
define KMACHINE dh-stm32mp1-dhcom-pdk2
define KTYPE standard
define KARCH arm
branch dh-stm32mp1-dhcom-pdk2
patch dts.patch
With no effect.
Need your help
Thanks

failed to add service - already in use error

I compiled SFML library and my app on Raspbian with this tutorial https://github.com/oomek/sfml-pi. After this I moved shared objects and app to buildroot system for Raspberry Pi 4. I chosed DISPMANX version, my goal was to run app without X server.
When I try to run app, I have error failed to add service - already in use?. I know that there was many similar topics, I tried this solutions:
Comment dtoverlay=vc4-kms-v3d in config.txt -> this line didn't existed in my config.
Change gpu_mem to 128 -> any improvement
My config.txt:
# Please note that this is only a sample, we recommend you to change it to fit
# your needs.
# You should override this file using a post-build script.
# See http://buildroot.org/manual.html#rootfs-custom
# and http://elinux.org/RPiconfig for a description of config.txt syntax
# We always use the same names, the real used variant is selected by
# BR2_PACKAGE_RPI_FIRMWARE_{DEFAULT,X,CD} choice
start_file=start.elf
fixup_file=fixup.dat
kernel=zImage
# To use an external initramfs file
#initramfs rootfs.cpio.gz
# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1
# How much memory in MB to assign to the GPU on Pi models having
# 256, 512 or 1024 MB total memory
gpu_mem_256=128
gpu_mem_512=128
gpu_mem_1024=128
gpu_mem_1024=192
gpu_mem=128
# fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
dtoverlay=miniuart-bt
On buildroot I set opengl from gst1-plugins-base with dispmanx, gles2, egl and wayland. I didn't set mesa-3d.
Any idea how can I make my app working? Should I add something to my config.txt?

Replace Source Files When Compiling CentOS Kernel with RPM

I am trying to modify one of the CentOS (7.6) kernel source file and recompile all of them for later installation.
I followed the guide on wiki.centos to do customized kernel:
https://wiki.centos.org/HowTos/Custom_Kernel
I found that in step 5, the RPM method always unpacked source files from tar files and replaced my modification in BUILD/.
Therefore, I changed my way. I put my modification at another place and added a line in kernel.spec file under SPECS/ to copy my file into the BUILD/. Namely, one-line with cp command is put before %build in the kernel.spec (after unpacked). However, the compilation went wrong in the %build section:
...
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Vd6by5
BUILDING A KERNEL FOR x86_64...
USING ARCH=x86_64
...
###
### Now generating an X.509 key pair to be used for signing modules.
###
### If this takes a long time, you might wish to run rngd in the
### background to keep the supply of entropy topped up. It
### needs to be run as root, and uses a hardware random
### number generator if one is available.
###
Generating a 3072 bit RSA private key
....++
......................................................................................................................................................................................++
writing new private key to 'signing_key.priv'
-----
###
### Key pair generated.
###
- Including cert /home/user/rpmbuild/BUILD/kernel-3.10.0-957.12.2.el7/linux-3.10.0-957.12.2.el7.v2.x86_64/centos-kpatch.x509
- Including cert /home/user/rpmbuild/BUILD/kernel-3.10.0-957.12.2.el7/linux-3.10.0-957.12.2.el7.v2.x86_64/centos-ldup.x509
- Including cert signing_key.x509
RPM build errors:
Could somebody suggest me a better way to replace the source file in the compilation procedure?
Thanks.
I found the solution myself. Instead of directly replacing files, we should apply patch within RPM to indicate the differences between modified file and original file.
Firstly, use diff command to build patch. Then, modify spec file, kernel.spec, applying the patch to the building procedure.
This website shows the example when using this way to compile kernel:
https://www.hiroom2.com/2016/05/29/centos-7-rebuild-kernel-with-src-rpm/
A more clear reference for patching files:
https://rpm-packaging-guide.github.io/#patching-software

Why does Veins crash when commandSetSpeedMode() is used?

I am trying to simulate a scenario in Veins where I want to disable the
right of way checks at the road junctions. I looked up at the Sumo wiki and
found that the bitset is 23 for the purpose. Another lookup in the
TraCIMobility.h header bundled with Veins helped me to know that this can
be done using the function commandSetSpeedMode() for a TraCIDemo11p node
which models the vehicles in the Veins demo simulation. I am trying to
build up my model using this demo bundled with Veins.
But as I am trying to do so, SUMO crashes. I am trying to initialize the
nodes in the initialize() function of TraCIDemo11p through the following
code:
void TraCIDemo11p::initialize(int stage) {
BaseWaveApplLayer::initialize(stage);
if (stage == 0) {
traci = TraCIMobilityAccess().get(getParentModule());
annotations = AnnotationManagerAccess().getIfExists();
ASSERT(annotations);
traci->commandSetSpeedMode(23); // This is the point of modification
sentMessage = false;
lastDroveAt = simTime();
findHost()->subscribe(parkingStateChangedSignal, this);
isParking = false;
sendWhileParking = par("sendWhileParking").boolValue();
}
}
I tried to set the modes with other standard values such as 0 or 31, but
every time I get SUMO crashed.
I am unable to figure out where else I should place this command. I tried
to set the mode in some other initialization stage by adding an else clause
to it but it crashes still. What's more, eve nthe the debugger on, no error
is being shown, either in the OMNeT++ window or the sumolaunchd.py output
in OMNeT++ cmd.
Please help to understand my error. Thanks.
EDIT: adding Error message info
To make things clear, I am not receiving any error message but the exit code. I searched for the code but got no help. The usual 'this app is not responding' window pops up and the sim ends, so I suspect SUMO to crash.
The OMNeT++ environment shows the following message:
Simulation terminated with exit code: -1073741819
Working directory: C:/Users/stes-2/veins-3.0/examples/Cross Roads
Command line: c:/Users/stes-2/omnetpp-4.4/bin/opp_run.exe -r 0 -n ../veins;../../src --tkenv-image-path=../../images -l ../../src/veins omnetpp.ini
Environment variables:
OMNETPP_ROOT=c:/Users/stes-2/omnetpp-4.4
PATH=;C:/Users/stes-2/veins-3.0/src;c:\Users\stes-2\omnetpp-4.4\bin;c:\Users\stes-2\omnetpp-4.4\msys\bin;c:\Users\stes-2\omnetpp-4.4\mingw\bin;c:/Users/stes-2/omnetpp-4.4/ide/jre/bin/client;c:/Users/stes-2/omnetpp-4.4/ide/jre/bin;c:/Users/stes-2/omnetpp-4.4/ide/jre/lib/i386;.;C:\Users\stes-2\omnetpp-4.4\msys\local\bin;c:\Users\stes-2\omnetpp-4.4\mingw\bin;C:\Users\stes-2\omnetpp-4.4\msys\bin;c:\Users\stes-2\omnetpp-4.4\bin;c:\ProgramData\Oracle\Java\javapath;c:\Windows\system32;c:\Windows;c:\Windows\System32\Wbem;c:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Python27;c:\Users\stes-2\sumo-0.21.0;c:\Users\stes-2\omnetpp-4.4;
OMNETPP_IMAGE_PATH=c:\Users\stes-2\omnetpp-4.4\images
Since I am running SUMO through the sumoLaunchd.py script, the error message that turns up at the MingW cmd of OMNeT++ is:
Starting SUMO (c:/Users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.cfg) o
n port 64161, seed 0
Connecting to SUMO (c:/Users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.c
fg) on port 64161 (try 1)
Releasing lock on port
Starting proxy mode
Done with proxy mode
Done with proxy mode, killing SUMO
SIGTERM
Done running SUMO
Cleaning up
Result: "<?xml version="1.0"?>
<status>
<exit-code>15</exit-code>
<start>1433944271</start>
<end>1433944276</end>
<status>Exited with error code 15</status>
<stdout><![CDATA[Loading configuration... done.
]]></stdout>
<stderr><![CDATA[]]></stderr>
</status>
"
Closing connection from 127.0.0.1 on port 64160
I think you are missing some lines.
You have assigned the TraCIMobility to traci, and then you don't even consider the general commandInterface and the vehicleCommandInterface
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
TraCICommandInterface* traci = mobility->getCommandInterface(); /* missing command interface */
TraCICommandInterface::Vehicle* traciVehicle = mobility->getVehicleCommandInterface(); /* missing vehicle command interface */
traciVehicle->setSpeedMode(someNumber);
I even tried to compile your code but it complains that there is no method available for TraCIMobility called commandSetSpeedMode(). But that could be due to difference in Veins versions.
Multi-stage initialization
A module/variable you are trying to access might not be ready, i.e. still has not been created, by the time you are trying to use it. In that case the multi-stage initialization feature of OMNeT++ can be used.
This means a "task" may be delayed to a later stage of the initialization of the current module:
void SomeModule::initialize(int stage)
{
ApplicationBase::initialize(stage); /* ignore if causes error */
if(stage == 0)
{
/* do this */
else if (stage == 3)
{
/* do this later */
}
}

Resources