A cross-platform implementation of ESP Rainmaker for ESP32 products and Linux using Rust.
Full fledged C based ESP RainMaker SDK can be found here.
- Follow the Prerequisites section in the
esp-idf-template
crate. - Install Protobuf compiler on your system.
- Install ESP-Rainmaker app on your phone.
Please clone this repository using the below command:
git clone https://github.com/shreyash-b/rainmaker-rs.git
- Erase flash contents:
espflash erase-flash
- Use rainmaker cli to perform manual claiming on ESP devices
./rainmaker.py claim /dev/ttyUSB0 --addr 0x3FA000
- Navigate to rainmaker-rs directory
cd rainmaker-rs
- Build the project
cargo build
- Run
cargo run --target <mcu-target>
List of targets for various chipsets:
MCU | Target |
---|---|
ESP32 | xtensa-esp32-espidf |
ESP32-S2 | xtensa-esp32-espidf |
ESP32-S3 | xtensa-esp32-espidf |
ESP32-C2 | riscv32imc-esp-espidf |
ESP32-C3 | riscv32imc-esp-espidf |
ESP32-C6 | riscv32imc-esp-espidf |
- Monitor
espflash monitor
- Create directories for storing persistent data
mkdir -p ~/.config/rmaker/fctry
mkdir -p ~/.config/rmaker/nvs
- Fetch claim data using rainmaker cli
./rainmaker.py login
./rainmaker.py claim --mac <MAC addr> /dev/null
- Run
cargo run --target x86_64-unknown-linux-gnu
OR
cargo run_linux
Once the example is running, open the rainmaker mobile application and follow on-screen instructions for adding device
When running for the first time, you'll need to set RMAKER_CLAIMDATA_PATH
environment variable to the folder containing your claim data (mentioned in before running section)
- When running on ESP32 for first time, on initial boot it will start wifi provisioning and user node mapping.
- After performing wifi provisioning using Rainmaker Android application restart the ESP32 for normal functioning