| peter | Posted: 13 Apr 2026, 02:22 PM |
|---|---|
|
Member Posts: 14 Joined: 10-September 22 |
Precision Clock Companion (PCC) A browser app for the Precision Clock Mk IV. It drives a real clock over Web Serial, and with no clock attached it is one: the on-screen clock is the clock4 firmware compiled to WebAssembly, not an imitation of it. ▶ Open PCC (beta) · GitHub Anyone can open it and explore. To drive a clock: Chrome, Edge or Brave over Web Serial, or any browser with pccd. What's in it - FACE: every display mode, text and countdowns, brightness curves, config.txt through the firmware's own parser - SKY: polar plot with signal heatmap, world map and 3D globe, signal and position analysis; history persists and exports - TIMING: PPS phase and jitter, oscillator drift, Allan deviation, and a temperature-compensation fit that writes the tc_* lines for config.txt - DEVICE: connect, config.txt editing, REST data onto the date row, firmware provenance, serial monitor pccd (optional): a small background program for macOS and Linux. It works in any browser, records the clock while no tab is open, reads and writes the CLOCK drive, and can feed chrony. Install Firmware: PCC works with a stock clock. The face runs my extended firmware, so you can try it before you flash it. Details in the next post. The old macOS app is preserved on the macos-app branch. Beta: here be bugs :) Feedback welcome here or on GitHub. Built with Claude Code. Independent project, not affiliated with mitxela. Last edit by peter at 17 Nov 2026, 12:46 PM ------------- |
| [top] | |
| peter | Posted: 13 Apr 2026, 02:22 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Extended firmware: time board 0.0.5 · date board 0.0.2 mitxela's Mk IV firmware, extended. Released by date: the version numbers stay put while it's in development, and I'll post here when there's a new release. ⬇ Latest release · What's in it · Manual · Try it in your browser Everything it adds is off until you switch it on, in config.txt or the menu. On a stock config.txt it behaves as stock, apart from the fixes below. (The 12 Nov release had the first group on by default. If you installed that one, the release notes list the lines to add.) What I run with (marked "Recommended" in the sample config.txt) - Holdover: when GPS drops, sub-second digits fade as the measured uncertainty reaches them, the clock holds the frequency it measured while locked (an hour without GPS: 386 µs → 7 µs typical), and it learns its crystals' temperature drift - Brightness equalisation: a 1 is no longer brighter than an 8, and the colons dim with the digits - $PMTXTS: a timing line per GPS pulse over USB, placing the pulse to about a microsecond despite USB jitter - Watchdog: a stalled clock restarts itself - config.txt kept true: on a charger, the clock writes the menu's choices into the file itself (pccd does it when plugged into a computer) - zone_gate: the timezone is looked up again only when the clock has moved, not every second. Use it if a computer is attached - ms_align: each second's millisecond count starts at the GPS pulse Opt-in - 12 display modes: sunrise and sunset, sun position, moon phase, twilight, Maidenhead grid, lat/lon, sidereal time, solar time, a second timezone, star transits, Allan deviation, the learned temperature model - Quarter-hour chimes, per-mode colon animation, page timing Settings menu: hold both buttons. Choices survive power-off, and a line you edit in config.txt still wins. Needs both fwt.bin and fwd.bin. Fixes: a truncated TZRULES.BIN crashed it at power-on; a timezone lookup cut short by a write from the computer could load the wrong zone; and more. Install: copy fwt.bin, fwd.bin and stars.bin to the CLOCK drive, plus settings.bin only if there's no SETTINGS.BIN already, then eject. The bootloader is untouched, so stock is one file copy away. Draft firmware, at your own risk: it runs on my own clock, and every change is tested in an emulator first. Releases 15 Nov 2026: everything is off until you switch it on; the timezone lookup gives way to a computer using the drive 12 Nov 2026: first dated release Last edit by peter at 15 Nov 2026, 11:19 AM ------------- |
| [top] | |
| mit | Posted: 13 Apr 2026, 03:58 PM |
|
yeah whatever Admin Posts: 704 Joined: 4-May 16 |
Interesting! I probably won't have a chance to test it personally for a while but I've idly thought about something like this before. One note, the hyperlink to the clock user manual in the repo is wrong (it should point to /projects/precision_clock_mk_iv/docs ) Here are some feature suggestions if you'd like to try them: - It would be nice to have a dropdown list for zone_override, so you can just click on a zone to switch to it. The list of zones is in the repo as timezone_names.json, but note that it usually has some changes when the timezone database is updated, so it can't be hard coded. - It could periodically check for firmware releases, and download and install them automatically - Probably a lot of work, but maybe not using Claude, you could recreate the functionality of ublox's u-centre sky view. This is a polar plot of the satellite signal strengths, and if you leave it running for 24 hours it gives you an interesting analysis of the antenna performance. ------------- |
| [top] | |
| peter | Posted: 13 Apr 2026, 04:48 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Thanks for the feedback! :) Both of these are in the latest alpha, and have fixed the link! :) Last edit by peter at 17 Apr 2026, 04:23 PM ------------- |
| [top] | |
| peter | Posted: 13 Apr 2026, 10:40 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Implemented the sky view in the latest alpha. Thank you for the suggestion. Last edit by peter at 17 Apr 2026, 04:24 PM ------------- |
| [top] | |
| peter | Posted: 17 Apr 2026, 04:22 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Oops! Didn't mean to make this message. Last edit by peter at 17 Apr 2026, 04:23 PM ------------- |
| [top] | |
| mit | Posted: 18 Apr 2026, 10:48 AM |
|
yeah whatever Admin Posts: 704 Joined: 4-May 16 |
It's pretty cool how quickly that came together! I would be interested to know how the NTP server behaves without a hardware PPS connection. The USB jitter is often pretty bad. There's a stale branch of the clock firmware here where I did some experiments with it. I don't think it's impossible to get a good timestamp over USB. The source of the jitter is that it's host-driven, and there's a variable delay between putting the packet in memory and it being read out by the USB interrupt. If we fiddled with the USB stack we could inject an accurate timestamp into the packet at the last microsecond. Sky view - the globe looks nice, it's not clear from the screenshots whether the polar plot colours in the sectors as I was expecting. E.g. here's a stackoverflow post with a filled sky view. Hmm... another point, when applying a firmware update it is slightly safer to send the SCSI Eject command, rather than reboot over serial, as the OS will hopefully finish any writes before it ejects it. I can think of plenty of other features for PCC if you want them, though please only add them if you are having fun, again I can't actually test it myself as I don't normally use macOS. There's a thought: maybe with the power of AI, you could port PCC to the browser using WebSerial...... ------------- |
| [top] | |
| peter | Posted: 18 Apr 2026, 05:47 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Great shout on the WebSerial! As a Flipper Zero-er, I should have thought of that! There's an initial release now, up on GitHub Pages :) PCC Web It's very much MVP / proof-of-concept though, it doesn't all yet function, and currently has reduced feature set. Re: USB jitter - thank you for enlightening me further and since reading your considerations re NTP, I've tried to temper my description of the NTP server as a convenience tool rather than anything production-grade, and tried to quell my use of the word "stratum"! :) Will have a look at that stale firmware branch though. Re: filled sky view - already in v0.8.0 :) 5°×5° cells coloured by peak SNR. Re: SCSI Eject vs serial reboot - thank you, have switched over. Last edit by peter at 7 Jul 2026, 07:41 PM ------------- |
| [top] | |
| peter | Posted: 7 Jul 2026, 02:25 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Big update: PCC is now a (static) web app — and the clock in it is real PCC has been rewritten from the ground up as a browser app: peterlewis.github.io/pcc Of note is the (not yet quite perfect) clock face. It's running the clock firmware, compiled to WebAssembly and runs in the page, parsing NMEA like the hardware does. Feed it a simulated GPS and watch it acquire, lock, and hold over; plug in a real Mk IV over Web Serial (Chromium only) and the same views drive the physical clock. FYI on the firmware it runs: it's a beta that includes the following PRs (#5 #6 #7 #8 #9: PPS timing telemetry, astro modes, hardening, sidereal/solar time, self-learning temp compensation). Draft firmware (it's been running happily on my own clock, but treat it as what it is). The old macOS app is preserved on its branch. PCC itself is beta: here be bugs :) — bug reports very welcome, on GitHub or right here. Last edit by peter at 8 Jul 2026, 07:16 AM ------------- |
| [top] | |
| mit | Posted: 8 Jul 2026, 09:14 AM |
|
yeah whatever Admin Posts: 704 Joined: 4-May 16 |
Hi Peter, I am currently working like crazy trying to finish my installation for EMF next week. I'll take a look at this and your pull requests at some point after the event. ------------- |
| [top] | |
| peter | Posted: 9 Jul 2026, 09:12 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Ah fab, no rush. Had a look on the website, I hope the Xelatype talk goes well, I can't wait to read about it, the philosophical twist sound fascinating! Last edit by peter at 9 Jul 2026, 09:12 PM ------------- |
| [top] | |
| jonas | Posted: 9 Sep 2026, 07:22 AM |
|
Member Posts: 9 Joined: 29-May 25 |
This is incredible! Thank you so much for doing this. Is it possible to permanently adjust the settings on the hardware clock too? Can't figure that part out. ------------- |
| [top] | |
| peter | Posted: 11 Sep 2026, 04:05 PM |
|
Member Posts: 14 Joined: 10-September 22 |
QUOTE (jonas)
This is incredible! Thank you so much for doing this. Is it possible to permanently adjust the settings on the hardware clock too? Can't figure that part out. Aah thank you, Jonas! :) I'm glad you like it. Though to reiterate, there are a fair few rough edges to PCC still, hence the beta badge. The best way to try all the new settings is to install the extended firmware I've been working on, and have a play. Whilst I can't guarantee you won't brick your clock, I've not had any issues, and even with partially failed writes, a rebuild of the USB volume quickly resolved it! The firmware doesn't touch the bootloader either, so that avenue of repair stays open. To give it a whirl, download the latest release, copy fwt.bin, fwd.bin and stars.bin to your CLOCK volume, plus settings.bin if there's no SETTINGS.BIN there already, then eject. Once it's on, hold both buttons to open the menu, use the buttons to move up and down, and hold both again to choose. Your choices survive power-off. Everything I've added is written up in the manual. Let me know how you get on, or if you have any feedback on the firmware (and indeed PCC, though as I say, things are a little rough around the edges, and I'm a bit busier with work at the moment, so slower on the hobbyist side of things). Thank you again, I'm glad it's being enjoyed by others. Edit, 13 Nov: settings.bin now comes with the release, so the dd step has gone. Last edit by peter at 13 Nov 2026, 12:16 AM ------------- |
| [top] | |
| peter | Posted: 12 Nov 2026, 10:18 PM |
|
Member Posts: 14 Joined: 10-September 22 |
Update: the two posts above are rewritten to match. The first is PCC, the second the firmware. I've closed my pull requests on mitxela's repo. I didn't want to burden it with a growing pile of drafts, so the firmware now lives on my fork and ships as dated releases, with every file it needs in one place. I'm glad to contribute any or all of it upstream, whenever that's wanted. The first release is out, dated 12 Nov. Jonas, no more dd: settings.bin is in the release, so the menu's settings stick from the first copy. PCC now lives at pcc.ptrl.ws. Last edit by peter at 14 Nov 2026, 10:23 PM ------------- |
| [top] | |
Sign in to post a reply.