espressif / esp-mesh-lite

A lite version Wi-Fi Mesh, each node can access the network over the IP layer.
132 stars 21 forks source link

mesh_lite upgrade v1.0.0 wifi_prov_mgr compilation exception (AEGHB-778) #115

Open yel-best opened 2 months ago

yel-best commented 2 months ago

Hi

use mesh_lite v1.0.0 version

image

After compiling, the following error will appear. What is the reason? After upgrading, an error is reported. I originally used v0.10.3 to upgrade to v1.0.0 version, through the configuration file:

espressif/mesh_lite: ">=1.0.0"

The latest mesh_lite version of components.espressif.com is only v1.0.0. When will v1.0.1be updated?

E:/MyProject/IoT/PlatformIO-ESP/esp-data-collect/mesh-lite-terminal/managed_components/espressif__mesh_lite/src/wifi_prov/wifi_prov_mgr.c:203:17: error: 'strncpy' output may be truncated copying 32 bytes from a string of length 39 [-Werror=stringop-truncation]
  203 |                 strncpy((char*)wifi_prov_mgr_mesh_lite_cfg.ssid, softap_ssid, sizeof(wifi_prov_mgr_mesh_lite_cfg.ssid));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:/MyProject/IoT/PlatformIO-ESP/esp-data-collect/mesh-lite-terminal/managed_components/espressif__mesh_lite/src/wifi_prov/wifi_prov_mgr.c:196:17: error: 'strncpy' output may be truncated copying 32 bytes from a string of length 39 [-Werror=stringop-truncation]
  196 |                 strncpy((char*)wifi_prov_mgr_mesh_lite_cfg.ssid, softap_ssid, sizeof(wifi_prov_mgr_mesh_lite_cfg.ssid));

image

tswen commented 2 months ago

What version is your idf? After updating the mesh lite component, you can delete the build folder and recompile it. Theoretically, this patch will be automatically applied to esp-idf during compilation. You can check whether the idf contains the changes in this patch. In addition, if you do not use the zero provisioning function of mesh_lite, you can only manually change this part image

yel-best commented 2 months ago

Contributor

Hi

Use IDF Version 5.1.4

I modified the configuration file version number from0.10.3 to 1.0.0 and recompiled it and the error occurred

If you modify the mesh_lite component without performing other operations and compile directly, an error message will appear

tswen commented 2 months ago

What's the error? Can you provide a screenshot or log file?

yel-best commented 2 months ago

What's the error? Can you provide a screenshot or log file?

Configuring CONFIG_BRIDGE_SOFTAP_SSID TERMINAL_MESH_WIFI

Is it related to Configuring?

#ifdef CONFIG_BRIDGE_SOFTAP_SSID_END_WITH_THE_MAC
                snprintf(softap_ssid, sizeof(softap_ssid), "%.25s_%02x%02x%02x", CONFIG_BRIDGE_SOFTAP_SSID, softap_mac[3], softap_mac[4], softap_mac[5]);
#else
                snprintf(softap_ssid, sizeof(softap_ssid), "%.32s", CONFIG_BRIDGE_SOFTAP_SSID);
#endif
                strncpy((char*)wifi_prov_mgr_mesh_lite_cfg.ssid, softap_ssid, sizeof(wifi_prov_mgr_mesh_lite_cfg.ssid));

image

image

tswen commented 2 months ago

Did you add any compilation options to your project CMakeLists? I can compile it normally without any errors.