{"id":27004243,"url":"https://github.com/cyberscoper/ecowitt_to_thingspeak","last_synced_at":"2026-02-08T21:32:05.572Z","repository":{"id":263403713,"uuid":"890288335","full_name":"CyberScoper/ecowitt_to_thingspeak","owner":"CyberScoper","description":"Ecowitt to ThingSpeak is a Go application that regularly (once every minute) fetches data from the Ecowitt API and sends it to the ThingSpeak platform for further analysis and visualization. The application is configured to run as a system service on Linux using systemd and supports cross-compilation for Windows.","archived":false,"fork":false,"pushed_at":"2024-11-30T14:42:57.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T14:46:40.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberScoper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-18T10:14:15.000Z","updated_at":"2024-11-30T14:43:00.000Z","dependencies_parsed_at":"2024-12-21T22:29:57.649Z","dependency_job_id":null,"html_url":"https://github.com/CyberScoper/ecowitt_to_thingspeak","commit_stats":null,"previous_names":["cyberscopetoday/ecowitt_to_thingspeak","cyberscoper/ecowitt_to_thingspeak"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScoper%2Fecowitt_to_thingspeak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScoper%2Fecowitt_to_thingspeak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScoper%2Fecowitt_to_thingspeak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScoper%2Fecowitt_to_thingspeak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberScoper","download_url":"https://codeload.github.com/CyberScoper/ecowitt_to_thingspeak/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128753,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-04T06:15:39.322Z","updated_at":"2026-02-08T21:32:05.497Z","avatar_url":"https://github.com/CyberScoper.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌤️ Ecowitt to ThingSpeak\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/04cdc3b1d6bc43cca84279369dfea563)](https://app.codacy.com/gh/CyberScopeToday/ecowitt_to_thingspeak?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=CyberScopeToday/ecowitt_to_thingspeak\u0026utm_campaign=Badge_Grade)\n\n## 📄 Description\n\n**Ecowitt to ThingSpeak** is a **Go application** that regularly (once every minute) fetches data from the [Ecowitt API](https://api.ecowitt.net/) and sends it to the [ThingSpeak](https://thingspeak.com/) platform for further analysis and visualization. The application is configured to run as a system service on Linux using `systemd` and supports cross-compilation for Windows.\n\n![Application in Action](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/app_working.gif)\n\n## 🚀 Requirements\n\n- **Go**: Version 1.20 or higher\n- **systemd**: For setting up the service to auto-start on Linux\n- **Git**: For cloning the repository\n- **Superuser Privileges**: For configuring services and installing dependencies\n\n## 🔧 Installation and Setup\n\n### 🧭 Step 1: Clone the Repository\n\nFirst, clone the repository to your server or local machine:\n\n```bash\ngit clone https://github.com/CyberScopeToday/ecowitt_to_thingspeak.git\ncd ecowitt_to_thingspeak\n```\n\n### 🛠️ Step 2: Install Go\n\nIf Go is not already installed on your system, follow these steps:\n\n#### For Linux:\n\n1. **Download the latest version of Go:**\n\n    ```bash\n    wget https://golang.org/dl/go1.20.5.linux-amd64.tar.gz\n    ```\n\n2. **Extract the archive and install Go:**\n\n    ```bash\n    sudo tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz\n    ```\n\n3. **Add Go to your `PATH` environment variable:**\n\n    Open the `~/.profile` or `~/.bashrc` file and add:\n\n    ```bash\n    export PATH=$PATH:/usr/local/go/bin\n    ```\n\n4. **Apply the changes:**\n\n    ```bash\n    source ~/.profile\n    ```\n\n5. **Verify the installation:**\n\n    ```bash\n    go version\n    ```\n\n    You should see something like:\n\n    ```\n    go version go1.20.5 linux/amd64\n    ```\n\n![Go Installation](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/go_installation.png)\n\n### 🗂️ Step 3: Create the `.env` Configuration File\n\nCreate a file named `ecowitt_to_thingspeak.env` in the root directory of the project (`~/ecowitt_to_thingspeak/`) with the following content:\n\n```env\nECOWITT_APPLICATION_KEY=\nECOWITT_API_KEY=\nECOWITT_MAC=\nTHINGSPEAK_WRITE_API_KEY=\n```\n\n**Important:** Ensure that this file is **not** added to version control. Add it to `.gitignore` if using Git:\n\n```bash\necho \"ecowitt_to_thingspeak.env\" \u003e\u003e .gitignore\n```\n\n![Environment Variables](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/env_variables.png)\n\n### 📦 Step 4: Install Dependencies\n\nThe application uses the [`godotenv`](https://github.com/joho/godotenv) package to work with `.env` files. Install it using the following command:\n\n```bash\ngo get github.com/joho/godotenv\n```\n\n### 🔨 Step 5: Build the Application\n\nBuild the executable for Linux:\n\n```bash\ngo build -o ecowitt_to_thingspeak\n```\n\nFor cross-compiling to Windows, run:\n\n```bash\nGOOS=windows GOARCH=amd64 go build -o ecowitt_to_thingspeak.exe\n```\n\n**Note:** Ensure that the necessary environment variables (`GOOS` and `GOARCH`) are set for the target platform.\n\n![Build Process](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/build_process.png)\n\n### 🖥️ Step 6: Configure systemd Service (for Linux)\n\n#### 6.1. Create the Service File\n\nCreate a service file named `ecowitt_to_thingspeak.service` in the `/etc/systemd/system/` directory:\n\n```bash\nsudo nano /etc/systemd/system/ecowitt_to_thingspeak.service\n```\n\nAdd the following content to the file:\n\n```ini\n[Unit]\nDescription=Ecowitt to ThingSpeak Service\nAfter=network.target\n\n[Service]\nExecStart=/root/ecowitt_to_thingspeak/ecowitt_to_thingspeak\nWorkingDirectory=/root/ecowitt_to_thingspeak\nEnvironmentFile=/root/ecowitt_to_thingspeak/ecowitt_to_thingspeak.env\nRestart=always\nUser=root\n\n[Install]\nWantedBy=multi-user.target\n```\n\n**Important:**\n- Replace `/root/ecowitt_to_thingspeak/ecowitt_to_thingspeak` with the actual path to your executable.\n- Running the service as `root` is **not recommended**. It's better to create a separate user.\n\n![Systemd Service](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/systemd_service.png)\n\n#### 6.2. Create a User for the Service (Recommended)\n\n1. **Create a system user:**\n\n    ```bash\n    sudo useradd -r -s /bin/false ecowitt_user\n    ```\n\n2. **Modify the service file to use the new user:**\n\n    Open the service file:\n\n    ```bash\n    sudo nano /etc/systemd/system/ecowitt_to_thingspeak.service\n    ```\n\n    Change the `User` directive from `root` to `ecowitt_user`:\n\n    ```ini\n    User=ecowitt_user\n    ```\n\n3. **Grant the user access to the project directory:**\n\n    ```bash\n    sudo chown -R ecowitt_user:ecowitt_user /root/ecowitt_to_thingspeak\n    ```\n\n#### 6.3. Reload systemd and Start the Service\n\n1. **Reload systemd to recognize the new service:**\n\n    ```bash\n    sudo systemctl daemon-reload\n    ```\n\n2. **Start the service:**\n\n    ```bash\n    sudo systemctl start ecowitt_to_thingspeak.service\n    ```\n\n3. **Enable the service to start on boot:**\n\n    ```bash\n    sudo systemctl enable ecowitt_to_thingspeak.service\n    ```\n\n4. **Check the service status:**\n\n    ```bash\n    sudo systemctl status ecowitt_to_thingspeak.service\n    ```\n\n    You should see something like:\n\n    ```\n    ● ecowitt_to_thingspeak.service - Ecowitt to ThingSpeak Service\n       Loaded: loaded (/etc/systemd/system/ecowitt_to_thingspeak.service; enabled; vendor preset: enabled)\n       Active: active (running) since Mon 2024-04-27 12:00:01 UTC; 5s ago\n     Main PID: 12345 (ecowitt_to_t)\n        Tasks: 1 (limit: 4915)\n       Memory: 10.0M\n          CPU: 0.05s\n       CGroup: /system.slice/ecowitt_to_thingspeak.service\n               └─12345 /root/ecowitt_to_thingspeak/ecowitt_to_thingspeak\n    ```\n\n    ![Service Status](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/service_status.png)\n\n#### 6.4. View Service Logs\n\nTo view the service logs, use:\n\n```bash\njournalctl -u ecowitt_to_thingspeak.service -f\n```\n\n![Service Logs](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/service_logs.png)\n\n### 🖱️ Step 7: Manually Run the Application (Optional)\n\nIf you prefer to run the application manually without using `systemd`, execute:\n\n```bash\n./ecowitt_to_thingspeak\n```\n\n## 💻 Cross-Compilation for Windows\n\nTo create an executable for Windows, follow these steps:\n\n1. **Navigate to the project directory:**\n\n    ```bash\n    cd ~/ecowitt_to_thingspeak\n    ```\n\n2. **Build the executable for Windows (64-bit):**\n\n    ```bash\n    GOOS=windows GOARCH=amd64 go build -o ecowitt_to_thingspeak.exe\n    ```\n\n3. **Copy `ecowitt_to_thingspeak.exe` and the `ecowitt_to_thingspeak.env` file to your Windows machine.**\n\n4. **Run the application on Windows:**\n\n    Open Command Prompt or PowerShell, navigate to the directory containing the executable, and run:\n\n    ```cmd\n    ecowitt_to_thingspeak.exe\n    ```\n\n    Ensure that the application runs correctly and sends data to ThingSpeak.\n\n![Windows Application](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/windows_application.png)\n\n### Setting Up Auto-Start on Windows\n\nTo make the application start automatically when Windows boots:\n\n1. **Create a Shortcut for the Application:**\n    - Navigate to the directory containing `ecowitt_to_thingspeak.exe`.\n    - Right-click on `ecowitt_to_thingspeak.exe` and select **Create shortcut**.\n\n2. **Move the Shortcut to the Startup Folder:**\n    - Press `Win + R`, type `shell:startup`, and press `Enter`.\n    - Move the created shortcut into the opened Startup folder.\n\n![Windows Startup](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/windows_startup.png)\n\n## 🔒 Security\n\n### Restrict Access to the `.env` File\n\nEnsure that the `.env` file is only readable by the owner:\n\n```bash\nchmod 600 /root/ecowitt_to_thingspeak/ecowitt_to_thingspeak.env\n```\n\n### Security Recommendations\n\n- **Do not run the service as `root` unless necessary.** Create a dedicated user with minimal permissions.\n- **Do not share your `.env` file publicly.** Ensure it is added to `.gitignore`.\n- **Regularly update dependencies** and check for vulnerabilities.\n\n## 📝 Logging\n\nThe application uses Go's standard `log` package to output information. Logs can be viewed through `journalctl` on Linux or redirected to a file when running manually.\n\n![Logging](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/logging.png)\n\n## 📈 Monitoring and Notifications\n\nIt is recommended to add a notification system (e.g., via Telegram or Email) to alert you of critical errors or service failures.\n\n![Monitoring](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/monitoring.png)\n\n## 🔄 Updating the Application\n\nTo update the application, follow these steps:\n\n1. **Pull the latest changes from the repository:**\n\n    ```bash\n    git pull origin main\n    ```\n\n2. **Install any new dependencies:**\n\n    ```bash\n    go mod tidy\n    ```\n\n3. **Rebuild the executable:**\n\n    ```bash\n    go build -o ecowitt_to_thingspeak\n    ```\n\n4. **Restart the service:**\n\n    ```bash\n    sudo systemctl restart ecowitt_to_thingspeak.service\n    ```\n\n![Update Process](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/update_process.png)\n\n## 🤝 Contributing and Support\n\nIf you have suggestions for improvements or find a bug, please create an [Issue](https://github.com/CyberScopeToday/ecowitt_to_thingspeak/issues) in the repository.\n\n![Contribute](https://user-images.githubusercontent.com/CyberScopeToday/ecowitt_to_thingspeak/contribute.png)\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberscoper%2Fecowitt_to_thingspeak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberscoper%2Fecowitt_to_thingspeak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberscoper%2Fecowitt_to_thingspeak/lists"}