2.5. Run the demo (multi-sandbox) from sources

To run the multi-sandbox demo from sources, in the workspace:

  1. Build the kernel:

    • In Run > Run Configurations > MicroEJ Application, run the launcher matching your module:

      • for the EXS82, [EXS82] Multi Emb - Step 1) Build Demo Kernel
      • for the PLS63, [PLS63] Multi Emb - Step 1) Build Demo Kernel
      =============== [ Initialization Stage ] ===============
      Platform connected to BSP location '{Platform sources directory}/cinterion-threadx-bsp' using platform option 'root.dir' in 'bsp/bsp.properties'.
      [INFO ] Launching in Evaluation mode. Your UID is {Architecture UID}.
      =============== [ Launching SOAR (multi) ] ===============
      =============== [ Launching Link ] ===============
      =============== [ Deployment ] ===============
      MicroEJ files for the 3rd-party BSP project are generated to '{Kernel sources directory}\cinterion-demo-kernel\com.cinterion.vee.demo.kernel.DemoKernel\platform'.
      The MicroEJ application (microejapp.o) has been deployed to: '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\platform\lib'.
      The MicroEJ platform library files have been deployed to: '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\platform\lib'.
      The MicroEJ platform header files (*.h) have been deployed to: '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\platform\inc'.
      Execution of script '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\scripts\exs_tx\build.bat' started...
      
      [...]
      
      Linking  application
              1 file(s) copied.
      Execution of script '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\scripts\exs_tx\build.bat' done.
      =============== [ Completed Successfully ] ===============
      
      SUCCESS
      
  2. Run the kernel:

    • In Run > Run Configurations > MicroEJ Tool, run the launcher [ALL] Multi Emb - Step 2) Deploy Demo Kernel

      Platform connected to BSP location '{Platform sources}/cinterion-threadx-bsp' using platform option 'root.dir' in 'bsp/bsp.properties'.
      Execution of script {Platform sources}\cinterion-threadx-bsp\projects\cinterion\scripts\exs_tx\run.bat' with executable file '{Kernel sources}\cinterion-demo-kernel\com.cinterion.vee.demo.kernel.DemoKernel\application.out' started...
      Load "{Platform sources}\cinterion-threadx-bsp\projects\cinterion\scripts\\set_local_env.bat"
      CINTERION_SDK={Cinterion SDK}
      PYTHON27_PATH=C:\Python27\python.exe
      CINTERION_APPNAME=cinterion
      CINTERION_MODEM_PORT={COM PORT}
      CINTERION_MODEM_BAUDRATE=115200
      Checking application size
      Application footprint is 517kB (100%)
      Building application binary
      Input File: {Kernel sources}\cinterion-demo-kernel\com.cinterion.vee.demo.kernel.DemoKernel\application.out [32-bit size: 1761760 (0x1ae1e0)]
      Output Binary Format: bin\cinterion.bin Bit Width: 8, Bank: 1
      Uploading and starting the application
      Sent 0.0 %
      Sent 0.6 %Sent 1.3 %Sent 1.9 %Sent 2.5 %Sent 3.2 %Sent 3.8 %Sent 4.4 %Sent 5.1 %Sent 5.7 %Sent 6.4 %Sent 7.0 %Sent 7.6 %Sent 8.3 %Sent 8.9 %Sent 9.5 %Sent 10.2 %Sent 10.8 %Sent 11.4 %Sent 12.1 %Sent 12.7 %Sent 13.3 %Sent 14.0 %Sent 14.6 %Sent 15.2 %Sent 15.9 %Sent 16.5 %Sent 17.1 %Sent 17.8 %Sent 18.4 %Sent 19.1 %Sent 19.7 %Sent 20.3 %Sent 21.0 %Sent 21.6 %Sent 22.2 %Sent 22.9 %Sent 23.5 %Sent 24.1 %Sent 24.8 %Sent 25.4 %Sent 26.0 %Sent 26.7 %Sent 27.3 %Sent 27.9 %Sent 28.6 %Sent 29.2 %Sent 29.8 %Sent 30.5 %Sent 31.1 %Sent 31.8 %Sent 32.4 %Sent 33.0 %Sent 33.7 %Sent 34.3 %Sent 34.9 %Sent 35.6 %Sent 36.2 %Sent 36.8 %Sent 37.5 %Sent 38.1 %Sent 38.7 %Sent 39.4 %Sent 40.0 %Sent 40.6 %Sent 41.3 %Sent 41.9 %Sent 42.6 %Sent 43.2 %Sent 43.8 %Sent 44.5 %Sent 45.1 %Sent 45.7 %Sent 46.4 %Sent 47.0 %Sent 47.6 %Sent 48.3 %Sent 48.9 %Sent 49.5 %Sent 50.2 %Sent 50.8 %Sent 51.4 %Sent 52.1 %Sent 52.7 %Sent 53.3 %Sent 54.0 %Sent 54.6 %Sent 55.3 %Sent 55.9 %Sent 56.5 %Sent 57.2 %Sent 57.8 %Sent 58.4 %Sent 59.1 %Sent 59.7 %Sent 60.3 %Sent 61.0 %Sent 61.6 %Sent 62.2 %Sent 62.9 %Sent 63.5 %Sent 64.1 %Sent 64.8 %Sent 65.4 %Sent 66.0 %Sent 66.7 %Sent 67.3 %Sent 68.0 %Sent 68.6 %Sent 69.2 %Sent 69.9 %Sent 70.5 %Sent 71.1 %Sent 71.8 %Sent 72.4 %Sent 73.0 %Sent 73.7 %Sent 74.3 %Sent 74.9 %Sent 75.6 %Sent 76.2 %Sent 76.8 %Sent 77.5 %Sent 78.1 %Sent 78.8 %Sent 79.4 %Sent 80.0 %Sent 80.7 %Sent 81.3 %Sent 81.9 %Sent 82.6 %Sent 83.2 %Sent 83.8 %Sent 84.5 %Sent 85.1 %Sent 85.7 %Sent 86.4 %Sent 87.0 %Sent 87.6 %Sent 88.3 %Sent 88.9 %Sent 89.5 %Sent 90.2 %Sent 90.8 %Sent 91.5 %Sent 92.1 %Sent 92.7 %Sent 93.4 %Sent 94.0 %Sent 94.6 %Sent 95.3 %Sent 95.9 %Sent 96.5 %Sent 97.2 %Sent 97.8 %Sent 98.4 %Sent 99.1 %Sent 99.7 %Sent 100 %    Done !
      Execution of script '{Platform sources}\cinterion-threadx-bsp\projects\cinterion\scripts\exs_tx\run.bat' done.
      
      SUCCESS
      
    • The kernel will start and wait for an application:

      DAM main
      MicroEJ START
      [kernel] Waiting for application file /app.fo
      
  3. Build the application:

    • In Run > Run Configurations > MicroEJ Application, run the launcher matching your module:

      • for the EXS82, [EXS82] Multi Emb - Step 3) Build Demo Application V1
      • for the PLS63, [PLS63] Multi Emb - Step 3) Build Demo Application V1
      =============== [ Initialization Stage ] ===============
      =============== [ Launching SOAR ] ===============
      =============== [ Completed Successfully ] ===============
      
      SUCCESS
      
  4. Run the application:

    • In Run > Run Configurations > MicroEJ Tool, configure the launcher [ALL] Multi Emb - Step 4) Deploy Demo Application V1:

      • Set the path to the SDK.
      • Set the serial port.
    • In Run > Run Configurations > MicroEJ Tool, run the launcher [ALL] Multi Emb - Step 4) Deploy Demo Application V1

      ============== [ UPLOAD ] ==============
      Sent 0.0 %
      Sent 8.9 %Sent 17.8 %Sent 26.6 %Sent 35.5 %Sent 44.4 %Sent 53.3 %Sent 62.2 %Sent 71.1 %Sent 79.9 %Sent 88.8 %Sent 97.7 %Sent 100 %
      
      SUCCESS
      
    • The application will be automatically installed, connect to the broker and monitor the temperature:

      DAM main
      MicroEJ START
      [kernel] Waiting for application file /app.fo
      [kernel] Installing /app.fo
      [kernel] Installed cinteriondemo
      [kernel] Started cinteriondemo
      [kernel] Waiting for patch file /app.patch
      [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] 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 EXS82
      [demo-app][temperature] Enabling the temperature monitoring
      [demo-app][temperature] Getting the temperature
      [demo-app][temperature] Temperature available
      [demo-app][notification] [temperature] 26°C
      
    • Each time an MQTT message is sent, the STATUS LED of the LGA DevKit blinks.

    • (optional) When button on GPIO6 is pushed, the application sends an MQTT message to the broker.

    Note

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

    {Cinterion SDK}/tools> python app.py stop cinterion-app
    {Cinterion SDK}/tools> python app.py start cinterion-app
    
    • The module will send notifications on temperature updates in °C:

      ../../_images/demo-embedded-celsius1.jpg
  5. Update the application:

    • In cinterion-demo-application/src/main/java/com/cinterion/vee/demo/app/agent/TemperatureMonitor.java, set USE_FAHRENHEIT to true (line 21).

    • In Run > Run Configurations > MicroEJ Application, run the launcher matching your module:

      • for the EXS82, [EXS82] Multi Emb - Step 5) Build Demo Application V2
      • for the PLS63, [PLS63] Multi Emb - Step 5) Build Demo Application V2
      =============== [ Initialization Stage ] ===============
      =============== [ Launching SOAR ] ===============
      =============== [ Completed Successfully ] ===============
      
      SUCCESS
      
    • In Run > External Tools > External Tools Configurations > Program, run the External Tools launcher [ALL] Multi Emb - Step 6) Build Demo Patch (V1 to V2)

    • In Run > Run Configurations > MicroEJ Tool, configure the launcher [ALL] Multi Emb - Step 7) Deploy Demo Application Patch:

      • Set the path to the SDK.
      • Set the serial port.
    • In Run > Run Configurations > MicroEJ Tool, run the launcher [ALL] Multi Emb - Step 7) Deploy Demo Application Patch

      ============== [ UPLOAD ] ==============
      Sent 0.0 %
      Sent 75.9 %Sent 100 %
      
      SUCCESS
      
    • The application will be automatically updated, reconnect to the broker and monitor the temperature again:

      [kernel] Applying patch file /app.patch
      [kernel] Stopping feature cinteriondemo
      [kernel] Uninstalling feature cinteriondemo
      [kernel] Installing /app.fo
      [kernel] Installed cinteriondemo
      [kernel] Started cinteriondemo
      [kernel] Waiting for patch file /app.patch
      [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] 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 EXS82
      [demo-app][temperature] Enabling the temperature monitoring
      [demo-app][temperature] Getting the temperature
      [demo-app][temperature] Temperature available: 29 C
      [demo-app][notification] [temperature] 29°C
      
    • The module will send notifications on temperature updates in °F:

      ../../_images/demo-embedded-fahrenheit.jpg