RainMaker CLI User Guide
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:
- 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.
- Run the OS specific installer to install Python 3.
- Verify the installation by running following command on terminal.
$ python3 --version
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
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
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
- Sign up using the following command:
esp-rainmaker-cli signup <email>
- Log into the CLI using the following command:
esp-rainmaker-cli login [--email <email>]
If the email is not provided, a browser window will open for login.
- 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]...
Run esp-rainmaker-cli {command} -h
for additional help.
No. | Command | Description |
---|---|---|
1 | signup | Sign up for ESP Rainmaker |
2 | login | Login to ESP Rainmaker |
3 | logout | Logout current (logged-in) user |
4 | forgotpassword | Reset the password |
5 | getnodes | List all nodes associated with the user |
6 | getnodeconfig | Get node configuration |
7 | getnodestatus | Get online/offline status of the node |
8 | setparams | Set node parameters. Note: Enter JSON data in single quotes |
9 | getparams | Get node parameters |
10 | removenode | Remove user-node mapping |
11 | provision | Provision the node to join Wi-Fi network |
12 | getmqtthost | Get the MQTT Host URL to be used in the firmware |
13 | claim | Claim the node connected to the given serial port (get cloud credentials) |
14 | otaupgrade | Upload OTA Firmware image and start OTA Upgrade |
15 | getuserinfo | Get details of current (logged-in) user |
16 | sharing | Node Sharing Operations |
17 | create_cmd_request | Create a Command Response Request (Beta) |
18 | get_cmd_requests | Get Command Response Requests (Beta) |
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}}