Integrate your ESP32-based device to manage it via {{ coiote_short_name }}.
- An M5StickC device.
- Installed ESP-IDF and dependencies (installation steps 1-4 from ESP32 official documentation). Supported ESP-IDF version is v4.4.
- A user with access to the {{ coiote_long_name }}.
- Create a project directory for the integration.
- Go to https://github.com/AVSystem/Anjay-esp32-client/releases and download
m5stickc-plus.binandnvs_partition_gen.pyto your project directory.
-
Create a
nvs_config.csvfile and save it in your project directory. In the file, provide your credentials in [wifi_ssid], [wifi_password], [endpoint_name], [identity], [psk], [lwm2m_server_uri] (without the[]brackets). Use the following snippet as a template:key,type,encoding,value config,namespace,, wifi_ssid,data,string,[wifi_ssid] wifi_pswd,data,string,[wifi_password] wifi_inter_en,data,u8,1 endpoint_name,data,string,[endpoint_name] identity,data,string,[identity] psk,data,string,[psk] uri,data,string,[lwm2m_server_uri] writable_wifi,namespace,, wifi_ssid,data,string,[wifi_ssid] wifi_pswd,data,string,[wifi_password] wifi_inter_en,data,u8,0!!! Note The additional parameters under the writable_wifi namespace are used to provide a secondary Wi-Fi configuration (it is not obligatory). This allows for switching between Wi-Fi configurations while the device is running.
!!! Note The nvs_config.csv file can also be downloaded from https://github.com/AVSystem/Anjay-esp32-client/releases
-
Open a command line interface, go to your project directory, and generate the NVS partition:
=== "Linux"
linux pip3 install future cryptography python3 nvs_partition_gen.py generate nvs_config.csv nvs_config.bin 0x4000
=== "Windows"
windows pip3 install future cryptography python nvs_partition_gen.py generate nvs_config.csv nvs_config.bin 0x4000
{: style="float: left;margin-right: 1177px;margin-top: 17px;"}
To connect your M5StickC to the {{ coiote_long_name }}, use your access to a {{ coiote_short_name }} installation, or register at {{ coiote_site_link }}/ to get access.
To connect the board:
- Log in to {{ coiote_short_name }} and from the left side menu, select Device Inventory.
- In Device Inventory, click Add device.
- Select the Connect your LwM2M device directly via the Management server tile.

- In the Device credentials step:
- In the Device ID field, type the endpoint name provided in the
nvs_config.csv, e.g.ESP32_test. - In the Security mode section, select the PSK mode.
- In the Key identity field, type the name provided in the
nvs_config.csv, e.g.ESP32_test. - In the Key field, type the
pskkey provided in thenvs_config.csv.
- In the Device ID field, type the endpoint name provided in the
- Click the Add device button and Confirm in the confirmation pop-up.
- In the Connect your device step, the server is waiting for the board to connect. You can now start connecting the device.
Connect the M5Stick board to a USB port of your machine and open ESP-IDF command line application.
Use pre-built binaries to flash the board and provide credentials by flashing the NVS partition binary.
- Install the
esptool.py:
pip install esptool
-
Flash the board:
!!! tip Before flashing the device you should erase the flash first to make sure you have correct settings: === "Linux"
linux esptool.py erase_flash=== "Windows"windows esptool erase_flash=== "Linux"
linux esptool.py -b 750000 --chip esp32 write_flash 0x0000 m5stickc-plus.bin=== "Windows"windows esptool -b 750000 --chip esp32 write_flash 0x0000 m5stickc-plus.bin -
Flash the NVS partition binary:
=== "Linux"
linux esptool.py -b 750000 --chip esp32 write_flash 0x9000 nvs_config.bin=== "Windows"windows esptool -b 750000 --chip esp32 write_flash 0x9000 nvs_config.bin
Once executed, the device will be reset and run with the configuration you provided.
After successful connection to {{ coiote_short_name }}, you can explore the available device objects.
| Target | Objects |
|---|---|
| ESP32 common | Security (/0) Server (/1) Device (/3) Firmware Update (/5) WLAN connectivity (/12) |
| M5StickC-Plus | Push button (/3347) Light control (/3311) Temperature sensor (/3303) Accelerometer (/3313) Gyroscope (/3343) |
To perform a FOTA upgrade, you need an established connection between the M5StickC and {{ coiote_short_name }} (see instructions above).
- Open a command line interface and run
git clone https://github.com/AVSystem/Anjay-esp32-client. - Go to the directory of the cloned repository and run
idf.py set-target esp32. - Run
git submodule update --recursive --init. - Run
idf.py menuconfig, navigate toComponent config/anjay-esp32-client, and from the supported boards, select M5StickC. Presssandenterto save. - Run
idf.py build. - Once executed, check if the binary file has been built in the following path
$PROJECT_DIR/build/anjay-esp32-client/build.
-
In your {{ coiote_short_name }} account, select your device in Device inventory and click the LwM2M Firmware tab.
-
Click Schedule new firmware upgrade.
-
Click Upload to select the binary file from your local drive, select COAP in the Image delivery protocol, and click Upgrade.
!!! tip The COAPS option is also supported. To use it, you may need to additionally provide the Base URI parameter (depending on your server settings).
-
The FOTA upgrade is now scheduled. Note that it might take a few minutes to complete.
-
Once the upgrade is finished, you can check the new version of the firmware under Current firmware.



