Installing DeviceScript consists of preparing the computer tools and loading its runtime onto the board. We will need Node.js, Visual Studio Code, and the official extension.
Unlike the Arduino IDE, which brings almost everything together in one application, here we use a toolchain based on several tools. The VS Code extension coordinates the project, the compiler, the simulator, and the board.
DeviceScript was an experimental project from Microsoft Research and its official repository was archived on December 8, 2025.
The code and documentation are still available, but it is no longer maintained; therefore, some downloads or integrations may stop working with future versions of Node.js or VS Code.
We need three ingredients:
- Node.js: The engine that will run the tools underneath.
- VS Code: Our code editor.
- The DeviceScript extension: Integrates the workflow into VS Code.
Installing Node.js
DeviceScript is, after all, TypeScript. And to compile TypeScript and manage libraries, we need Node.js.
Even though we are programming a microcontroller, our PC needs Node to run the compiler and manage the packages (sensor drivers, utilities, etc.) that we will download from NPM.
Go to the official Node.js website.
Download an LTS (Long Term Support) version compatible with the latest version of DeviceScript.
Install it with the default options.
To check that everything went well, open a terminal (cmd or PowerShell) and type:
node -v
The command should display the installed version.
Installing Visual Studio Code
If you don’t have it, download Visual Studio Code from code.visualstudio.com. It is free and available for the main operating systems.
Important note: Do not confuse it with Visual Studio (the big purple IDE from Microsoft). We need Visual Studio Code (the blue one).
Installing the DeviceScript Extension
The extension transforms VS Code into the environment where we create, simulate, debug, and deploy programs.
Open VS Code.
Go to the Extensions tab (or press Ctrl+Shift+X).
Search for DeviceScript.
Install the extension published by Microsoft if it is still available.
Once installed, a new DeviceScript icon (the Jacdac logo) will appear in the left sidebar, along with new options in the status bar.
Creating Our First Project
Unlike Arduino, where you open a file and you’re set, here we work with Projects (folders).
Create an empty folder on your computer, for example MyFirstDeviceScript.
Open that folder with VS Code via File > Open Folder.
Open the command palette with Ctrl+Shift+P (or F1).
Search for the command to create a DeviceScript project and execute it.
The extension will configure the project and create several files. The most important ones are:
src/main.ts: This is where we will write our code. It is the equivalent of the.inofile in Arduino.tsconfig.json: TypeScript configuration. We don’t need to modify it for now.package.json: The file that manages the dependencies (libraries) of our project.
It may ask the first time if you want to install the project packages. Confirm the installation.
Connecting and Preparing the Board
We have the code, but our board (ESP32 or Pico) is still “empty” or has old firmware (perhaps MicroPython or Arduino). We need to install the DeviceScript Runtime on it.
The great thing is that the extension makes this very easy, but it is tricky the first time.
Connect the board via USB.
Look for the DeviceScript panel in the VS Code sidebar.
Open the connection section or click the plug icon.
Select the Serial connection.
If the board does not yet contain the runtime, VS Code will not recognize it as a DeviceScript device and will prompt you to flash the firmware.
The Flashing Process
DeviceScript uses a web tool for this.
Open the tool offered by the connection dialog or run DeviceScript: Flash Firmware....
Select the exact model of your board.
Follow the on-screen instructions.
On some boards, you need to hold down BOOT while connecting via USB to enter download mode. Follow the specific instructions for the selected model.
Once flashed, the board will restart and should appear in the list of connected devices with an automatically generated name.
Troubleshooting Common Problems
The most frequent failures occur during connection or flashing:
The USB Port Does Not Appear
This happens in 99% of cases.
- The USB cable: Make sure it is a data cable and not just a charging cable. Try a different cable.
- Drivers: If you are using an older ESP32, you need the CP210x or CH340 drivers installed on your computer.
WebSerial not supported Error
The flashing tool uses WebSerial technology. Make sure you are using a compatible browser (Chrome, Edge, or Opera). Firefox does not yet support it natively for this.
Flashing Fails Mid-Process
This sometimes happens if the USB port does not provide enough power or if there is interference.
- Try a different USB port (preferably one directly on the motherboard, not a hub).
- Disconnect other serial devices.
- If it is an ESP32, make sure to hold down the
BOOTbutton until the upload begins.