I'd like to set up a network simulation in IntelliJ IDEA. To do this I'm trying configure the IDE to use the 2-node-network.groovy script included in the package. I can run the simulation script and access the modems through the web interface but some shell commands such as 'tell', 'host' etcetera will not work.
The steps I've taken so far:
Configure an environment variable in the IDE to point to the Unetstack home directory (unet_home=.../unet-3.0.0/)
Made a new run configuration in the IDE with code copied from the 2-node-network.groovy script but changed the home variable:
import org.arl.fjage.RealTimePlatform
def unet_home = System.getenv("unet_home");
println(unet_home)
println '''
2-node network
--------------
Stack:
Node A: tcp://localhost:1101, http://localhost:8081/
Node B: tcp://localhost:1102, http://localhost:8082/
'''
platform = RealTimePlatform // use real-time mode
// run the simulation forever
simulate {
node 'A', location: [ 0.km, 0.km, -15.m], web: 8081, api: 1101, stack: "$unet_home/etc/setup"
node 'B', location: [ 1.km, 0.km, -15.m], web: 8082, api: 1102, stack: "$unet_home/etc/setup"
}
Web shell output:
> mac
<<< CSMA >>>
[org.arl.unet.mac.CSMAParam]
maxBackoff = 30.0
minBackoff = 0.5
phy = phy
reservationsPending = 0
[org.arl.unet.mac.MacParam]
ackPayloadSize = 0
channelBusy = false
maxReservationDuration = 600.0
recommendedReservationDuration = 15.0
reservationPayloadSize = 0
> tell host('A'), "Hello"
Unknown method: host(...)
> tell
Unknown command or property: tell
>