Files
beepy/README
T
2024-12-12 08:46:14 +02:00

106 lines
5.0 KiB
Plaintext

Beepy: sync BPC-enabled watches and clocks from Python 3
--------------------------------------------------------
This is a Python emulator of the Chinese BPC time broadcasting station signal
for syncing longwave-enabled watches and clocks that support this station.
With the help of any sort of loop antenna (or even headphones or speakers), it
allows you to adjust your watch without having to be close to the Chinese
signal. This program follows the BPC timecode specification and modulation
methods used by the oldest desktop applications for this very purpose, and
transmits on 13700 Hz, whose 5th harmonic is the reference signal frequency,
68.5 KHz, but the base frequency here is within the spectrum supported by any
consumer-grade audio hardware.
== Dependencies ==
Beepy depends on PyAudio (>=0.2.14) and ntplib (>=0.4.0). Just install them
by running pip install -r requirements.txt from the project directory. Note
that installing PyAudio will also pull its PortAudio (>=v19) dependency.
The program has been primarily tested on Python 3.10.
== Usage ==
Beepy can be run like this:
python bee.py [-t duration] [-d delta] [-s ntp_server] [-n ntp_version] \
[-o tz_offset] [-r sample_rate]
All parameters are optional here:
* -h: display help screen
* -t: transmission duration in minutes (default 30)
* -d: manual delta correction in milliseconds (default 0, see below)
* -o: timezone offset from UTC (in hours, default 9, see below)
* -r: transmission sampling rate (in Hz, default 48000, only change if this
fails to work)
* -s: specify NTP server to fetch time from (if no server is specified, then
local system time is used)
* -n: specify NTP protocol version to use, default is 4, good for most cases
After running the command, you must enter the synchronization mode on your
watch/clock (making sure that BPC is selected if it's multiband) and put it
close enough to your (improvised) loop antenna, headphones or speakers. The
script will fetch the UTC time according to your source, apply the TZ offset,
then the manual delta offset and then will attempt to start the transmission
from the closest second. The TZ offset is set to +8 hours by default because
most BPS-enabled watches/clocks expect the BST time to be sent in order to
then apply their own timezone correction according to your settings. If your
watch/clock doesn't have such correction, you can always use this -o flag to
zero out this offset (with -o 0) and transmit the local time directly onto it.
In case your equipment, software or time source server introduce any delay to
the synchronization process, you can add a constant delta (in milliseconds)
with the -d flag.
After the synchronization is successful, you can press the
Ctrl+C combination or wait until the entire sequence (which is 30 minutes long
by default, adjustable with -t flag) gets transmitted.
== FAQ ==
- How is this even possible?
To put it simply, to emit any audio signal, electricity has to travel through
many wires and coils. This inevitably creates electromagnetic interference. If
we send the signal of a particular constant frequency with enough intensity
through audio circuits, this interference will turn into radio emission in the
longwave spectrum, which is exactly what we need for syncing radio-controlled
clocks and watches. This emission is too weak to cause any harm outside but
enough to be received by the watch or clock several centimeters apart.
- Which watches/clocks has this been tested on?
Some Casio models, including Casio GW-B5600BC, GMW-B5000D and GW-5000U.
- Is my particular watch/clock model supported?
As long as it can receive BPC signal and you know how to make it do this, it
is automatically supported by Beepy. At this point, I can surely say that if
anything goes wrong, it's not the fault of your watch or your emulator, but
something in between: audio setup, antenna setup or the placement of the watch
relative to the antenna. It might take some trial and error and a great deal
of patience to make sure everything works as expected.
For most digital Casio models, you can force BPC reception by entering one
of the test menus: press and hold first Light, then Receive/Set and then Mode
button. Scroll through with the Receive button to ensure that "B 01" is on the
screen, then start the reception process with the Light button. You should get
a "BOK" message if the process is successful, or "BNG" if unsuccessful.
- Why create an alternative to JJY.py?
In some conditions, multiband Casio watches are proven to sync faster with BPC
than with JJY40. Beepy doesn't replace JJY.py as the JJY40 signal is supported
by much more models. But you can try out Beepy if the JJY reception takes too
long.
At some time in the future, JJY.py and Beepy might get united into a single
time synchronization utility.
- Are there still any plans for implementing other longwave time protocols?
Maybe. DCF77 and WWVB are of the primary interest.
== Credits ==
Created by Luxferre in 2024. Released into public domain with no warranties.