Step 2: Configure MamaDuck
To start the PlatformIO extension, click its icon on the sidebar.
Click on Pick a Folder and open
ClusterDuck-Protocol/examples/1.Ducks/MamaDuck when prompted.
Note: there are different ways of doing the same thing on PlatformIO. This tutorial highlights
its basic IDE tools and mentions an appropriate alternative if using its command line interface
(CLI). If you prefer the CLI, you can start it by clicking its icon on PlatformIO's taskbar
In the MamaDuck.ino file, set your MamaDuck ID on line number 33:
std::string deviceId("MAMA0001");
, or use the default. Make sure the final ID is 8
characters long. Each device is required to have a unique identifier to operate properly in
the network.
The platformio.ini file in this folder contains the configurations to build your
MamaDuck. It also allows us to adapt the Duck to different boards and environments. I'm using a Heltec
Wifi Lora 32 V2, so I can select its environment as the default by commenting it out in this file.
Note that I'm selecting the production environment because I want to use the released CDP instead
of a local copy. If you clone the CDP repo, modify some files, and want to build one of the examples
to reflect your changes, you should select the local environment instead.
After setting your MamaDuck ID and board environment, click the upload icon on the
taskbar.
If using the CLI, type platformio run -e prod_heltec_wifi_lora_32_V2 -t upload
to
select the environment and upload to the board in one step.
If the upload was successful, click on the serial monitor icon on the taskbar and
check that your MamaDuck was configured correctly. If using the CLI, type
platformio device monitor -e prod_heltec_wifi_lora_32_V2
.
You should see a [MAMA]: Setup OK!
message.