Ruff Lite Getting Started

Prerequisites

  1. Hardwares are ready
  2. Driver and flash tool are installed
  3. Ruff SDK is installed

If preparation is not ready, please refer to Development Preparation

Step 1: Create a new Ruff Application

  1. Create a new directory named hello-ruff-lite
  2. Enter hello-ruff-lite, execute the following commands.
  • TM4C1294
rap init --board tm4c1294-v1
  • ESP32
rap init --board esp32-air-v40
  1. Fill in necessary information according to the tips.

Step 2: Add and activate session

The aim of this step is to add and activate connection channel with development board (one board, one connection channel). One application project can have many connection channel configurations, but only one can be active.

connection channel: descripe how PC connects development board, with port or IP address. Once connection channel has been setup already, all the interactive commands do not need these informations (port, IP address, etc.)
any more.

  • TM4C1294
rap session add --name tm4c --paramters serial=0F0036A7
rap session activate tm4c

The serial number is fixed for one TM4C1294 developement board. You can acquire it by using ls /dev/cu.* command on MacOS or dmesg on Linux.

If only one TM4C1294 development board is connected to your PC, you can just skip this step.

  • ESP32
rap session add --name esp32 --parameters port=/dev/cu.SLAB_USBtoUART
rap session activate esp32

For different OS, the ESP32’s port is also different. The port is /dev/cu.SLAB* on MacOS, /dev/ttyUSBx on Linux and COMx on Windows.

Step 3: Download and install firmware

  1. Download the Ruff Lite firmware on the download page
  2. Flash firmware into dev board
  • TM4C1294
rap system upgrade /path/to/ruff-lite-xxx-tm4c1294-v1.bin
  • ESP32
rap system upgrade /path/to/ruff-lite-xxx-esp32.zip
  1. The commands above need to be executed in the Ruff application directory.
  2. If you use Linux, add sudo before rap command.

Step 4: Deploy Ruff application

  • TM4C1294
rap deploy

The default logic of src/index.js is lighting up the green LED on the board.

$('#led-1').turnOn();

For TM4C1294, #led-1 is green LED on the board (about the LED position, please refer to TM4C1294 board built-in resources)

  • ESP32
rap deploy

The default logic of src/index.js is lighting up the blue LED on the board.

$('#led').turnOn();

For ESP32,#led is blue LED on the board (about the LED position, please refer to ESP32 board built-in resources)

Since ESP32 has WiFi module inside, you can develop some network-based application. About the WiFi configuration usage, please refer to ESP32 WiFi configuration

If everything goes well, you should see the LED is lighted up after the application starts successfully.

Next Step

To learn more about Ruff application development, see Ruff Developer Guide - Application Development.