wifi begin is needed to get MAC address (#23011)

This commit is contained in:
Jason2866 2025-02-16 12:42:14 +01:00 committed by GitHub
parent c39a7d924a
commit cb333a5a38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -422,6 +422,7 @@ void MESHstartNode(int32_t _channel, uint8_t _role){ //we need a running broker
void MESHstartBroker(void) { // Must be called after WiFi is initialized!! Rule - on system#boot do meshbroker endon void MESHstartBroker(void) { // Must be called after WiFi is initialized!! Rule - on system#boot do meshbroker endon
#ifdef ESP32 #ifdef ESP32
WiFi.mode(WIFI_AP_STA); WiFi.mode(WIFI_AP_STA);
WiFi.AP.begin();
AddLog(LOG_LEVEL_INFO, PSTR("MSH: Broker MAC %s"), WiFi.softAPmacAddress().c_str()); AddLog(LOG_LEVEL_INFO, PSTR("MSH: Broker MAC %s"), WiFi.softAPmacAddress().c_str());
WiFi.softAPmacAddress(MESH.broker); //set MESH.broker to the needed MAC WiFi.softAPmacAddress(MESH.broker); //set MESH.broker to the needed MAC
uint32_t _channel = WiFi.channel(); uint32_t _channel = WiFi.channel();