2.5. Run the demo (multi-sandbox) from sources [PLS63 ONLY]

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:

      • [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\pls\build.bat' started...
      
      [...]
      
      Linking  application
              1 file(s) copied.
      Execution of script '{Platform sources directory}\cinterion-threadx-bsp\projects\cinterion\scripts\pls\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\pls\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-app
      CINTERION_MODEM_PORT={COM PORT}
      CINTERION_MODEM_BAUDRATE=115200
      Checking application size
      Application footprint is 3926kB (23%)
      Building application binary
      Input File: {Kernel sources}\cinterion-demo-kernel\com.cinterion.vee.demo.kernel.DemoKernel\application.out [32-bit size: 3583232 (0x36ad00)]]
      Output Binary Format: bin\cinterion.bin Bit Width: 8, Bank: 1
      Uploading and starting the application
      Sent 0.0 %
      Sent [...] %Sent 100 %    Done !
      Execution of script '{Platform sources}\cinterion-threadx-bsp\projects\cinterion\scripts\pls\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:

      • [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 [...] %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 PLS63
      [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:

      • [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 [...] 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 PLS63
      [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