Some final adjustments

This commit is contained in:
Gunnar Skjold 2024-08-06 20:51:02 +02:00
parent de63263dbb
commit 569a0ddfaa
7 changed files with 33 additions and 4 deletions

View File

@ -19,12 +19,25 @@ void KmpCommunicator::configure(MeterConfig& meterConfig) {
bool KmpCommunicator::loop() {
uint64_t now = millis64();
bool ret = talker->loop();
int lastError = getLastError();
if(ret) {
#if defined(AMS_REMOTE_DEBUG)
if (debugger->isActive(RemoteDebug::VERBOSE))
#endif
debugger->printf_P(PSTR("Successful loop\n"));
Serial.flush();
} else if(lastError < 0 && lastError != DATA_PARSE_INCOMPLETE) {
#if defined(AMS_REMOTE_DEBUG)
if (debugger->isActive(RemoteDebug::DEBUG))
#endif
debugger->printf_P(PSTR("Error code: %d\n"), getLastError());
#if defined(AMS_REMOTE_DEBUG)
if (debugger->isActive(RemoteDebug::VERBOSE))
#endif
{
debugger->printf_P(PSTR(" payload:\n"));
debugPrint(hanBuffer, 0, hanBufferSize);
}
}
return ret;
}

View File

@ -38,7 +38,7 @@ platform = https://github.com/tasmota/platform-espressif32/releases/download/202
framework = arduino
board = esp32dev
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} -D AMS_REMOTE_DEBUG=1
build_flags = ${common.build_flags}
lib_ldf_mode = off
lib_compat_mode = off
lib_deps = ${esp32.lib_deps}
@ -57,7 +57,12 @@ board_build.variant = esp32s2
board_build.flash_mode = qio
board_build.f_cpu = 160000000L
board_build.f_flash = 40000000L
build_flags = ${common.build_flags} -D AMS_REMOTE_DEBUG=1
build_flags =
${common.build_flags}
-D AMS_REMOTE_DEBUG=1
-D AMS_KMP=1
-L precompiled/esp32s2
-lKmpTalker
lib_ldf_mode = off
lib_compat_mode = off
lib_deps = ${esp32.lib_deps}
@ -69,7 +74,13 @@ platform = https://github.com/tasmota/platform-espressif32/releases/download/202
framework = arduino
board = esp32-solo1
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} -DFRAMEWORK_ARDUINO_SOLO1 -D AMS_REMOTE_DEBUG=1
build_flags =
${common.build_flags}
-DFRAMEWORK_ARDUINO_SOLO1
-D AMS_REMOTE_DEBUG=1
-D AMS_KMP=1
-L precompiled/esp32
-lKmpTalker
lib_ldf_mode = off
lib_compat_mode = off
lib_deps = ${esp32.lib_deps}
@ -93,7 +104,12 @@ platform = https://github.com/tasmota/platform-espressif32/releases/download/202
framework = arduino
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags = ${common.build_flags} -D AMS_REMOTE_DEBUG=1
build_flags =
${common.build_flags}
-D AMS_REMOTE_DEBUG=1
-D AMS_KMP=1
-L precompiled/esp32s3
-lKmpTalker
lib_ldf_mode = off
lib_compat_mode = off
lib_deps = ${esp32.lib_deps}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.