Skip to content

Theia Extension

Kempec Halk edited this page May 24, 2022 · 1 revision

Introduction

The Theia Extension provides a Widget to deploy and monitor code remotely on devices using the well-known Theia IDE Environment.

It compiles the code and sends a deployment request, including the binary data, for a specific device to the Deployment Server, which forwards the request to the responsible Device Connector and transfers the monitoring output back to the Theia Extension.

Requirements

  • NodeJS Version >= 12.20.1
  • Yarn Version >= 1.22.18
  • Arduino CLI >= 0.20.0 (last tested 0.21.1)

Getting Started

To have an easy installation and start of the CDT.cloud Services run the ./cdtcloud script from the root directory.
You can either run Theia natively on your system or in a Docker container.

Quick Start

The Arduino CLI needs to be running on startup.
Start the daemon with arduino-cli daemon --port 50051 --daemonize

First Installation

  1. Initialize the Arduino CLI by running arduino-cli config init
  2. Update the core and library indexes with arduino-cli update
  3. Install the base cores by entering arduino-cli core install arduino:avr
  4. Install the dependencies using yarn --cwd=cdtcloud
  5. Build Theia either for
    • Browser yarn --cwd=browser-app run theia build --mode=production
    • Electron yarn --cwd=electron-app run theia build --mode=production
  6. Download the necessary plugins by running yarn --cwd=cdtcloud theia download:plugins

Run the CDT.cloud Imlpementation in Theia

  • Run Theia in either in
    • Browser using yarn --cwd=browser-app start and enter Theia by heading to localhost:3000
    • Electron using yarn --cwd=electron-app start
  • Select View > Cdtcloud Widget to open the extension widget

Docker

  1. Run the ./cdtcloud script from the root directory
  2. Select docker to run the docker tools
  3. Enter the command start:theia:d to start the service
  4. You can use the docker section to attach and kill containers as well
  5. Head to localhost:3000 to enter Theia
  6. Select View > Cdtcloud Widget to open the extension widget

Configuration

  1. Head to Theia and choose File > Preferences > Open Settings
  2. Select the Extensions Tab
  3. Set the correct variables for the connection to the Deployment Server

Adding support for additional devices

More devices or cores can be supported by installing them through the Arduino CLI.
This needs to be done in the Device Connector as well.

It is possible that the code needs to be slightly adjusted to be able to select the correct output file.

A new core support can be installed within the Arduion CLI by running the following commands:

arduino-cli core update-index
arduino-cli core install base:core

External Cores - i.e. STM32 Board-Core

arduino-cli config add board_manager.additional_urls https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
arduino-cli core update-index
arduino-cli core install STMicroelectronics:stm32