beepy

BPC watch/clock synchronization utility in Python
git clone git://git.luxferre.top/beepy.git
Log | Files | Refs | README

README (5076B)


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