2.6. Run the demo (mono-sandbox) on the simulator [EXS82 ONLY]

Warning

This version of the package doesn’t support simulation on PLS63 due to limitations with the serial communication to the device.

See Known issues.

Note

On the simulator, native calls are redirected to mocks. Some mocks are directly running on the PC.

In this project, MicroEJ chose to implement the platform-specific natives using a hardware mock. See Simulation for more details.

With this architecture, it is possible to have both an accurate simulation of the hardware behavior and get all the benefits from running the application directly on a PC (debug, fast run, …).

To run the mono-sandbox demo on the simulator:

  1. Run the hardware mock controller on the module:

    • Set up the module with the demo configuration: Demo Configuration

    • Upload the controller to the module:

      {Cinterion SDK}/tools> python app.py download -n controller {Package}/platform_mock-{version}/{target}/cinterion-{target}-controller-{version}.bin
      
    • Install the controller:

      {Cinterion SDK}/tools> python app.py install controller
      
    • Start the controller:

      {Cinterion SDK}/tools> python app.py start controller
      
    • The controller should start and wait for commands on the serial interface ASC0:

      DAM main
      MicroEJ START
      Initializing controller...
      Reading commands...
      
    • Connect the ASC0 interface to the PC and note the COM port. Do not disconnect the native USB interface: both are required.

  2. Run the application:

    • In Run > Run Configurations > MicroEJ Application, configure the launcher [EXS82] Mono Sim - Step 1) Run Demo Application:

      • Set the COM port to the serial ASC0 interface in Configuration > Simulator > Cinterion > Communication Settings > Comm Port.
      • Set the COM port to the modem interface in Configuration > Simulator > ECOM Mobile > Communication Settings > Serial Port.
    • In Run > Run Configurations > MicroEJ Application, run the launcher [EXS82] Mono Sim - Step 1) Run Demo Application. The application will connect to the controller, trigger a connection to the broker and monitor the temperature:

      =============== [ Initialization Stage ] ===============
      Using default Platform kernel.kf
      =============== [ Launching on Simulator ] ===============
      [demo-app][gnss-helper] Stopping the GNSS engine
      [demo-app][net-helper] Setting normal mode
      [demo-app][net-helper] Unlocking the SIM
      [demo-app][net-helper] Attaching the network (May take a while)
      [demo-app][net-helper] Trying again...
      [demo-app][net-helper] Trying again...
      [demo-app][net-helper] Trying again...
      [demo-app][net-helper] Trying again...
      [demo-app][net-helper] Configuring PDP context
      [demo-app][net-helper] Activating PDP session
      [demo-app][mqtt-client] Connecting to broker: mqtt://broker.hivemq.com:1883
      [demo-app][notification] [hello] Hello World! I am running on VirtualDevice
      [demo-app][temperature] Enabling the temperature monitoring
      [demo-app][temperature] Getting the temperature
      [demo-app][temperature] Temperature available: 24 C
      [demo-app][notification] [temperature] 24°C
      [demo-app][temperature] Getting the temperature
      [demo-app][temperature] Temperature available: 23 C
      [demo-app][notification] [temperature] 23°C
      [demo-app][temperature] Getting the temperature
      [demo-app][temperature] Temperature available: 23 C
      
    • The module will send notifications on temperature updates:

      ../../_images/demo-simulator-celsius.jpg

Note

In evaluation mode, after the first internet connection, the application will stop. It is a known issue of the VEE Port. If this happens, restart the controller.

{Cinterion SDK}/tools> python app.py stop controller
{Cinterion SDK}/tools> python app.py start controller