low.js Tutorial: Getting Started
Here we explain how to install low.js onto an ESP32-WROVER board and how to interact with the preinstalled example program.
1. Flash/install low.js on your board
This was tested on Windows, macOS and Linux. It might work on other platforms.
Step 1.1: Install Node.JS on your PC
No, Node.js is not used by the microcontroller or low.js itself! Node.js and the package manager npm, which is distributed with Node.js, are only used by lowsync, our flashing and syncing tool.
For this, download the right installation package from https://www.nodejs.org/ and install.
Step 1.2: Install lowsync via npm on your PC
To do this, enter the following command as Administrator/root in your terminal:
npm install --unsafe-perm -g lowsync
–unsafe-perm lets the install script run as root instead of letting npm change the user to nobody before running the install script. This is required for the serialport module.
Alternatively, install as normal user into your local node_modules directory:
npm install lowsync
You then have to always call lowsync with path however:
node_modules/.bin/lowsync [your parameters...]
Step 1.3: Flash low.js (not needed with neonious one)
After connecting to the board physically by plugging in the cable, you need to find out what the port name is. Under Windows the port usually begins with
COM, under other platforms it is a file beginning
/dev/tty. If you cannot find the port, chances are you need to install a device driver for the USB to UART adapter chip.
For the actual flashing of low.js, enter the following command in your terminal:
lowsync flash --port=portname --init
As portname enter the port name you found in the last step.
2. Interact with preinstalled application
Step 2.1: Connect to the microcontroller's Wifi
The Wifi SSID and password to use should have been outputted by the flash command.
If you want to be able to continue to use the Internet, you can tell your device to connect to your existing Wifi by changing the low.js settings with lowsync. You then can also use your existing Wifi with working Internet access. See here for more details.
From now on, the serial port of low.js will no longer be used for development. It is free to use by the user program.
Step 2.2: Point browser to 192.168.0.1 (or other IP if you changed network settings)
You will see the preinstalled example:
The pre-installed example program
If two people open the website, you can chat through the included chat box (implemented with WebSockets).
Step 2.3: Take a look at the source code
To take a look at the source code of the preinstalled example, create a new project directory. In the new directory, initialize the project by entering the following command in the terminal:
my_project_directory> lowsync init
Then sync the preinstalled example from the microcontroller to your PC with:
my_project_directory> lowsync sync
The source code is now in the directory, ready for you to take a look at.
Next tutorial: Blink LED