Skip to content

Commit

Permalink
Remove logging from safeboot (#22464)
Browse files Browse the repository at this point in the history
* Remove logging from safeboot

* Remove logs from Status 5
  • Loading branch information
s-hadinger authored Nov 11, 2024
1 parent 448ca1c commit 343d9b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasmota/tasmota_support/support_a_spi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SPIClass *SpiBegin(uint32 bus) {
/********************************************************************************************/

void AddLogSpi(uint32_t hardware, int clk, int mosi, int miso) {
#ifndef FIRMWARE_MINIMAL
uint32_t enabled = TasmotaGlobal.soft_spi_enabled;
char hwswbus[8];
if (hardware) {
Expand Down Expand Up @@ -72,4 +73,5 @@ void AddLogSpi(uint32_t hardware, int clk, int mosi, int miso) {
hwswbus, clk, mosi, miso);
break;
}
#endif // FIRMWARE_MINIMAL
}
2 changes: 2 additions & 0 deletions tasmota/tasmota_support/support_command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,9 @@ void CmndStatus(void)

if ((0 == payload) || (5 == payload)) {
#ifdef USE_IPV6
#ifndef FIRMWARE_MINIMAL
if (5 == payload) { WifiDumpAddressesIPv6(); }
#endif // FIRMWARE_MINIMAL
Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS5_NETWORK "\":{\"" D_CMND_HOSTNAME "\":\"%s\",\""
D_CMND_IPADDRESS "\":\"%_I\",\"" D_JSON_GATEWAY "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\",\""
D_JSON_DNSSERVER "1\":\"%s\",\"" D_JSON_DNSSERVER "2\":\"%s\",\""
Expand Down
8 changes: 8 additions & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ void EthernetEvent(arduino_event_t *event) {
}
TasmotaGlobal.rules_flag.eth_connected = 1;
TasmotaGlobal.global_state.eth_down = 0;
#ifndef FIRMWARE_MINIMAL
AddLog(LOG_LEVEL_DEBUG, PSTR("ETH: IPv4 %_I, mask %_I, gateway %_I"),
event->event_info.got_ip.ip_info.ip.addr,
event->event_info.got_ip.ip_info.netmask.addr,
event->event_info.got_ip.ip_info.gw.addr);
#endif // FIRMWARE_MINIMAL
WiFiHelper::scrubDNS(); // internal calls to reconnect can zero the DNS servers, save DNS for future use
break;

Expand All @@ -181,9 +183,11 @@ void EthernetEvent(arduino_event_t *event) {
ip_addr_t ip_addr6;
ip_addr_copy_from_ip6(ip_addr6, event->event_info.got_ip6.ip6_info.ip);
IPAddress addr(&ip_addr6);
#ifndef FIRMWARE_MINIMAL
AddLog(LOG_LEVEL_DEBUG, PSTR("%s: IPv6 %s %s"),
event->event_id == ARDUINO_EVENT_ETH_GOT_IP6 ? "ETH" : "WIF",
IPv6isLocal(addr) ? PSTR("Local") : PSTR("Global"), addr.toString().c_str());
#endif // FIRMWARE_MINIMAL
if (!IPv6isLocal(addr)) { // declare network up on IPv6
TasmotaGlobal.rules_flag.eth_connected = 1;
TasmotaGlobal.global_state.eth_down = 0;
Expand Down Expand Up @@ -235,13 +239,17 @@ void EthernetInit(void) {
if (eth_uses_spi) {
// Uses SPI Ethernet and needs at least SPI CS being ETH MDC
if (!PinUsed(GPIO_ETH_PHY_MDC)) {
#ifndef FIRMWARE_MINIMAL
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_ETH "No ETH MDC as SPI CS GPIO defined"));
#endif // FIRMWARE_MINIMAL
return;
}
} else {
// Native ESP32
if (!PinUsed(GPIO_ETH_PHY_MDC) && !PinUsed(GPIO_ETH_PHY_MDIO)) { // && should be || but keep for backward compatibility
#ifndef FIRMWARE_MINIMAL
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_ETH "No ETH MDC and ETH MDIO GPIO defined"));
#endif // FIRMWARE_MINIMAL
return;
}
}
Expand Down

0 comments on commit 343d9b9

Please sign in to comment.