This project enables a Raspberry Pi to perform periodic internet speed tests and log the results to a MariaDB database. It includes the ability to detect the current WiFi SSID, making it useful for monitoring the performance of different networks.
- Automatic speed tests every 5 minutes (configurable).
- Logs download speed, upload speed, latency, and SSID.
- Data stored in a MariaDB database for analysis and tracking over time.
- Raspberry Pi with Raspberry Pi OS installed.
- Internet connection (WiFi or Ethernet).
- MariaDB server setup.
- Python 3 installed on Raspberry Pi.
First, clone this repository to your Raspberry Pi:
git clone <repository-url>
cd <repository-directory>Install the required Python packages:
pip3 install speedtest-cli mysql-connector-python- Rename
config.py.exampletoconfig.py. - Edit
config.pyto set your database credentials and desired test interval.
Ensure your MariaDB database and table are set up as described in the project documentation.
Execute the script manually to start logging speed test results:
python3 my_speedtest.pyTo run the script at a set interval, use the crontab entry (for every 5 minutes as an example):
*/5 * * * * /usr/bin/python3 /path/to/my_speedtest.py- Modify the test interval in
config.pyfor different scheduling. - Extend the database schema in
setup.sqlto capture additional data.
Refer to the script's output and your MariaDB logs for troubleshooting any issues with the speed test logging or database insertion.
Contributions to the project are welcome. Please follow the standard pull request process.
Specify the license under which the project is released.