ESP32 JOSH Application Development Guide - JOSH-VM/JOSHVM GitHub Wiki

0. Download and install JOSH Application IDE - JOSHVM Studio (Win32 only)

0.1 Download JOSHVM Studio

To download JOSHVM Studio IDE, find the download link of JoshVMStudio from here, then download the latest version and unzip it to any directory on your Windows PC to install.

  • NOTE: The install path name of JOSH Application IDE (JOSHVM Studio) SHOULD NOT contain any space or Chinese characters.

0.2 Open JOSHVM Studio

To open JOSH IDE, go to IDE install directory, find Studio/JoshVMStudio.exe, and run it.

1. Connect and Configure ESP32 development board

1.1 Connect to PC

ESP32 Development Board (ESP-LyraT-Mini or WROVERKIT) use USB 5V as power supply, just connect the board's POWER port to PC's USB port by MiniUSB cable is OK. Push POWER switch to "ON", you should see red power light up.

1.2 Install USB driver

LyraT-Mini board: Go to https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers to download correct version of USB driver.

WROVERKIT Go to http://www.ftdichip.com/Drivers/VCP.htm to download correct version of USB driver.

After installation, the COM port should be seen in PC's Control Panel -> Device Manager.

2. Download and run demo application

2.1 Create HelloWorld project

2.1.1 Create "Standalone" project.

Open JOSH Application IDE (JoshVMStudio), in the Left View, right-click and select "New->Standalone" to create new project. As below:

Input your project name (e.g. HelloWorld) in "Project name" input box, and click "Add" to add Configuration.

In the pop-up Add Configuration window, select "Josh Device SDK" and "ESP32_JOSHKIT" device.

2.1.2 Write your code.

In the left view, double click src and default package in the generated project, find and open YourProjectName.java. Write down just 1 line code to output "Hello World!" in main() method of this .java file: System.out.println(“Hello World!”);

2.1.3 Application Download

Right-click on your project tree in left view, select Josh VM->Application Download item, open download dialog window.

When click "download", as shown below, input your COM port name (e.g. COM4 in my case).

Click OK button, Console view in the PC will show some trace log, and when downloading finished, it'll finally reminder to reset the board.

2.1.4 Application Run

Right-click on your project tree in left view, select Josh VM->Application Run, open Run dialog window.

Input the COM port name which the board connected (e.g. COM4) and main class name (in this case, the main class name is automatically selected by IDE), click OK button, the console will show up a message to wait the device reset. Now press RESET button on the board (if no response, press RESET then BOOT on the board). If the application run correctly, console will show up the result: "Hello World!".

2.2 Import Demo Applications

2.2.1 Select demo package to be imported

From File menu, select Import… Select "General->Existing Projects into Workspace", click "next". Import as Directory or Archive. To import the demo packages which shipped along with SDK, use "Select archive file:", choose the demo package file to be imported, then "finish"

2.2.2 Select Board Configuration

Right-click the just imported project in Project View in the left, select "Properties" In pop-up window, select "Josh Standalone" from left tree view.

Lookup ESP32_JOSHKIT in the right Configurations list. If there's not, click "Add…" button. (Ignore this step if ESP32_JOSHKIT already appears in the list) In pop-up window, select "Josh Device SDK", and Device select "ESP32_JOSHKIT", then click Finish. Check the checkbox of ESP32_JOSHKIT, then click "OK"

2.2.3 Download Application

Same as 2.1.3

2.2.4 Application Run

Same as 2.1.4

2.3 Setup WIFI

2.3.1 Download sample configuration file properties.ini from

https://file.joshvm.com/resource/other/properties.ini

2.3.2 Edit configuration file:

Open and edit properties.ini, find system.network.wifi.ssid and system.network.wifi.password, replace values with your WIFI configuration

2.3.3 Download configuration file to the board

Right-click the project in left view, select "Josh VM->Property Download". (Note: If there's not Property Download in the menu, please confirm that your Board Configuration is "ESP32_JOSHKIT")

In Download dialog window, input COM port name which the board connected to, and click "Browse" to select the properties.ini file, which has just been edited with correct WIFI configuration. Then click "OK". The console will show up message to wait board reset. Press RESET button on the board and wait for downloading finish message in the console.

Don’t have to download properties.ini again, until WIFI configuration need to be changed.

3. ESP32 Demos

3.1 SocketDemo : https://file.joshvm.com/resource/sample/SocketDemo.zip

3.2 FileDemo: https://file.joshvm.com/resource/sample/FileDemo.zip

3.3 GPIODemo: https://file.joshvm.com/resource/sample/GpioDemo.zip

3.4 AudioDemo (LyraT-Mini only): https://file.joshvm.com/resource/sample/AudioDemo.zip

3.5 MediaDemo (LyraT-Mini only. Need SD card): https://file.joshvm.com/resource/sample/MediaDemo.zip

3.6 WakeupDemo(LyraT-Mini only): https://file.joshvm.com/resource/sample/WackUpDemo.zip

3.7 AISpeechDemo (LyraT-Mini only. TTS, Weather ask&answer, Light Control by speech. In Chinese only): https://file.joshvm.com/resource/sample/JoshAiSpeech.zip