{"id":31243514,"url":"https://github.com/dynow/wakedht","last_synced_at":"2026-05-18T04:32:01.678Z","repository":{"id":260876915,"uuid":"882600851","full_name":"DynoW/WakeDHT","owner":"DynoW","description":"Wake on Lan + ambient Temperature and Humidity ⛅ from DHT11/DHT22 sensor in your browser with dashboard \u0026 api ","archived":false,"fork":false,"pushed_at":"2025-09-19T10:57:35.000Z","size":800,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T03:15:12.101Z","etag":null,"topics":["dht11","dht22","esp32","humidity","pwa","temperature","wake-on-lan"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/DynoW.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-03T09:41:12.000Z","updated_at":"2025-09-19T10:56:34.000Z","dependencies_parsed_at":"2024-11-03T09:25:27.851Z","dependency_job_id":"e1c8836e-5fb6-4e51-9cb3-da282b60454f","html_url":"https://github.com/DynoW/WakeDHT","commit_stats":null,"previous_names":["dynow/simpledht-app","dynow/wakedht"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DynoW/WakeDHT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DynoW%2FWakeDHT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DynoW%2FWakeDHT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DynoW%2FWakeDHT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DynoW%2FWakeDHT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DynoW","download_url":"https://codeload.github.com/DynoW/WakeDHT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DynoW%2FWakeDHT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32145869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T15:33:03.595Z","status":"ssl_error","status_checked_at":"2026-04-22T15:30:42.712Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dht11","dht22","esp32","humidity","pwa","temperature","wake-on-lan"],"created_at":"2025-09-23T01:34:02.411Z","updated_at":"2026-04-22T16:35:49.509Z","avatar_url":"https://github.com/DynoW.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WakeDHT - Temperature, Humidity and WoL\r\n\r\n![dashboard](/photos/dashboard.png)\r\n\r\n## Description\r\n\r\nAn app based on [SimpleDHT library](https://github.com/winlinvip/SimpleDHT) for the DHT series of low-cost temperature \u0026 humidity sensors, now featuring **real-time updates**, **computer monitoring**, and **Wake-on-LAN** capabilities with optimized performance.\r\n\r\nYou can find DHT11 and DHT22 tutorials [here](https://learn.adafruit.com/dht).\r\n\r\n## 🛠️ Quick Setup Guide\r\n\r\n### Prerequisites\r\n- **[Arduino CLI](https://docs.arduino.cc/arduino-cli/installation/)** for building and uploading the code to the board\r\n\r\n- mkspiffs + esptool, usually installed with Arduino CLI and located at:\r\n  - C:\\Users\\YourName\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\5.0.0\\esptool.exe\r\n  - C:\\Users\\YourName\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\mkspiffs\\0.2.3\\mkspiffs.exe\r\n\r\n### 1. Hardware Setup\r\n- **DHT11/DHT22 Sensor:** Connect to pin 14 on ESP32 (can be changed in [WakeDHT.ino](WakeDHT.ino))\r\n- **ESP32:** Any ESP32 board with Wi-Fi and SPIFFS (tested on ESP32-S2 mini)\r\n- **Jumper wires, 5 kΩ resistor and breadboard:** For circuit connections (or just solder everything and skip the breadboard)\r\n\r\nBelow, you can find the **schematic** and an example using DHT11 and ESP32-S2 mini:\r\n\r\n\u003cimg alt=\"schematic\" src=\"/photos/schematic.png\" width=\"600px\" /\u003e\u003cimg align=\"right\" alt=\"example\" src=\"/photos/example.jpg\" width=\"200px\"/\u003e\r\n\r\n### 2. Software Setup\r\n\r\n#### Clone this repository\r\n\r\n```powershell\r\ngit clone https://github.com/DynoW/WakeDHT.git\r\n```\r\n\r\n#### Install ESP32 board \u0026 libraries (arduino-cli)\r\n\r\n1. Install [Arduino CLI](https://arduino.github.io/arduino-cli/latest/installation/)\r\n\r\n2. Initialize config and add Espressif package index:\r\n```powershell\r\narduino-cli config init\r\narduino-cli config set board_manager.additional_urls \"https://espressif.github.io/arduino-esp32/package_esp32_index.json\"\r\n```\r\n\r\n3. Update indexes and install ESP32 core:\r\n```powershell\r\narduino-cli core update-index\r\narduino-cli core install esp32:esp32\r\narduino-cli core list\r\n```\r\n\r\n4. Install required libraries (includes dependencies):\r\n```powershell\r\narduino-cli lib update-index\r\narduino-cli lib install \"SimpleDHT\"\r\narduino-cli lib list\r\n```\r\n\r\n### 3. Configuration\r\n\r\n#### WiFi Credentials\r\n1. Update the [secrets.h](secrets.h) file with your Wi-Fi details:\r\n  ```cpp\r\n  const char *ssid = \"\u003cYOUR_SSID\u003e\";\r\n  const char *password = \"\u003cYOUR_PASSWORD\u003e\";\r\n  ```\r\n\r\n#### Computer Configuration (Optional)\r\nEdit the computers array in [data/script.js](data/script.js):\r\n  ```javascript\r\n  const computers = [\r\n    { name: 'device1', mac: 'AA-BB-CC-DD-EE-00', ip: '192.168.1.100', port: 22 },\r\n    { name: 'device2', mac: 'AA-BB-CC-DD-EE-01', ip: '192.168.1.101', port: 22 }\r\n  ];\r\n  ```\r\n\r\n### 4. Build and Upload\r\n1. Verify board FQBN and connected port:\r\n```powershell\r\narduino-cli board listall | grep esp32   # find available FQBNs for your board\r\narduino-cli board list                           # shows connected ports (e.g. /dev/ttyUSB0 or COM9)\r\n```\r\n\r\n2. Compile and upload firmware (replace \u003cFQBN\u003e and \u003cPORT\u003e):\r\n```powershell\r\n# Compile\r\narduino-cli compile --fqbn \u003cFQBN\u003e ./WakeDHT\r\n\r\n# Upload\r\narduino-cli upload -p \u003cPORT\u003e --fqbn \u003cFQBN\u003e ./WakeDHT\r\n```\r\n\r\n3. SPIFFS / web files upload (mkspiffs + esptool)\r\n- Generate spiffs image from data/:\r\n```powershell\r\n# Navigate to project directory\r\ncd \"C:\\Users\\YourName\\Projects\\WakeDHT\"\r\n\r\n# Generate SPIFFS image\r\nC:\\Users\\YourName\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\mkspiffs\\0.2.3\\mkspiffs.exe -c data -b 4096 -p 256 -s 0x160000 spiffs.bin\r\n\r\n# Upload SPIFFS to board (note: use default-reset and hard-reset with hyphens)\r\nC:\\Users\\YourName\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\5.0.0\\esptool.exe --chip esp32s2 --port COM9 --baud 921600 --before default-reset --after hard-reset write-flash -z 0x290000 spiffs.bin\r\n```\r\n(You can use the mkspiffs and esptool executables included with your platform package or download them separately.)\r\n\r\nNotes:\r\n- Replace paths, \u003cFQBN\u003e and \u003cPORT\u003e with values from your system. For Windows use COM ports (e.g. COM9).\r\n\r\n- You can check my commands explained [here](UPLOAD.md)\r\n\r\n### 5. Access Your Device\r\n\r\n1. **Serial Monitor:** Check connection status and IP address\r\n2. **Web Interface:**\r\n  - mDNS: `http://esp32.local` (may not work on all networks but easier)\r\n  - Local IP: `http://192.168.1.XXX` (check serial monitor or your router's admin dashboard)\r\n\r\n## 📡 API Endpoints\r\n\r\nThe ESP32 provides RESTful API endpoints:\r\n\r\n- **GET `/api`** - Temperature and humidity data\r\n  ```json\r\n  {\"temperature\":25,\"humidity\":60,\"valid\":true}\r\n  ```\r\n\r\n- **GET `/ping?ip=192.168.1.100`** - Check computer status\r\n  ```json\r\n  {\"online\":true}\r\n  ```\r\n\r\n- **GET `/wol?mac=AA-BB-CC-DD-EE-FF`** - Wake computer\r\n  ```json\r\n  {\"success\":true}\r\n  ```\r\n\r\n## Development mode\r\n\r\nIn the [data/script.js](data/script.js) you can edit the\r\n\r\n```javascript\r\nconst DEV_MODE = false;\r\n```\r\n\r\nand install the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer), Visual Studio Code extension, to run the app with the live api from the ESP32\r\n\r\n## 🔧 Troubleshooting\r\n\r\n### Common Issues\r\n\r\n**1. Upload Failed / Port Not Found**\r\n- Check USB cable and drivers\r\n- Press BOOT button during upload (if required)\r\n- Try different baud rate: 115200\r\n\r\n**2. WiFi Connection Issues**\r\n- Verify `secrets.h` credentials\r\n- Check 2.4GHz network (ESP32 doesn't support 5GHz)\r\n- Monitor serial output for connection status\r\n\r\n**3. Sensor Reading Issues**\r\n- Check DHT11/DHT22 wiring\r\n- Verify pin assignment (default: pin 14)\r\n- Replace sensor if consistently invalid\r\n\r\n**4. Web Interface Not Loading**\r\n- Check SPIFFS upload was successful\r\n- Verify file paths in `data/` folder\r\n- Check browser console for errors\r\n\r\n**5. Computer Detection/WOL Issues**\r\n- Ensure computers are on same network\r\n- Verify MAC addresses and IP addresses\r\n- Check firewall settings on target computers\r\n- Enable Wake-on-LAN in BIOS/UEFI\r\n\r\n## 📁 Project Structure\r\n\r\n```\r\nWakeDHT/\r\n├── WakeDHT.ino       # Main firmware code\r\n├── secrets.h                # WiFi credentials (create this)\r\n├── data/                      # Web interface files\r\n│   ├── index.html       # Main UI\r\n│   ├── script.js            # JavaScript functionality\r\n│   ├── favicon.svg      # Icon\r\n│   └── manifest.json   # PWA manifest\r\n├── photos/                   # Documentation images\r\n├── LICENSE              # License file\r\n└── README.m          # This file\r\n```\r\n\r\n## Credits\r\n\r\nThe author and maintainer of this app is DynoW \u003ccontact@stefan.is-a.dev\u003e.\r\n\r\nBased on previous work of Winlin \u003cwinlin@vip.126.com\u003e, the author of SimpleDHT library.\r\n\r\n## Links\r\n\r\n1. [adafruit/DHT-sensor-library](https://github.com/adafruit/DHT-sensor-library)\r\n2. [Arduino #4469: Add SimpleDHT library.](https://github.com/arduino/Arduino/issues/4469)\r\n3. [DHT11 datasheet and protocol.](https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf)\r\n4. [DHT22 datasheet and protocol.](https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf)\r\n\r\n## License\r\n\r\nThis app is licensed under [MIT](https://github.com/DynoW/WakeDHT/blob/master/LICENSE) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynow%2Fwakedht","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynow%2Fwakedht","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynow%2Fwakedht/lists"}