Skip to main content

RainMaker CLI User Guide

about

The RainMaker CLI in ESP RainMaker is a command-line tool that allows developers to manage and interact with their ESP32-based devices and configure RainMaker services. It is mainly used for public RainMaker for build and manage ESP32-based IoT applications. You can still use RainMaker Cli in specified conditions in private RainMaker. View the difference between RainMaker Cli and Admin please click here.

Use Cases

RainMaker Cli is usually used when Host driven claiming is requirement or to try other functionality that are not currently available in the phone apps or dashboard.


RainMaker CLI Setup

Installing Python 3

If you have Python 3 already installed, just move on to the next section. Otherwise, follow these steps:

  1. Download Python 3 for your OS from the Python website. Latest version should be fine, but the CLI is tested with Python 3.7.4.
  2. Run the OS specific installer to install Python 3.
  3. Verify the installation by running following command on terminal.
$ python3 --version
note

On Windows, use python --version to verify the installation.


Installing Dependencies

We will have to first install pip, which is a package installer for Python and then install the dependencies. Here are the steps:

Install pip

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py
note

On Windows, use python get-pip.py for pip installation.

Install RainMaker CLI

ESP RainMaker CLI is available on Python Package Index (PyPI). It can be installed using pip.

python3 -m pip install esp-rainmaker-cli
$ cd /path/to/esp-rainmaker/cli/
$ pip3 install -r requirements.txt

Git clone esp-rainmaker-cli SDK

Alternatively, you can over to esp-rainmaker-cli and git clone the project into your local machine directly.

Then navigate into the project to get started.

$ cd esp-rainmaker-cli

RainMaker CLI Usage & Commands

Set RainMaker Cli region

Configure region

There are region difference when it comes to trying out RainMaker cli in the Global vs China region.

If you are using RainMaker cli in China Region, please configure it as below:

$ esp-rainmaker-cli configure --region china

If you are using RainMaker cli in Global Region, please configure it as below:

$ esp-rainmaker-cli configure --region global

Login to/signup for a RainMaker Account

  1. Sign up using the following command:
esp-rainmaker-cli signup <email>
  1. Log into the CLI using the following command:
esp-rainmaker-cli login [--email <email>]
tip

If the email is not provided, a browser window will open for login.

  1. After successful login, you can use the Rainmaker CLI.

User Guide

This is a generic command for esp-rainmaker-cli: esp-rainmaker-cli [OPTIONS] COMMAND [ARGS]...

tip

Run esp-rainmaker-cli {command} -h for additional help.

No.CommandDescription
1signupSign up for ESP Rainmaker
2loginLogin to ESP Rainmaker
3logoutLogout current (logged-in) user
4forgotpasswordReset the password
5getnodesList all nodes associated with the user
6getnodeconfigGet node configuration
7getnodestatusGet online/offline status of the node
8setparamsSet node parameters. Note: Enter JSON data in single quotes
9getparamsGet node parameters
10removenodeRemove user-node mapping
11provisionProvision the node to join Wi-Fi network
12getmqtthostGet the MQTT Host URL to be used in the firmware
13claimClaim the node connected to the given serial port (get cloud credentials)
14otaupgradeUpload OTA Firmware image and start OTA Upgrade
15getuserinfoGet details of current (logged-in) user
16sharingNode Sharing Operations
17create_cmd_requestCreate a Command Response Request (Beta)
18get_cmd_requestsGet Command Response Requests (Beta)
note

Note: For esp-rainmaker-cli setparams command, the JSON data argument needs to be specified differently as per your Host OS.

MacOS/Linux: "Light": {"brightness": 50, "output": false}}

Windows: {\"Light\": {\"brightness\": 50, \"output\": false}}

On this page