QuakeWatch-Pro
QuakeWatch-Pro is the computer companion for ES series seismometers. It is written in Python and runs on Windows, macOS, and Linux. It reads seismometer data over USB Type-C, stores it in a local database, and plots the last 60 seconds of the three-axis waveform, spectrum, acceleration, and instrumental seismic intensity in real time.
QuakeWatch-Pro is two programs. Keep both of them running:
| Program | Purpose |
|---|---|
data_collector.py |
Reads seismometer data from the serial port, stores it in earthquake_data.db, and provides it to main.py |
main.py |
Opens the chart window and shows the waveform and seismic intensity |
Prepare
Section titled “Prepare”- Python 3.10 – 3.12. You can download it from the Python website.
- A USB Type-C cable that can carry data.
- The computer recognizes the seismometer’s serial port. If it does not, see The computer cannot find the seismometer serial port.
Download
Section titled “Download”On the GitHub page, download the source with git clone or Download ZIP, and extract it anywhere.
Install
Section titled “Install”Run the commands below in the QuakeWatch-Pro folder.
-
Open a terminal and change to the QuakeWatch-Pro folder
終端機視窗 cd your/path/QuakeWatch-Pro -
Create and activate a virtual environment
A virtual environment keeps this install from conflicting with other Python packages on the computer.
終端機視窗 python -m venv venv.\venv\Scripts\activate終端機視窗 python3 -m venv venvsource venv/bin/activate -
Install the dependencies
終端機視窗 pip install -r requirements.txt
-
Connect the seismometer
Connect the seismometer to the computer with a USB Type-C cable. First close other programs that use the serial port, such as the recovery tool.
-
Start the data collector
In a terminal with the virtual environment activated, run:
終端機視窗 python data_collector.pyThe program lists the available serial ports. If there is only one, it selects it. If there are several, enter the seismometer’s number and press Enter:
可用串列埠:[0] COM4 - Silicon Labs CP210x USB to UART Bridge (COM4)[1] COM1 - 通訊連接埠 (COM1)請選擇 [0-1] 或 q 退出: 0After you see 「開始收集數據」, the program periodically prints a line that starts with
[統計. If the sample count in that line keeps increasing, data is coming in.The serial port name is
COMplus a number, for exampleCOM4.On macOS, serial ports start with
/dev/cu.. On Linux they are usually/dev/ttyUSB0. If Linux reports a permission error, add your account to thedialoutgroup, then log in again:終端機視窗 sudo usermod -aG dialout $USER -
Open the chart window
Open another terminal, change to the same folder, activate the virtual environment, and then run:
終端機視窗 python main.pyThe window shows charts of the three-axis acceleration, the 0–25 Hz spectrum, PGA, and instrumental seismic intensity for the last 60 seconds.
Data storage
Section titled “Data storage”Data that comes in is stored in earthquake_data.db (SQLite) in the QuakeWatch-Pro folder. You can query it with any SQLite tool:
| Table | Contents |
|---|---|
sensor_data |
Three-axis acceleration, 50 samples per second. Columns: timestamp_ms, x, y, z, received_time |
intensity_data |
Instrumental seismic intensity and acceleration value a, about one row every 0.5 seconds. Columns: timestamp_ms, intensity, a, received_time |
sqlite3 earthquake_data.db "SELECT * FROM intensity_data ORDER BY received_time DESC LIMIT 10;"The database does not delete old data on its own. If the file gets too large, close both programs, then delete earthquake_data.db. The next launch creates it again.
Troubleshooting
Section titled “Troubleshooting”- The statistics stay at 0: Confirm that you selected the seismometer’s serial port, and that QuakeWatch-Pro supports the firmware version on the seismometer (see Firmware compatibility above).
- The statistics were increasing, then stopped: The seismometer stopped sending data. Check the USB cable, or unplug it and plug it back in.
- The serial port is not found: See The computer cannot find the seismometer serial port.
