Moin Reinder,
the problem with the non-existent `<format>` under Debian 12 is annoying. Now I have to modify another file
I’ve now made these changes. You don’t want that in the code, but couldn’t we just implement it in the CBUS branch?
CMakeLists.txt:
# Debian 12 has no <format> so switch to fmt
+ include(CheckCXXSourceCompiles)
+ check_cxx_source_compiles("
+ #include <format>
+ int main() { auto s = std::format(\"{}\", 1); }
+ " HAS_STD_FORMAT)
+
+ if(NOT HAS_STD_FORMAT)
+ set(USE_FMT ON)
+ endif()
+
+ if(USE_FMT)
+ find_package(fmt REQUIRED)
+ target_link_libraries(traintastic-server PRIVATE fmt::fmt)
+ target_compile_definitions(traintastic-server PRIVATE USE_FMT)
+ target_link_libraries(traintastic-server-test PRIVATE fmt::fmt)
+ target_compile_definitions(traintastic-server-test PRIVATE USE_FMT)
+ endif()
+ # Debian 12 end
cbusnodelisttablemodel.cpp:
/* Debian 12 has no <format> */
#ifdef USE_FMT
#include <fmt/core.h>
namespace std {
using fmt::format;
}
#else
#include <format>
#endif
cbustostring.cpp
/* Debian 12 has no <format> */
#ifdef USE_FMT
#include <fmt/core.h>
namespace std {
using fmt::format;
}
#else
#include <format>
#endif
So cmake uses always fmt if format is not present. However, everyone using Debian 12 or a distro like MX Linux based on Debian 12 must have this problem.
I enabled the CANCMDB to send every 5s the track current.
The current mulitplier is 50.
With JMRI it looks like that:
JMRI < < CBUS | ACON2 NN:65534 EN:1 Data: 0 50 Long Event On Ex2
JMRI < < CBUS | DFUN Session: 1 Range: 1 Fn 18 Set Engine Functions
JMRI < < CBUS | ACON2 NN:65534 EN:1 Data: 0 50 Long Event On Ex2
The message from CANCMDB is a ACON2 with 2 bytes. So I think, the current is 50 x 50 = 250mA. This test I have done with a Roco BR93, ESU LokSound 5. I think the power consumption should be about right. I think the power consumption should be about right; but to really know, I would need to take a resistor and check the current with a multimeter.
With Traintastic (shorten):
2026-03-25 23:33:16.323752 cbus_1 D2002: RX: DSPD session=1 speed=127 direction=fwd [47 01 FF]
2026-03-25 23:33:16.506005 cbus_1 D2002: RX: DSPD session=1 speed=127 direction=fwd [47 01 FF]
2026-03-25 23:33:16.972127 cbus_1 D2002: RX: [D0 FF FE 00 01 02 26]
2026-03-25 23:33:17.780142 cbus_1 D2002: RX: DSPD session=1 speed=79 direction=fwd [47 01 CF]
2026-03-25 23:33:17.837398 cbus_1 D2002: RX: DSPD session=1 speed=75 direction=fwd [47 01 CB]
2026-03-25 23:33:18.139440 cbus_1 D2002: RX: DKEEP session=1 [23 01]
2026-03-25 23:33:18.977122 cbus_1 D2002: RX: DSPD session=1 speed=21 direction=fwd [47 01 95]
2026-03-25 23:33:19.454272 cbus_1 D2002: RX: DSPD session=1 speed=20 direction=fwd [47 01 94]
2026-03-25 23:33:19.466817 cbus_1 D2002: RX: [D0 FF FE 00 01 00 C8]
2026-03-25 23:33:19.618797 cbus_1 D2002: RX: DSPD session=1 speed=8 direction=fwd [47 01 88]
2026-03-25 23:33:19.683686 cbus_1 D2002: RX: DSPD session=1 speed=4 direction=fwd [47 01 84]
2026-03-25 23:33:19.764674 cbus_1 D2002: RX: DSPD session=1 speed=0 direction=fwd [47 01 80]
2026-03-25 23:33:19.878802 cbus_1 D2002: RX: DSPD session=1 speed=0 direction=fwd [47 01 80]
2026-03-25 23:33:21.961649 cbus_1 D2002: RX: [D0 FF FE 00 01 00 00]
2026-03-25 23:33:22.333192 cbus_1 D2002: RX: DKEEP session=1 [23 01]
2026-03-25 23:33:24.456458 cbus_1 D2002: RX: [D0 FF FE 00 01 00 00]
The last two bytes are the current. I’m not sure how to convert that. Since I only have estimated values for the loco, I’ll probably have to measure it properly with some power resistory, I should have enough here .
Greetings, Tom