I am trying to run the C API for Unetstack. I have been trying to run the test code here.
I am running 3-node-network.groovy from the unetsim-1.4 sample code in my terminal to use as my modem network. I am using unetsim-1.4a for linux for my simulator.
This is how I call the test code:
make IP="127.0.0.1" ADDR=1 test
The test code is able to open the modem, but is not able to send packets through. This is the error I end up getting:
Packet transmission: FAILED
Packet transmission: FAILED
Segmentation fault (core dumped)
and I do not see any received packets on my simulator shell.
When I run the 3-node-network.groovy simulation with the Python API, everything works fine, and I can see packets being received on my simulator shell.
How should I set up the environment to run the Unetstack C API test code to transmit and receive through a simulated modem network on unetsim?
Follow the steps below to set up the environment to test basic modem operations using UnetStack C API with simulated modem network on
unetsim
:Run
3-node-network.groovy
from unetsim-1.4 sample code which creates a simulation environment with 3 nodes deployed as shown below for example:bin/unet samples/rt/3-node-network.groovy
Change the port number from
1100
to1101
at this line in the code in yourunet-contrib
local repository.Set the destination address to
2
at this line.Set the carrier frequency to
25000 Hz
at this line.Navigate to this folder in your
unet-contrib
local repository and perform the following steps:make c c/examples localhost
You should be able to see successful transmissions from
node 1
and corresponding receptions onnode 2
.