mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 09:37:21 +02:00
Append id to wifi ssid
This commit is contained in:
@@ -186,20 +186,18 @@ int WifiManager::init_softap() {
|
|||||||
|
|
||||||
esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, this);
|
esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, this);
|
||||||
|
|
||||||
wifi_config_t wifi_configuration = {
|
std::string ap_ssid = std::string("botchain") + std::to_string(m_config_manager.get_module_id());
|
||||||
.ap =
|
|
||||||
{
|
wifi_config_t wifi_configuration = {};
|
||||||
.ssid = WIFI_SSID,
|
wifi_configuration.ap.channel = SOFTAP_CHANNEL;
|
||||||
.password = "",
|
wifi_configuration.ap.authmode = WIFI_AUTH_OPEN;
|
||||||
.channel = SOFTAP_CHANNEL,
|
wifi_configuration.ap.ssid_hidden = 0;
|
||||||
.authmode = WIFI_AUTH_OPEN,
|
wifi_configuration.ap.max_connection = SOFTAP_MAX_CONNECTIONS;
|
||||||
.ssid_hidden = 0,
|
wifi_configuration.ap.beacon_interval = 100;
|
||||||
.max_connection = SOFTAP_MAX_CONNECTIONS,
|
wifi_configuration.ap.csa_count = 3;
|
||||||
.beacon_interval = 100,
|
wifi_configuration.ap.dtim_period = 1;
|
||||||
.csa_count = 3,
|
std::strncpy(reinterpret_cast<char *>(wifi_configuration.ap.ssid), ap_ssid.c_str(), sizeof(wifi_configuration.ap.ssid) - 1);
|
||||||
.dtim_period = 1,
|
wifi_configuration.ap.ssid_len = static_cast<uint8_t>(ap_ssid.size());
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
esp_wifi_set_mode(WIFI_MODE_APSTA); // enable both ap and station mode for scanning
|
esp_wifi_set_mode(WIFI_MODE_APSTA); // enable both ap and station mode for scanning
|
||||||
esp_wifi_set_config(static_cast<wifi_interface_t>(ESP_IF_WIFI_AP), &wifi_configuration);
|
esp_wifi_set_config(static_cast<wifi_interface_t>(ESP_IF_WIFI_AP), &wifi_configuration);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "enums.h"
|
||||||
#include "flatbuffers_generated/RobotModule_generated.h"
|
#include "flatbuffers_generated/RobotModule_generated.h"
|
||||||
#if !defined(RMT_TEST) || (defined(RMT_TEST) && RMT_TEST == 0)
|
#if !defined(RMT_TEST) || (defined(RMT_TEST) && RMT_TEST == 0)
|
||||||
// #include <cstdio>
|
// #include <cstdio>
|
||||||
@@ -18,6 +19,7 @@ extern "C" [[noreturn]] void app_main(void) {
|
|||||||
ESP_LOGI("MEM", "Free PSRAM: %d", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
ESP_LOGI("MEM", "Free PSRAM: %d", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||||
|
|
||||||
auto& config_manager = ConfigManager::get_instance(); // NOLINT - here for easily adding temporary config
|
auto& config_manager = ConfigManager::get_instance(); // NOLINT - here for easily adding temporary config
|
||||||
|
config_manager.set_communication_method(CommunicationMethod::Wireless);
|
||||||
|
|
||||||
esp_log_set_vprintf(RemoteDebugging::custom_log_write);
|
esp_log_set_vprintf(RemoteDebugging::custom_log_write);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user