Skip to content

Repository files navigation

KTF-MC-Config

A MeshCore serial configuration tool for Windows 7 and later. Plain Win32 API (no MFC), builds with GCC/MinGW-w64, and links statically so the .exe runs on a bare machine with no extra DLLs alongside it.

It talks to the plain-text CLI spoken by MeshCore repeater, room-server, and sensor firmware over a COM port. (Companion firmware — the kind paired with the phone app — has no text CLI and cannot be configured with this tool.)

Build

Native Windows (MSYS2 MinGW64 shell, or a standalone MinGW-w64 install):

mingw32-make

If g++/windres don't resolve via plain mingw32-make, pass full paths explicitly:

mingw32-make CXX=C:\path\to\g++.exe WINDRES=C:\path\to\windres.exe

Cross-compiling from Linux/WSL:

make CXX=x86_64-w64-mingw32-g++ WINDRES=x86_64-w64-mingw32-windres

For a 32-bit build (only needed for 32-bit Windows 7):

make CXX=i686-w64-mingw32-g++ WINDRES=i686-w64-mingw32-windres

Use MinGW-w64 specifically — the old 32-bit-only mingw.org toolchain lacks the modern Win32/commctrl headers this needs.

Build artifacts (*.o, *.exe) are not tracked in git; build from source or download a packaged release.

Using it

  • Pick a COM port and press Connect. The app runs a read-only startup batch and fills the info grid: Name, Board, Ver, Owner, Lat, Lon, Role, Repeat Flag, Freq, Tx Power. Everything else from the startup batch (plus neighbors) goes to the results panel.
  • Commands are grouped one row per category (Operational, Radio, System, Routing, ACL, Region, GPS, Sensors, Bridge, ...): pick a command from the row's combo box, type a parameter if it takes one, and press that row's Send. One command is in flight at a time; rows disable while the startup batch or a manual send is running. The Commands menu selects a command in its category's dropdown without sending it, so parameterized commands get a chance for a value first.
  • The window is resizable; the results panel grows to fill the space.
  • There is no on-screen log: all traffic (sent commands, received lines, echo filtering, timeouts) is appended with timestamps to KTF-MC-Config.log next to the .exe.
  • Help → App Help opens KTF-MC-Config-Help.html in the default browser — keep that file next to the .exe. It covers the app plus a full command reference.

Files

File Purpose
main.cpp Dialog, menus, startup batch, command dispatch, logging
SerialPort.h/.cpp CSerialPort: COM port enumeration (registry), reader thread
CommandTable.h The full MeshCore CLI command set shown in the UI
app.rc, resource.h Dialog template, menus, version info
app.manifest, app.ico Common-controls v6 manifest, application icon
KTF-MC-Config-Help.html End-user help + command reference (ship next to the .exe)
Makefile MinGW-w64 build, native or cross

Maintenance notes

  • CommandTable.h follows the MeshCore CLI command reference (https://docs.meshcore.io/cli_commands/). When firmware commands change, edit it and regenerate the Commands menu in app.rc and the reference table in KTF-MC-Config-Help.html to match — they are not derived automatically at build time.
  • SerialPort.cpp deliberately uses plain synchronous ReadFile/WriteFile with short COMMTIMEOUTS, not overlapped I/O. This is the variant confirmed working and responsive on real hardware; don't switch it back to overlapped I/O without testing on a device.
  • The startup batch is not paced by a fixed delay: MeshCore echoes the command before replying and its response time varies, so main.cpp uses a settle timer (restarted on every received line) plus a safety-net timeout per command.
  • app.ico is a placeholder, not the official MeshCore logo. To replace it: download https://cdn.jsdelivr.net/gh/selfhst/icons/svg/meshcore.svg, convert to a multi-resolution .ico (at least 16/32/48/256 px — e.g. magick meshcore.svg -define icon:auto-resize=16,32,48,256 app.ico), overwrite app.ico, and rebuild (the icon is baked in at build time).

Cross-platform port

A Go reimplementation of this tool — same command catalog, native GUI on Windows/macOS/Linux plus browser and headless CLI modes — lives at https://github.com/zfouts/k5ktf-mesh.

License

GPLv3 — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages