arduino-esp32/libraries/RainMaker/examples/RMakerDevice
2021-04-14 18:10:05 +03:00
..
.skip.esp32c3 Initial Esp32c3 Support (#5060) 2021-04-14 18:10:05 +03:00
.skip.esp32s2 v2.0.0 Add support for ESP32S2 and update ESP-IDF to 4.4 (#4996) 2021-04-05 14:23:58 +03:00
README.md v2.0.0 Add support for ESP32S2 and update ESP-IDF to 4.4 (#4996) 2021-04-05 14:23:58 +03:00
RMakerDevice.ino v2.0.0 Add support for ESP32S2 and update ESP-IDF to 4.4 (#4996) 2021-04-05 14:23:58 +03:00

Switch Example

Compile n Flash firmware

ESP32 Board

  • Assisted Claiming + BLE Provisioning

What to expect in this sketch ?

It demonstartes the toggling of power of devices using phone app and BOOT button.

  • Switch and Fan are the dummy device. Switch connected at gpio(16) and Fan connected at gpio(17).
  • Toggling the power button for any device(switch/fan) on phone app will change the status(on/off) for the device connected at gpio(16/17) and also update the status to the ESP RainMaker cloud if param.updateAndReport(val) API is called.
  • Pressing the BOOT button toggles the status(on/off) of both device(switch & fan) connected at gpio(16/17) and report values to the cloud.

Output

[I][WiFiProv.cpp:179] beginProvision(): Already Provisioned
[I][WiFiProv.cpp:183] beginProvision(): Attempting connect to AP: Wce*****

Received value = false for Switch - Power

Received value = false for Fan - Power

Received value = true for Switch - Power

[I][RMakerDevice.cpp:161] updateAndReportParam(): Device : Switch, Param Name : Power, Val : false

[I][RMakerDevice.cpp:161] updateAndReportParam(): Device : Fan, Param Name : Power, Val : true

Received value = true for Switch - Power

Received value = false for Fan - Power