Meck-P4 v0.7.1: Keyboard Support #13
pelgraine
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This release brings full support for the *LilyGo T-Display-P4-Keyboard (K270)* -- physical typing across the whole UI, a brightness-controlled key backlight, and a second battery gauge column for the keyboard's 21700 pack -- together with a markdown Notes app, and a set of fixes to channel message history, WiFi companion recovery, and idle power draw.
It supersedes v0.7, which was never published. If you are coming from v0.6.5, everything below is new to you.
First-Time Flashing: Read This First
Meck-P4 ships as a single merged binary (bootloader + partition table + application combined). One file, flash at offset
0x0.Keyboard support is a build-time board type, not a runtime setting. A build made for the plain T-Display P4 ignores an attached K270 keyboard entirely, and a keyboard build runs correctly on a bare board -- it probes for the keyboard at boot and falls back to the on-screen keyboard when none answers. Download the image that matches your hardware.
Ensure you use the right-side USB-C port (the data port), not the high-speed charger port, to flash.
Flashing with the MeshCore Web Flasher (recommended)
.binfile you downloadedFlashing with esptool.py
(Replace
PORTwith/dev/cu.usbmodemXXXXon macOS,/dev/ttyACM0on Linux, orCOM3on Windows.)Upgrading from v0.6.5 does not require
erase_flash. Your existing settings carry over -- the one new preference (keyboard backlight level) is appended to the end of the prefs blob, and older blobs come up short and fall back to the 25% default. Channel message history is the exception: the old slot-keyed history files are purged once on first boot, for the reason described under Fixes below.What's New Since v0.6.5
T-Display-P4-Keyboard (K270) support
The K270 keyboard is now fully supported. Meck talks to it directly -- an XL9555 I/O expander at
0x20and a TCA8418 keypad scanner at0x34, on a bit-banged I2C bus off the 1x4 P2 connector -- and polls the key FIFO from a 30 ms timer rather than the interrupt line, which keeps the driver clear of GPIO 47/48 and avoids a second GPIO ISR service alongside the radio's.Keystrokes go to whatever text field is focused on the current screen. Meck walks the active screen for a focused text area rather than consulting a fixed list, so every field in the firmware is covered: message composers, settings, channel and region editors, WiFi, trace and path editors, repeater admin, the web reader's URL and search bars, and the Notes editor.
Important: always power both halves down before joining or separating them -- P4 off, keyboard off, cells in, attach, keyboard on. See the README for the full procedure.
Keyboard backlight, with brightness control
The LilyGo key toggles the key backlight. It sits between Fn and Shift and produces no character.
Settings -> Keyboard Backlight is a new slider, 5% to 100%, defaulting to 25%. Dragging applies the level live and the value is saved when you release. The setting appears on keyboard builds only.
The backlight is driven with 20 kHz LEDC PWM rather than a plain high level: full drive measured about +1 A of extra pack draw, against roughly 398 mA at the 25% default.
The backlight also no longer comes up lit. LilyGo's boot code ran a PWM ramp that made it look like a hardware default; it was firmware, and it was a standing current draw on a battery device. It is now off after every boot until you press the LilyGo key.
Keyboard battery gauge
The Battery tile gains a second column, headed KBD, for the keyboard's 21700 pack.
There is only one fuel gauge in the system -- the P4's BQ27220 -- and the keyboard's selector switch puts exactly one battery on the rail at a time, with no way for firmware to tell which. So Meck asks you to declare the switch position instead of pretending to sense it:
While the pack is selected, the chip's own state-of-charge is ignored -- its coulomb counter is referenced against the internal cell's 1000 mAh design capacity and is meaningless for a 21700. Percentage comes from the voltage curve instead, and Rem is declared-capacity arithmetic, so both are marked
~ est.on screen. Time-to-empty is estimated from present discharge current and shown only while actually discharging. Voltage and current remain direct gauge readings.Also new on the Battery tile for every build: a Gauge temp row showing the BQ27220's raw
Temperature()register -- the value the chip is actually using for its CEDV maths, which is not always what the die-temperature row reports.Notes: markdown
The Notes app now reads and writes markdown.
.md. Both.mdand.txtare listed, and the files stay plain text, so they open correctly in any editor off-device..mdnotes render whole-file into a single scrolling markdown view..txtnotes keep the original paged reader, tap zones and progress percentage, unchanged.#->##->###), bullet toggle, indent and outdent by two spaces, and a live preview toggle..mdnote cannot turn it into a.txt.The renderer is a deliberate subset --
#/##/###headings,-bullets, preserved indentation, and inline**bold**/*italic*-- so anything it does not know renders literally and the file stays readable as plain text.Six new font faces ship for this: Montserrat bold and italic at 22, 24 and 28. Heading and body sizes follow your Settings -> Font Size preference (Classic / Larger / Extra Large), chosen fresh each time the view is drawn.
Fixes
Channel message history is now keyed by channel identity, not slot index. History files were named
ch_<slot>.bin, so any reshuffle of the channel table -- delete-and-compact, a companion-app rewrite, a config import -- could leave a channel showing the previous occupant's messages. Files are now keyed by a hash of the channel secret, so history follows the channel through any reshuffle.Because the old layout gives no way to tell whether a legacy file's contents actually belong to the channel now at that slot, the old
ch_<N>.binfiles are purged once on upgrade rather than migrated. Existing channel history is cleared by this release; new messages accumulate normally from first boot.Deleting a channel now deletes its history, instead of leaving a file the next channel in that slot could inherit.
Companion channel writes reload correctly. When the app writes a different channel into an occupied slot, the message ring is reloaded for the new occupant instead of inheriting the previous one's messages.
WiFi companion recovers from a wedged C6 link. Bulk companion traffic -- contact import or delete storms -- could wedge the ESP32-C6's SDIO transmit path: receive kept working, but every AT command afterwards died the same way, including the disable and enable that toggling WiFi issues. Only a reboot cleared it. Meck now detects the signature, tears down interface state without attempting AT traffic, pulses the C6 enable line and re-initialises SDIO and AT, then reconnects with your stored credentials. Three attempts, and toggling WiFi in Settings re-arms the counter.
Keystrokes no longer go missing on the keyboard build. LilyGo's boot code registered an LVGL keypad input device reading the same TCA8418 event FIFO that Meck's own driver reads. Whichever ran first in a given cycle popped the event and the other saw nothing. There is now a single reader.
Smaller changes
Known Limitations
MECK_CARDKBbuild definition was removed when the K270 driver landed, so the M5Stack CardKB path is currently compiled out of both board types.For the full feature list see the README.
Reporting Issues
The Meck-P4 channel on the MeshCore Discord is the fastest path. GitHub Issues on the Meck-P4 repo also work for anything reproducible. Include the serial log if you can: Settings > Debug Logs > Start captures it to SD if a serial monitor isn't practical.
License
MIT for Meck-specific code. The combined firmware binary links libraries with mixed licensing including GPL-3.0 and LGPL-2.1 (Codec2) and is effectively GPL-3.0 when distributed.
This discussion was created from the release Meck-P4 v0.7.1: Keyboard Support.
All reactions