71 Commits

Author SHA1 Message Date
Piyush Shah
bfa60ea158 rmaker_app_network: Expose the API to read the configured PoP 2026-01-08 19:06:26 +05:30
Piyush Shah
9474b2e08c rmaker_app_network: Better handling of provisioning failures
Remove the retry logic for Wi-Fi disconnected events while in
provisioning mode because it is handled internally by the
network_provisioning component. Now, depending on the Kconfig options,
the firmeare will try Wi-Fi connection one or more time and then stop.
Phone apps can reset the state and retry provisioning on the same
session.

Also, reduced the default connection retry count from 5 to 3 so that
users would have to wait for lesser time for retrying
2025-12-16 16:29:31 +05:30
Shreyash Bubane
963729bda7 rmaker_app_network: update component version 2025-12-11 12:16:11 +05:30
Shreyash Bubane
51b310458d rmaker_app_network: add MFG data for AI Agent 2025-12-11 12:16:11 +05:30
Shreyash Bubane
d02b2f4d0f rmaker_app_network: added menuconfig to control app_network_start() return behaviour 2025-12-11 12:16:11 +05:30
Piyush Shah
d91538695d examples/common: Prepare common example components for component registry 2025-11-13 00:03:13 +05:30
Piyush Shah
7dedfad9f7 app_network: Use new wifi retry count field for better resilience in poor network conditions
If network connection fails even once, the firmware reports so to
clients (like phone apps) and the clients declare failure and abort
immediately, even if the firmware eventually connects. With this
change, a failure will be reported only after a few retries (whise
number is configurable)
2025-11-12 17:01:19 +05:30
Piyush Shah
354f22eb5b Merge branch 'task/app-reset' into 'master'
app_reset: Remove dependency on local gpio_button component

See merge request app-frameworks/esp-rainmaker!586
2025-10-28 02:02:22 +05:30
Piyush Shah
2a879fb485 app_reset: Remove dependency on local gpio_button component
Use the upstream espressif/button component instead.
Made other changes to make the component independent enough to
be uploaded on component registry.
2025-10-27 18:00:29 +05:30
Vikram Dattu
712a277d05 Renamed wifi_start and wifi_init APIs defined in app_wifi_internal
- The API names are too common/generic
 - Conflict with hosted APIs and hence needs to be renamed
2025-10-17 15:49:02 +05:30
Piyush Shah
15922cf7c0 examples: Remove legacy code for esp-idf versions < 5.1 2025-08-29 20:02:57 +05:30
Piyush Shah
5536af3487 app_network: Remove CONFIG_ESP_RMAKER_USING_NETWORK_PROV
Made network prov as default since it is supported for esp-idf v5.1
onwards and esp-idf v5.0 has reached end of life.

This will make the code more readable
2025-08-29 20:02:41 +05:30
Piyush Shah
efcb15b137 cleanup: Remove Makefile related files as it is not supported any more
ESP IDF has moved to CMake since long back and these files were anyways
unused
2025-08-29 19:52:06 +05:30
WanqQixiang
6a79869068 examples: Add client-only matter controller example 2025-06-23 17:22:40 +08:00
Piyush Shah
f6e07b593e examples: Configure ESP32-C5 GPIO defaults for examples
- Set button GPIO to 28 for ESP32-C5 devkit (vs GPIO 9 for other C-series)
- Set WS2812 LED GPIO to 27 for ESP32-C5 devkit (vs GPIO 8 for other C-series)
- Updated examples: gpio, switch, multi_device, temperature_sensor, fan, led_light
2025-06-09 17:44:47 +05:30
Piyush Shah
b5e1a46591 examples: Changes for component manager based builds 2025-03-25 17:54:31 +05:30
Piyush Shah
327f35437e esp_rainmaker_components: Remove all external dependencies from codebase
Removed
- esp-insights
- jsmn
- json_generator
- json_parser

Instead, pick them up from idf component manager
2025-03-25 17:11:07 +05:30
Vikram Dattu
35941c8925 examples/common: use qrcode from component manager
- Remove qrcode sources from examples/common
 - Added idf_component.yml file to app_wifi component with qrcode dependency
 - Added qrcode_display function in app_wifi which wraps the qrcode generation
2025-03-21 15:49:58 +05:30
Gautam Agrawal
88d359014e Update esp_insights submodule to 1.2.4
* Update app_insights components dependency version to 1.2.4
2025-02-28 11:30:55 +05:30
Piyush Shah
72845bc086 bugfix: app_wifi logs had app_thread tag 2024-10-25 17:31:21 +05:30
Piyush Shah
cff0db657d app_network: Handle renaming of app_wifi config options to app_network
Since all CONFIG_APP_WIFI_x config options have been renamed to CONFIG_APP_NETWORK_x,
the older settings may get lost after upgrading esp-rainmaker to use the
new app_network component. This commit ensures that the old config options
will get automatically renamed to appropriate new config options.
2024-09-11 18:21:24 +05:30
WanqQixiang
0470847455 rmaker: Add a configuration option to make the provisioning component selectable 2024-09-10 15:47:43 +08:00
Mahavir Jain
52524f601b Merge branch 'fix/app_wifi_cxx_guards' into 'master'
fix: include guard in app_wifi.h

See merge request app-frameworks/esp-rainmaker!465
2024-08-23 19:31:53 +08:00
Jakob Hasse
648d4aa2d6 fix: include guard in app_wifi.h 2024-08-23 12:39:00 +02:00
Vikram Dattu
3e375f43f6 Enable Insights command response module
- Updated esp_insights submodule and the component version dependency
 - Selected `ESP_INSIGHTS_TRANSPORT_MQTT` in examples sdkconfig.defaults
 - Called esp_insights_cmd_resp_enable

 - Also updated `cli` submodule to the latest
2024-08-22 10:32:54 +05:30
WanqQixiang
aa6dcdf559 example: Update examples to use app_network for Thread provisioning 2024-08-06 16:29:35 +08:00
WanqQixiang
dbc2ed69e6 example: Update app_wifi component to app_network component which can be used for Thread provisioning 2024-08-06 16:29:35 +08:00
Vikram Dattu
904938f1b0 Added support for LEDC driver
This can drive the LED on ESP32C2
2024-05-10 17:58:24 +05:30
Vikram Dattu
5dccee9eac examples: Add support for esp32c2
- Added entry for esp32c2 build in CI
- RAM optimized sdkconfig.defaults.esp32c2
- Disable ws2812 led drivers from non-rmt supported devices
- Use GPIO9 as BOOT button for C2
2024-05-09 20:38:11 +05:30
Vikram Dattu
138e2e6983 Add support for closing provisioning window after PoP mismatch
- The feature prevents brute force attacks by not allowing more than allowed PoP attempts
 - Allowed failure attempts are configurable via menuconfig and is 5 by default
 - Change added for both `app_wifi` and `app_wifi_with_homekit`
 - Min IDF version needed (release/v5.1.3)
2024-03-13 15:52:10 +05:30
Piyush Shah
20d826c232 esp_rainmaker: Update version for idf component manager
app_insights component manifest file also changed for better
handling of component versions.
2024-01-04 13:16:51 +05:30
Piyush Shah
00bf093167 app_wifi: Add an option to provide a custom Proof of Possession (PoP) for provisioning
POP_TYPE_CUSTOM has been added as an option for app_wifi_start().
app_wifi_set_custom_pop() should be used before this.
2023-11-29 13:56:05 +08:00
Vikram Dattu
10361704b4 wifi-prov cli: Set Wi-Fi creds directly for already provisioned devices
When device is already provisioned, `wifi_prov_mgr_configure_sta` API call fails.
This happens because, provisioning manager is in uninitialized state.
We set Wi-Fi credetials directly using `esp_wifi_set_config` in that case.

Also removed error check on `wifi_prov_mgr_is_provisioned` API call, as for
IDF 4.x APIs return `ESP_ERR_INVALID_STATE`
2023-10-27 18:20:00 +05:30
Vikram Dattu
f1d16cf736 examples: Added support for ESP32C6
1. ESP32C6 button configs for RGB LED and Boot GPIO
2. CI: Added entry for C6 in `.gitlab.yaml`
3. Added `partitions_4mb_optimised.csv` which uses flash to the full extent
  - Created sdkconfig.defaults for esp32c6 and used partitions_4mb_optimised.csv as default
  - This is made default for esp32c6 because, for esp32c6, image sizes exceed config from partitions.csv
