Page 1 of 1

General suggestions for ESP mesh functionality

Posted: Thu Jul 12, 2018 1:55 am
by Yanminge
When using espressif‘s esp mesh, although it has a function of
esp_mesh_fix_root
but it still can't be used away from the router. Because in the function

Code: Select all

esp_mesh_set_parent
, the parent configuration, the ssid and the channel of the parent are mandatory. Therefore, in the case of leaving the router, it will trigger the

Code: Select all

MESH_EVENT_PARENT_DISCONNECTED 
event.
But in fact, the mesh network itself can still communicate normally.

Because the root is fixed,So I think the parent of the root is preferably optional. If you offer such a choice, we can build a network system that does not require router. It can extend the application scenario of esp mesh .I really hope to get your official reply.

Re: General suggestions for ESP mesh functionality

Posted: Thu Jul 12, 2018 2:30 am
by ESP_Sprite
Moved to MDF, as it's more relevant there,

Re: General suggestions for ESP mesh functionality

Posted: Thu Jul 19, 2018 9:33 am
by ESP_yudong
Thanks for your suggestions.
And we also have the plan to support non-router network in the near future. Then you could build a network like you said.

More Suggestions are welcome.

Re: General suggestions for ESP mesh functionality

Posted: Fri Jul 27, 2018 8:00 am
by Yanminge
Do you have an expected release plan?
Now I am dealing with this,

Set a parent node that does not exist.

Code: Select all

void wifi_mesh_set_root_parent(void)
{
  wifi_config_t parent =
  {
    .sta =
    {
      .ssid = CONFIG_MESH_ROUTER_SSID,
      .password = CONFIG_MESH_ROUTER_PASSWD,
      .channel = CONFIG_MESH_CHANNEL,
    },
  };
  ESP_ERROR_CHECK(esp_wifi_scan_stop());
  wifi_scan_config_t scan_config = { 0 };
  scan_config.show_hidden = 1;
  ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, 0));
  ESP_ERROR_CHECK(esp_mesh_set_parent(&parent, &mesh_configuration.mesh_id, MESH_ROOT, 1));
and then if event MESH_EVENT_PARENT_DISCONNECTED triggered,still call esp_mesh_comm_p2p_start directly.

Code: Select all

    case MESH_EVENT_PARENT_DISCONNECTED:
      mesh_layer = esp_mesh_get_layer();
      if (esp_mesh_is_root())
      {
        //tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA);
        tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_STA);
      }
      esp_mesh_comm_p2p_start();