Skip to content

Commit 0b70909

Browse files
committed
config: disable debug logging by default
1 parent 14b342a commit 0b70909

2 files changed

Lines changed: 84 additions & 108 deletions

File tree

README.md

Lines changed: 83 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -6,131 +6,107 @@ This script automates running diagnostic network tests from your AT&T fiber gate
66

77
By comparing gateway-to-WAN tests against local-machine-to-WAN tests, you can better distinguish between potential ISP issues and local network problems (e.g., Wi-Fi interference, router performance).
88

9-
109
## Features
1110

1211
- Uses Selenium to automate interaction with the gateway's web interface.
1312
- Runs gateway-based Ping tests to measure the quality of the direct ISP connection.
1413
- Optionally runs a gateway-based Speed Test.
1514
- Runs local Ping tests from the machine executing the script to both the gateway and the internet.
16-
- Runs local Speed Tests using the **official Ookla Speedtest CLI** for accurate, reliable results:
17-
- Download & Upload Bandwidth
18-
- Ping, Jitter, and Packet Loss
19-
- Bufferbloat (latency under load) with calculated delta vs. idle latency
15+
- Runs local Speed Tests using the **official Ookla Speedtest CLI** for accurate, reliable results.
16+
- Measures **WAN Bufferbloat** (latency under load) to see how your internet connection handles congestion.
17+
- Optionally measures **LAN Bufferbloat** to specifically test for latency issues on your local Wi-Fi or wired network, independent of your ISP.
2018
- Runs in headless mode, so no browser window is required.
2119
- Schedules tests to run at a configurable interval.
2220
- Provides color-coded console output, highlighting anomalous results (e.g., high latency, packet loss) for at-a-glance diagnosis.
23-
- Appends combined results to a single, local CSV log file, creating headers if the file is new or empty.
24-
- Captures detailed Wi-Fi metrics on macOS (signal, noise, channel, etc.) - see the [Advanced Configuration](#advanced-configuration) section for details.
21+
- Appends combined results to a single, local CSV log file.
22+
- Captures detailed Wi-Fi metrics on macOS (signal, noise, channel, etc.).
2523
- All configuration is organized in the `config.py` file.
2624

27-
2825
## Prerequisites
26+
2927
- Designed to run on MacOS with Homebrew package manager installed.
3028
- Before running the script, you must install the official Ookla Speedtest CLI.
3129

3230
### Installing Ookla Speedtest CLI on macOS (via Homebrew)
33-
If you don't have Homebrew, [install it first](https://brew.sh/). Then, run the following command in your terminal:
3431

35-
```bash
36-
brew install speedtest
37-
```
32+
If you don't have Homebrew, [install it first](https://brew.sh/). Then, run the following command in your terminal:
33+
34+
35+
brew install speedtest
36+
37+
3838

3939
## Usage and Setup
40-
Simply run the following command in a terminal window:
4140

42-
```bash
43-
uv run main.py
44-
```
45-
`uv` will automatically read the required dependencies from the top of the `main.py` file, create a temporary environment, and run the script.
41+
Simply run the following command in a terminal window:
4642

47-
48-
## Configuration
49-
All configuration has been moved to the **`config.py`** file for easy editing.
50-
51-
52-
### General Configuration
53-
54-
- `PING_TARGET`: The IP address or hostname to ping (e.g., "google.com").
55-
- `LOG_FILE`: The name of the CSV file for storing results.
56-
- `RUN_INTERVAL_MINUTES`: How often the script should run.
57-
- `HEADLESS_MODE`: Set to `True` to run the browser invisibly in the background.
58-
- `ENABLE_DEBUG_LOGGING`: Set to `True` to include verbose debug logs in the console and log output.
59-
60-
61-
### Gateway Test Configuration
62-
63-
- `GATEWAY_URL`: The address of the fiber gateway (e.g., `http://192.168.1.254`).
64-
- `DIAG_URL`: The address of the gateway's diagnostics page.
65-
- `SPEED_TEST_URL`: The address of the gateway's speed test page.
66-
- `RUN_GATEWAY_SPEED_TEST_INTERVAL`: How often the gateway speed test runs. For example, a value of `2` means the speed test will run every other time the main checks run. Set to `0` to disable.
67-
68-
69-
### Local Test Configuration
70-
71-
- `RUN_LOCAL_PING_TEST`: Set to `True` to run a ping test from your computer to the `PING_TARGET`.
72-
- `RUN_LOCAL_SPEED_TEST`: Set to `True` to run a speed test from your computer using the Ookla CLI.
73-
- `RUN_LOCAL_GATEWAY_PING_TEST`: Set to `True` to run a ping test from your computer to the gateway.
74-
75-
### Anomaly Highlighting & Thresholds
76-
The console can color-highlight anomalous results to make issues obvious at a glance. You can toggle highlighting and configure thresholds in `config.py`:
77-
78-
- Enable/disable highlighting.
79-
- Thresholds for packet loss, latency, and jitter.
80-
- Thresholds for download/upload speeds.
81-
- Bufferbloat detection: compares latency under load to idle latency using a configurable delta.
82-
83-
Adjust these settings to match your network expectations and noise tolerance.
84-
85-
### Important: Handling the Device Access Code
86-
The gateway speed test requires your gateway's **Device Access Code** to log in. To store this securely, the script uses an environment variable.
87-
88-
**Recommended Method: `.env` file**
89-
90-
If you don't provide the code via an environment variable (see instructions below), the script will prompt you to enter it in the terminal when a gateway speed test is scheduled to run and it will create this file for you.
91-
92-
If you want to create the `.env` file manually, follow these steps:
93-
94-
1. Create a file named `.env` in the same directory as `main.py`.
95-
2. Add the following line to the `.env` file, replacing the placeholder with your actual code:
96-
97-
GATEWAY_ACCESS_CODE='your_code_here'
98-
99-
3. The script will automatically detect and use this code.
100-
101-
102-
## Advanced Configuration
103-
104-
### Getting Wi-Fi Details (macOS only)
105-
Optional: to capture detailed Wi-Fi metrics like signal strength (RSSI), noise level, channel, and band, the script uses the built-in `wdutil` command-line tool. However, `wdutil` requires `sudo` (administrator) privileges to run.
106-
107-
To allow the script to run `wdutil` without asking for a password every time, you need to add a custom rule to the `sudoers` file.
108-
109-
**Follow these steps carefully:**
110-
111-
1. **Open the sudoers file for editing:**
112-
Open the Terminal app and run the following command. You will be prompted to enter your macOS user password.
113-
```bash
114-
sudo visudo
115-
```
116-
2. **Edit the file:**
117-
This will open the `sudoers` file in the `vim` text editor. Don't be intimidated!
118-
- Use the arrow keys to scroll to the very bottom of the file.
119-
- Press the `o` key to start "insert mode" on a new line.
120-
3. **Add the new rule:**
121-
Carefully type or paste the following line. **Replace `your_username` with your actual macOS username** (the one you use to log in).
122-
```
123-
your_username ALL=(ALL) NOPASSWD: /usr/bin/wdutil
124-
```
125-
*To find your username, you can open a new terminal window and type `whoami`.*
126-
4. **Save and exit:**
127-
- Press the `Escape` key to exit insert mode.
128-
- Type `:wq` and press `Enter` to save the file and quit `vim`.
129-
130-
If you make a mistake, `visudo` will warn you. In that case, type `e` and press `Enter` to re-edit the file and fix the error.
131-
132-
Once this is done, the script will be able to gather and log Wi-Fi details automatically.
133-
134-
135-
## License
136-
This project is licensed under the MIT License.
43+
44+
uv run main.py
45+
```uv` will automatically read the required dependencies from the top of the `main.py` file, create a temporary environment, and run the script.
46+
47+
## Configuration
48+
All configuration has been moved to the **`config.py`** file for easy editing.
49+
50+
### General Configuration
51+
52+
- `PING_TARGET`: The IP address or hostname to ping (e.g., "google.com").
53+
- `LOG_FILE`: The name of the CSV file for storing results.
54+
- `RUN_INTERVAL_MINUTES`: How often the script should run.
55+
- `HEADLESS_MODE`: Set to `True` to run the browser invisibly in the background.
56+
- `ENABLE_DEBUG_LOGGING`: Set to `True` for verbose console output.
57+
58+
### Gateway Test Configuration
59+
60+
- `GATEWAY_URL`: The address of the fiber gateway.
61+
- `DIAG_URL`: The address of the gateway's diagnostics page.
62+
- `SPEED_TEST_URL`: The address of the gateway's speed test page.
63+
- `RUN_GATEWAY_SPEED_TEST_INTERVAL`: How often the gateway speed test runs. Set to `0` to disable.
64+
65+
### Local Test Configuration
66+
67+
- `RUN_LOCAL_PING_TEST`: Set to `True` to run a ping test from your computer to the `PING_TARGET`.
68+
- `RUN_LOCAL_SPEED_TEST`: Set to `True` to run a speed test from your computer using the Ookla CLI.
69+
- `RUN_LOCAL_GATEWAY_PING_TEST`: Set to `True` to run a ping test from your computer to the gateway.
70+
71+
### Anomaly Highlighting & Thresholds
72+
The console can color-highlight anomalous results to make issues obvious. You can toggle highlighting and configure all thresholds for packet loss, latency, jitter, and bufferbloat in `config.py`.
73+
74+
### Important: Handling the Device Access Code
75+
The gateway speed test requires your gateway's **Device Access Code** to log in. The script will securely prompt you for this code when needed and save it to a local `.env` file for future runs.
76+
77+
## Advanced Configuration
78+
79+
### Getting Wi-Fi Details (macOS only)
80+
To capture detailed Wi-Fi metrics like signal strength (RSSI) and noise level, the script uses the built-in `wdutil` command-line tool. However, `wdutil` requires administrator privileges. To allow the script to run `wdutil` without asking for a password every time, you can add a custom rule to the `sudoers` file.
81+
82+
**Follow these steps carefully:**
83+
84+
1. Open the Terminal and run `sudo visudo`.
85+
2. Use the arrow keys to scroll to the bottom of the file and press `o` to start editing on a new line.
86+
3. Add the following rule, **replacing `your_username` with your actual macOS username** (type `whoami` in a new terminal to find it):
87+
```
88+
your_username ALL=(ALL) NOPASSWD: /usr/bin/wdutil
89+
```
90+
4. Press `Escape`, then type `:wq` and press `Enter` to save and exit.
91+
92+
### Isolating LAN Bufferbloat (Optional)
93+
By default, the bufferbloat test measures latency on your entire internet connection. To isolate your local network and test if your Wi-Fi router (e.g., Eero) is the source of latency, you can run an optional, LAN-specific test. This requires a second computer on your network to act as a test server.
94+
95+
**Setup Steps:**
96+
97+
1. **Install `iperf3` on Both Computers**: On your main machine and the second computer, install the `iperf3` network testing tool.
98+
```bash
99+
brew install iperf3
100+
```
101+
2. **Start the `iperf3` Server**: On the second computer, find its Local IP address (e.g., in System Settings > Wi-Fi). Then, open a Terminal and run it in server mode. Leave this terminal open.
102+
```bash
103+
iperf3 -s
104+
```
105+
3. **Update `config.py`**: On your main machine, open `config.py` and enable the test:
106+
* Set `RUN_LAN_BUFFERBLOAT_TEST` to `True`.
107+
* Set `LAN_TEST_TARGET_IP` to the IP address of your second computer.
108+
109+
The script will now run the additional LAN bufferbloat test during each cycle.
110+
111+
## License
112+
This project is licensed under the MIT License.

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Set to True to run the browser in headless mode (no visible UI).
1111
HEADLESS_MODE: bool = True
1212
# Set to True to enable verbose, high-resolution debug logging for troubleshooting.
13-
ENABLE_DEBUG_LOGGING: bool = True
13+
ENABLE_DEBUG_LOGGING: bool = False
1414

1515
# --- Gateway Configuration ---
1616
# The base URL for your AT&T gateway.

0 commit comments

Comments
 (0)