Fix Can sniffer functionality (#18287)

This commit is contained in:
Theo Arends
2026-07-28 10:49:59 +02:00
parent 2eda5214cf
commit 3725d6eb47
3 changed files with 6 additions and 11 deletions
+1
View File
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- Library `PubSubClient` renamed to `TasmotaPubSub`, hardening fixes and comprehensive non-regression tests (#24916)
### Fixed
- Can sniffer functionality (#18287)
### Removed
+1
View File
@@ -130,6 +130,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- Default button/switch actions on builds without rules regression from v15.4.0.2 [#24871](https://github.com/arendst/Tasmota/issues/24871)
- PZEM/Modbus energy monitor Exception crash-loop on ESP8266 regression from v15.5.0 [#24883](https://github.com/arendst/Tasmota/issues/24883)
- Can sniffer functionality [#18287](https://github.com/arendst/Tasmota/issues/18287)
- Udisp SPI for mono color display [#24899](https://github.com/arendst/Tasmota/issues/24899)
- BLE EQ3 float output in mqtt messages regression from v15.4.0.2 [#24869](https://github.com/arendst/Tasmota/issues/24869)
@@ -119,7 +119,7 @@ void MCP2515_FrameSizeError(uint8_t len, uint32_t id) {
void MCP2515_Init(void) {
if (PinUsed(GPIO_MCP2515_CS, GPIO_ANY) && TasmotaGlobal.spi_enabled) {
mcp2515 = new MCP2515(5);
mcp2515 = new MCP2515(Pin(GPIO_MCP2515_CS, GPIO_ANY));
if (MCP2515::ERROR_OK != mcp2515->reset()) {
AddLog(LOG_LEVEL_INFO, PSTR("CAN: Failed to reset module"));
return;
@@ -132,7 +132,8 @@ void MCP2515_Init(void) {
AddLog(LOG_LEVEL_INFO, PSTR("CAN: Failed to set normal mode"));
return;
}
AddLog(LOG_LEVEL_INFO, PSTR("CAN: Sniffer Initialized"));
AddLog(LOG_LEVEL_INFO, PSTR("CAN: Sniffer Initialized on GPIO%d"), Pin(GPIO_MCP2515_CS, GPIO_ANY));
Mcp2515.init_status = 1;
}
}
@@ -205,15 +206,7 @@ bool Xsns87(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kCanCommands, CanCommand);
break;
case FUNC_JSON_APPEND:
// MCP2515_Show(1);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
// MCP2515_Show(0);
break;
#endif // USE_WEBSERVER
}
}
}
return result;
}