4. Fixed matter examples CMakeLits.txt files for c6 support
2023-10-26 17:38:53 +05:30
Piyush Shah
cfca241575 idf_component_manager: Add components of esp rainmaker to component manager
Includes esp_rainmaker and esp_schedule
2023-09-22 09:40:00 +05:30
Piyush Shah
f6ed0c4994 components: Updated and moved some components
- qrcode, ws2812_led and gpio_button moved to examples/common
- esp-insights and rmaker_common submodules updated
- json_generator and json_parser components copied from component
  manager so that they can be used for component overrides
2023-09-22 09:39:55 +05:30
sanket.wadekar
d789c719e6 wifi_prov: Add mfg data for improved device discovery
For BLE provisioning, adding some metadata in BLE advertisement can help
apps in filtering the scanned device list better, instead of relying
just on the prefix. It can also help show the device type even before
provisioning.

Metadata has been added in led_light and switch examples only, but can be
added in any other project too, as per the apps' requirement.
2023-08-18 18:22:06 +05:30
sanket.wadekar
d7dc0c56c9 task: create event loop in app_insights 2023-05-29 15:21:34 +05:30
Vikram
7da0ec23db Bugfix: MQTT budget exceed causing WDT trigger in ESP-Insights
Cause: A vicious cycle:
MQTT budget exceed error print getting logged into ESP-Insights.
When the RTC memory is full, this causes it to drop the message and
raise memory full event, which then taken action as reporting Insights
data immediately. This again causes MQTT budget exceed error!

The fix: Do not try to send message when budget is not available

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2023-02-01 12:43:41 +05:30
sanket.wadekar
2f2c383e5e mqtt_topics: Added support for AWS basic ingest topics.
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-11-21 18:59:47 +05:30
sanket.wadekar
cf3b8d851a Added MQTT disconnect and user node mapping reset calls on WiFi/Factory Reset.
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-11-15 10:43:09 +05:30
Vikram
3834314f72 Use SPIRAM for esp-insights allocations
When SPIRAM not available, it falls to internal RAM

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2022-09-16 13:10:50 +05:30
Vikram
a9798f71df IDF5.0 build fixes
1. Added requires wherever necessary
2. Use exact format specifiers
3. Updated `esp-insights` and `rmaker_common` submodules

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2022-08-26 19:04:02 +05:30
Chirag Atal
8fb1966178 gpio_button: Renaming button to gpio_button to fix compilation errors
Multiple components with the same name are detected if the idf_component_manager also includes the button component.
2022-07-20 14:43:07 -04:00
Chirag Atal
db2c8d3b58 minor: Fix support for cpp 2022-07-13 12:46:41 -04:00
Piyush Shah
4250addc13 app_wifi: Make provisioning prefix configurable 2022-04-28 17:21:34 +05:30
Piyush Shah
c0af462fee app_wifi: Add an option to reset prov state machine on failure
Earlier, a reset and reboot were required if wrong Wi-Fi credentials
were given during provisioning. With this change, based on some
configured number of reconnection attempts, the firmware will go back into
provisioning mode.
2022-04-28 17:21:34 +05:30
Piyush Shah
d796985bac app_wifi: Minor feature additions to provisioning workflow
- Provide an option of provisioning without PoP pin (use with caution).
- Config option for provisioning timeout (set to 30 min by default).
Useful especially when there is no PoP, and so you want to keep the device
in provisioning mode only for a few minutes after boot up.
2022-04-28 17:21:34 +05:30
Shubham Patil
e3573c81da app_insights: Insights transport changes 2022-03-04 17:44:31 +05:30
Shubham Patil
dc65f11661 esp_insights: Update submodule and minor fixes
- app_insights:
 - Replaced esp_insights_rmaker_enable() API with esp_insights_enable()
 - Enable errors, warnings, and events when user selects LOG_TYPE_ALL
 - Fixed compilation errors and warnings
2021-10-29 09:48:59 +05:30