X

Sign up for MicroEJ Studio

A few clicks left before entering the MicroEJ world.

 
Salutation: *
First Name: *
Last Name: *
Country: *
Email Address: *
Company:
  I agree to hear from MicroEJ about the latest trends and news
 
 





Getting Started on ESP32-WROVER-KIT

Setup your MICROEJ Studio and your Espressif ESP32-WROVER-KIT.

In this page we will install the MicroEJ development environment: MICROEJ Studio to evaluate how to develop Multi Sandboxed Applications. The MICROEJ Black Firmware is geared toward evaluating WiFi and Bluetooth.

  • Download and install the MICROEJ Studio.
  • Download and install the Virtual Device.
  • Download and import the examples.
  • Run the examples on the Virtual Device and the ESP32-WROVER-KIT board.



  • Supported Operating System:

    • Windows 10, Windows 8.1, Windows 8, Windows 7
    • macOS 10.14

    Java™ Runtime Environment

    A JRE 8 is needed on your host computer for running MICROEJ Studio. Download a Java™ Runtime Environment from here.

    Download MICROEJ Studio

    Download the installer package corresponding to your host computer OS from the download link.

    Install MICROEJ Studio

    • Run the unzipped executable file.
    • On Windows, accept the administrator privileges elevation.
    • Follow the installer steps.
    • Proceed to the next step.

    MicroEJ Studio
     

    (Other platforms)

    • Start MICROEJ Studio.
    • Select the workspace where to put your applications. If you are not familiar with Eclipse workspaces, select the default one and press Launch.
    • Select the repository where to put your Virtual Device. If you are not familiar with MicroEJ repositories, select the default one and press OK.
    • Select the Window > Preferences > MicroEJ > Virtual Device menu.
    • Download the Virtual Device here.
    • Press the Import... button and select the Virtual Device file previously downloaded (all virtual devices have the .vde extension).
    • Accept the license terms and press Finish. The MicroEJ Virtual Device is successfully installed.

    • Download your first application examples here.
    • Inside MICROEJ Studio.
    • Select File > Import... > General > Existing Projects into Workspace > Select archive file and select the downloaded archive.
    • Import everything to your workspace.
    • Your first applications are loaded, ready to execute:
      • com.microej.example.bluetooth.hello.
      • com.microej.demo.hello.
      • com.microej.example.iot.ssl.rest.headless.
  • Running the UI Example

    • Right-click the MicroEJ project com.microej.demo.hello.
    • Then Run As > MicroEJ Application.
    • Select the VDE-BLACK-ESP32WROVER-RQQAW Virtual Device.
    • It should launch the simulation displaying the Front Panel (simulated device on PC).
    • The demo is displaying a simple UI on the Front Panel.

    Running the REST Client Example

    • Right-click the MicroEJ project com.microej.example.iot.ssl.rest.headless.
    • Then Run As > MicroEJ Application.
    • Select the VDE-BLACK-ESP32WROVER-RQQAW Virtual Device.
    • It should launch the simulation displaying the Front Panel (simulated device on PC).
    • In the Eclipse Console you should have a similar trace printed:

    =============== [ Initialization Stage ] ===============
    =============== [ Converting fonts ] ===============
    =============== [ Converting images ] ===============
    =============== [ Launching on Simulator ] ===============
    https example INFO: {"headers":{"user-agent":"Resty/0.1 (Java)","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","x-forwarded-port":"443"},"args":{},"url":"https://postman-echo.com/get"}
    https example INFO: user-agent: Resty/0.1 (Java)
    host: postman-echo.com
    https example INFO: =========== POST REQUEST ===========
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","content-length":"20","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","content-type":"text/plain; charset=UTF-8","x-forwarded-port":"443"},"files":{},"json":null,"data":"My POST request data","args":{},"url":"https://postman-echo.com/post"}
    https example INFO: Data sent for POST request: My POST request data
    https example INFO: =========== PUT REQUEST ===========
    AbstractPage.renderContent()
    AbstractPage.renderContent()
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","content-length":"19","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","content-type":"text/plain; charset=UTF-8","x-forwarded-port":"443"},"files":{},"json":null,"data":"My PUT request data","args":{},"url":"https://postman-echo.com/put"}
    https example INFO: Data sent for PUT request: My PUT request data
    https example INFO: =========== DELETE REQUEST ===========
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","x-forwarded-port":"443"},"files":{},"json":null,"data":{},"args":{},"url":"https://postman-echo.com/delete"}
    • It confirms HTTPS communication between the Virtual Device and the postman-echo.com server.
  • Hardware Configuration

    • All tests of this getting started have been done on the ESP32 WROVER kit v4.1.
    • Remove the resistor R167 to allow the display to work with the SD Card support. (The resistor removal will permanently remove the SD Card detect function.)
    • Plug the microSD card in the ESP32-WROVER-KIT development board.
    • Standard output traces can be read through a UART link when connecting the JP5 USB connector to your computer. Configuration of the UART is:

    115200 bps, 8N1, no handshake


    Flashing the MicroEJ BLACK Firmware

    • Plug the board (J5 connector) with a USB cable to the PC, make sure that the JP7 jumper is set to USB_5V.
    • The esptool python script from the ESP-IDF is needed.
    • You can download the ESP-IDF 3.1.1 from GitHub and you can unzip it in a directory of your choice.
    • From the root folder of the ESP-IDF the tool is located in /components/esptool_py/esptool/esptool.py
    • You may need to install Python dependencies using pip for the tool to work:

    python -m pip install serial pyserial
    • Download all the .bin files from this page.
    • Here is the command to flash the ESP32-WROVER assuming you are executing it in the binaries folder (replace <COM_PORT> by the com port of your board, i.e. COM21):

    python.exe esptool.py --chip esp32 --port COM21 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader_1.0.1.bin 0x8000 partitions_microej_multiapp_1.0.1.bin 0x10000 BLACK-ESP32WROVER-RQQAW-1.0.1.bin

    Configuring the WiFi Connection

    • Start the ESP32-WROVER with the MicroEJ BLACK Firmware once. It will create a file template for WiFi configuration on the microSD card.
    • Power off the ESP32-WROVER board and unplug the microSD card.
    • Connect the microSD card to a computer.
    • Edit the file /usr/storage/features/EspressifLauncher/wifi.properties.list, and fill the file with te information of your WiFi Access Point (no need for you to add the security settings).
    • Put back the microSD card in the ESP32-WROVER board and power it.
    • The ESP32-WROVER board should connect to the WiFi Access Point, the screen will display the IP of the ESP32-WROVER when connected.

    Running the Bluetooth Example

    • Right-click the MicroEJ project com.microej.example.bluetooth.hello.
    • Then Run As > MicroEJ Application.
    • Select the VDE-BLACK-ESP32WROVER-RQQAW Virtual Device.
    • It will instanciate a Run Configuration, you can stop the Virtual Device.
    • Edit the new Run Configuration.
    • In the Execution tab select the VDE-BLACK-ESP32WROVER-RQQAW in Platform.
    • Then configure the Execution mode to Execute on Device, Core Engine Default and Settings Local Deployment (Socket)
    • In the Configuration tab in Local Deployment (Socket) insert the IP of the ESP32-WROVER in the Host parameter. You should have the IP displayed on the screen of the ESP32-WROVER (leave the other parameters unchanged).
    • Click on Run button.
    • This will deploy an agent that will periodically send a message to devices connecting to the board through Bluetooth.
    • To view the message you can use the Bluetooth Companion, an Android application that allows the connection to the ESP32-WROVER and display of such message.
    • Download the .apk file here.
    • Consult the documentation for installing APK files for your phone.

    Running the UI Example

    • Right-click the MicroEJ project com.microej.demo.hello.
    • Then Run As > MicroEJ Application.
    • Select the VDE-BLACK-ESP32WROVER-RQQAW Virtual Device.
    • It will instanciate a Run Configuration, you can stop the Virtual Device.
    • Edit the new Run Configuration.
    • In the Execution tab select the VDE-BLACK-ESP32WROVER-RQQAW in Platform.
    • Then configure the Execution mode to Execute on Device, Core Engine Default and Settings Local Deployment (Socket)
    • In the Configuration tab in Local Deployment (Socket) insert the IP of the ESP32-WROVER in the Host parameter. You should have the IP displayed on the screen of the ESP32-WROVER (leave the other parameters unchanged).
    • Click on Run button.
    • The demo is displaying a simple UI on display of the ESP32-WROVER.

    Running the REST Client Example

    • Right-click the MicroEJ project com.microej.example.iot.ssl.rest.headless.
    • Then Run As > MicroEJ Application.
    • Select the VDE-BLACK-ESP32WROVER-RQQAW Virtual Device.
    • It will instanciate a Run Configuration, you can stop the Virtual Device.
    • Edit the new Run Configuration.
    • In the Execution tab select the VDE-BLACK-ESP32WROVER-RQQAW in Platform.
    • Then configure the Execution mode to Execute on Device, Core Engine Default and Settings Local Deployment (Socket)
    • In the Configuration tab in Local Deployment (Socket) insert the IP of the ESP32-WROVER in the Host parameter. You should have the IP displayed on the screen of the ESP32-WROVER (leave the other parameters unchanged).
    • Click on Run button.
    • In the board's UART link you should have a similar trace printed:

    =============== [ Initialization Stage ] ===============
    =============== [ Converting fonts ] ===============
    =============== [ Converting images ] ===============
    =============== [ Launching on Simulator ] ===============
    https example INFO: {"headers":{"user-agent":"Resty/0.1 (Java)","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","x-forwarded-port":"443"},"args":{},"url":"https://postman-echo.com/get"}
    https example INFO: user-agent: Resty/0.1
    https example INFO: =========== POST REQUEST ===========
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","content-length":"20","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","content-type":"text/plain; charset=UTF-8","x-forwarded-port":"443"},"files":{},"json":null,"data":"My POST request data","args":{},"url":"https://postman-echo.com/post"}
    https example INFO: Data sent for POST request: My POST request data
    https example INFO: =========== PUT REQUEST ===========
    AbstractPage.renderContent()
    AbstractPage.renderContent()
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","content-length":"19","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","content-type":"text/plain; charset=UTF-8","x-forwarded-port":"443"},"files":{},"json":null,"data":"My PUT request data","args":{},"url":"https://postman-echo.com/put"}
    https example INFO: Data sent for PUT request: My PUT request data
    https example INFO: =========== DELETE REQUEST ===========
    https example INFO: {"form":{},"headers":{"user-agent":"Resty/0.1 (Java)","accept":"application/json","host":"postman-echo.com","x-forwarded-proto":"https","x-forwarded-port":"443"},"files":{},"json":null,"data":{},"args":{},"url":"https://postman-echo.com/delete"}
    • It confirms HTTPS communication between the board and the postman-echo.com server.