Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasmesh broker MAC address is 00:00:00:00:00:00 #23005

Closed
14 of 15 tasks
rguca opened this issue Feb 14, 2025 · 4 comments
Closed
14 of 15 tasks

Tasmesh broker MAC address is 00:00:00:00:00:00 #23005

rguca opened this issue Feb 14, 2025 · 4 comments

Comments

@rguca
Copy link

rguca commented Feb 14, 2025

PROBLEM DESCRIPTION

I created a rule to enable tasmesh broker on boot but it seems to have problems with getting the mac address:

15:34:41.621 RUL: SYSTEM#BOOT performs 'meshbroker'
15:34:41.628 MSH: Broker MAC 00:00:00:00:00:00
15:34:41.631 RSL: RESULT = {"MeshBroker":7}

if i disable the rule, restart and execute the cmd manually over web console, its the same. wifi is clearly up an running here:

15:48:25.900 CMD: meshbroker
15:48:25.906 MSH: Broker MAC 00:00:00:00:00:00
15:48:25.910 RSL: RESULT = {"MeshBroker":7}

If the command is executed a second time, the MAC is correct:

Image

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Problem is not scripter related, in this case open a discussion and tag @gemu2015
  • Device used (e.g., Sonoff Basic): esp32 devkit
  • Tasmota binary firmware version number used: 14.4.1.4(tasmota32)-3_1_1(2025-02-14T17:03:37)
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: platformio
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
17:42:22.151 RSL: RESULT = {"NAME":"ESP32-DevKit","GPIO":[1,1,288,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
17:42:22.381 RSL: RESULT = {"Module":{"0":"ESP32-DevKit"}}
17:42:22.589 RSL: RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"0":"None"},"GPIO2":{"288":"Led1"},"GPIO3":{"0":"None"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO6":{"0":"None"},"GPIO7":{"0":"None"},"GPIO8":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO11":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"},"GPIO18":{"0":"None"},"GPIO19":{"0":"None"},"GPIO20":{"0":"None"},"GPIO21":{"0":"None"},"GPIO22":{"0":"None"},"GPIO23":{"0":"None"},"GPIO24":{"0":"None"},"GPIO25":{"0":"None"},"GPIO26":{"0":"None"},"GPIO27":{"0":"None"},"GPIO32":{"0":"None"},"GPIO33":{"0":"None"},"GPIO34":{"0":"None"},"GPIO35":{"0":"None"},"GPIO36":{"0":"None"},"GPIO37":{"0":"None"},"GPIO38":{"0":"None"},"GPIO39":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:
17:43:06.234 RSL: RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":34,"Free":477,"Rules":"on system#boot do meshbroker endon"}}
17:43:06.471 RSL: RESULT = {"Rule2":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
17:43:06.675 RSL: RESULT = {"Rule3":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
  • Provide the output of this command: Status 0:
  STATUS 0 output here:
17:43:31.213 RSL: STATUS = {"Status":{"Module":0,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"tasmota_B824AD","ButtonTopic":"0","Power":"0","PowerLock":"0","PowerOnState":3,"LedState":0,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
17:43:31.246 RSL: STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota32/release/tasmota32.bin","RestartReason":"Vbat power on reset","Uptime":"0T00:00:52","StartupUTC":"2025-02-14T16:42:39","Sleep":50,"CfgHolder":4617,"BootCount":13,"BCResetTime":"2025-02-14T14:54:27","SaveCount":27}}
17:43:31.280 RSL: STATUS2 = {"StatusFWR":{"Version":"14.4.1.4(tasmota32)","BuildDateTime":"2025-02-14T17:03:37","Core":"3_1_1","SDK":"5.3.2.250120","CpuFrequency":160,"Hardware":"ESP32-D0WDQ6 v1.0","CR":"409/699"}}
17:43:31.303 RSL: STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"FileLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["WLAN",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C80001000600003C5A0A192800000000","00000080","00006000","00004000","00000000"]}}
17:43:31.343 RSL: STATUS4 = {"StatusMEM":{"ProgramSize":2055,"Free":824,"Heap":140,"StackLowMark":3,"PsrMax":0,"PsrFree":0,"ProgramFlashSize":4096,"FlashSize":4096,"FlashChipId":"164020","FlashFrequency":40,"FlashMode":"DIO","Features":["0809","9F9AD7DF","0015A001","B7F7BFCF","05DA9BC4","E0360DC7","480840D2","20200000","D4BC4A2D","810A80F1","00000814"],"Drivers":"1,2,!3,!4,!5,7,!8,9,10,11,12,!14,!16,!17,!20,!21,!24,26,!27,29,!34,!35,38,50,52,!57,!59,!60,62,!63,!66,!67,!68,!73,!75,82,!86,!87,!88,!91,!121","Sensors":"1,2,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,26,31,34,37,39,40,42,43,45,51,52,55,56,58,59,64,66,67,74,85,92,95,98,103,105,109,127","I2CDriver":"7,8,9,10,11,12,13,14,15,17,18,20,24,29,31,36,41,42,44,46,48,58,62,65,69,76,77,82,89"}}
17:43:31.409 RSL: STATUS5 = {"StatusNET":{"Hostname":"tasmota-B824AD-1197","IPAddress":"192.168.1.143","Gateway":"192.168.1.5","Subnetmask":"255.255.255.0","DNSServer1":"192.168.1.5","DNSServer2":"0.0.0.0","Mac":"B4:E6:2D:B8:24:AD","IP6Global":"","IP6Local":"fe80::b6e6:2dff:feb8:24ad%st1","SoftAPMac":"00:00:00:00:00:00","Ethernet":{"Hostname":"","IPAddress":"0.0.0.0","Gateway":"0.0.0.0","Subnetmask":"0.0.0.0","DNSServer1":"192.168.1.5","DNSServer2":"0.0.0.0","Mac":"00:00:00:00:00:00","IP6Global":"","IP6Local":""},"Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":16.0}}
17:43:31.453 RSL: STATUS6 = {"StatusMQT":{"MqttHost":"","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_B824AD","MqttUser":"DVES_USER","MqttCount":0,"MqttTLS":0,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
17:43:31.477 RSL: STATUS7 = {"StatusTIM":{"UTC":"2025-02-14T16:43:31Z","Local":"2025-02-14T17:43:31","StartDST":"2025-03-30T02:00:00","EndDST":"2025-10-26T03:00:00","Timezone":"+01:00","Sunrise":"07:59","Sunset":"18:08"}}
17:43:31.503 RSL: STATUS10 = {"StatusSNS":{"Time":"2025-02-14T17:43:31"}}
17:43:31.509 RSL: STATUS11 = {"StatusSTS":{"Time":"2025-02-14T17:43:31","Uptime":"0T00:00:52","UptimeSec":52,"Heap":138,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"Berry":{"HeapUsed":4,"Objects":45},"Wifi":{"AP":1,"SSId":"WLAN","BSSId":"D8:07:B6:4F:3A:3B","Channel":7,"Mode":"HT40","RSSI":36,"Signal":-82,"LinkCount":1,"Downtime":"0T00:00:04"}}}
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:
17:44:17.284 CMD: meshbroker
17:44:17.285 SRC: WebConsole from 192.168.1.123
17:44:17.288 CMD: Grp 0, Cmd 'MESHBROKER', Idx 1, Len 0, Pld -99, Data ''
17:44:17.294 MSH: Broker MAC 00:00:00:00:00:00
17:44:17.298 MSH: set crypto key to PASSWORD1
17:44:17.300 RSL: RESULT = {"MeshBroker":7}
17:44:22.942 WIF: Checking connection...
17:44:27.228 CMD: meshbroker
17:44:27.230 SRC: WebConsole from 192.168.1.123
17:44:27.232 CMD: Grp 0, Cmd 'MESHBROKER', Idx 1, Len 0, Pld -99, Data ''
17:44:27.237 MSH: Broker MAC B4:E6:2D:B8:24:AE
17:44:27.250 MSH: set crypto key to PASSWORD1
17:44:27.252 RSL: RESULT = {"MeshBroker":7}

TO REPRODUCE

execute meshbroker cmd after boot in web console

EXPECTED BEHAVIOUR

the MAC is correct on first execution of command

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

This was discussed on discord and a user confirmed this.
https://discord.com/channels/479389167382691863/490244847568158751/1339969468029337641

(Please, remember to close the issue when the problem has been addressed)

@rguca
Copy link
Author

rguca commented Feb 14, 2025

Maybe the issue is the AP interface is not started yet like described here: espressif/arduino-esp32#9509

WiFi.mode(WIFI_AP_STA);
AddLog(LOG_LEVEL_INFO, PSTR("MSH: Broker MAC %s"), WiFi.softAPmacAddress().c_str());

@rguca
Copy link
Author

rguca commented Feb 14, 2025

I duplicated the log line:

WiFi.mode(WIFI_AP_STA);
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());

The result:

18:47:33.471 CMD: meshbroker
18:47:33.479 MSH: Broker MAC 00:00:00:00:00:00
18:47:33.480 MSH: Broker MAC B4:E6:2D:B8:24:AE
18:47:33.485 RSL: RESULT = {"MeshBroker":7}

@rguca
Copy link
Author

rguca commented Feb 14, 2025

This seems to fix it:

WiFi.mode(WIFI_AP_STA);
WiFi.AP.begin();
AddLog(LOG_LEVEL_INFO, PSTR("MSH: Broker MAC %s"), WiFi.softAPmacAddress().c_str());

Result:

19:07:02.454 CMD: meshbroker
19:07:02.464 MSH: Broker MAC B4:E6:2D:B8:24:AE
19:07:02.469 RSL: RESULT = {"MeshBroker":7}

@Jason2866
Copy link
Collaborator

@rguca Looks like a valid fix. Have you checked / seen side effects? I think no, but who knows?

Can you open a PR with your suggested changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants