{"id":18647131,"url":"https://github.com/nugrohoesbb/webserver_iot","last_synced_at":"2026-05-03T12:37:22.750Z","repository":{"id":237628524,"uuid":"794915085","full_name":"NugrohoESBB/webserver_iot","owner":"NugrohoESBB","description":"Pengiriman data sensor dari ESP8266/ESP32 ke web server","archived":false,"fork":false,"pushed_at":"2024-05-02T08:19:54.000Z","size":14915,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T04:57:20.106Z","etag":null,"topics":["esp32","esp8266","iot","webserver"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NugrohoESBB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-02T08:04:35.000Z","updated_at":"2024-05-03T06:17:40.000Z","dependencies_parsed_at":"2024-05-02T21:52:49.410Z","dependency_job_id":null,"html_url":"https://github.com/NugrohoESBB/webserver_iot","commit_stats":null,"previous_names":["nugrohoesbb/webserver_iot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NugrohoESBB/webserver_iot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NugrohoESBB%2Fwebserver_iot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NugrohoESBB%2Fwebserver_iot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NugrohoESBB%2Fwebserver_iot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NugrohoESBB%2Fwebserver_iot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NugrohoESBB","download_url":"https://codeload.github.com/NugrohoESBB/webserver_iot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NugrohoESBB%2Fwebserver_iot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32569714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["esp32","esp8266","iot","webserver"],"created_at":"2024-11-07T06:24:49.877Z","updated_at":"2026-05-03T12:37:22.713Z","avatar_url":"https://github.com/NugrohoESBB.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003e🛠️ Setup folder setelah download repositori\u003c/h2\u003e\n\n\u003cp\u003e1. Paste file zip setelah download file dari repositori ke folder xampp \u003e htdocs\u003c/p\u003e\n\u003cp\u003e2. Unzip file tersebut\u003c/p\u003e\n\u003cp\u003e3. Ubah nama folder yang di dapat setelah dilakukan unzip yang semula nama foldernya \"webserver_iot\" menjadi \"iot\"\u003c/p\u003e\n\u003cp\u003e4. Setelah nama foldernya diubah sehingga alur foldernya menjadi xampp \u003e htdocs \u003e iot\u003c/p\u003e\n\u003cbr\u003e\n\n\n\u003ch2\u003e🛠️ Arduino IDE Code (GET METHOD)\u003c/h2\u003e\n\n\u003cp\u003e1. Ubah SSID dan Password\u003c/p\u003e\n\n```php\nconst char* ssid = \"ENTER A VALUE\";\nconst char* password = \"ENTER A VALUE\";\n```\n\u003cp\u003e2. Isi IP untuk get data dan melihat status pengiriman data\u003c/p\u003e\n\n```php\nif ((WiFi.status() == WL_CONNECTED)) {\n    // C:\\xampp\\htdocs\\iot\\webapi\\api\\create.php\n    address =\"http://(yourIP)/iot/webapi/api/create.php?suhu=\";\n    address += String(suhu);\n    address += \"\u0026kelembaban=\"; \n    address += String(kelembaban) ;\n      \n    http.begin(client,address);  //Specify request destination\n    int httpCode = http.GET();//Send the request\n      \n    if (httpCode \u003e 0) { //Check the returning code    \n        payload = http.getString();   //Get the request response payload\n        payload.trim();\n        if( payload.length() \u003e 0 ){\n           Serial.println(payload + \"\\n\");\n        }\n    } else {\n      Serial.print(\"Connected failed \");\n    }\n    \n    http.end();   //Close connection\n}else{\n    Serial.print(\"Not connected to wifi \");\n    Serial.println(ssid);\n}\n```\n\u003cbr\u003e\n\n\n\u003ch2\u003e🛠️ Arduino IDE Code (POST METHOD)\u003c/h2\u003e\n\n\u003cp\u003e1. Ubah SSID dan Password\u003c/p\u003e\n\n```php\nconst char* ssid = \"ENTER A VALUE\";\nconst char* password = \"ENTER A VALUE\";\n```\n\u003cp\u003e2. Isi IP untuk post data dan melihat status pengiriman data\u003c/p\u003e\n\n```php\nif ((WiFi.status() == WL_CONNECTED)) {\n    WiFiClient client;\n    HTTPClient http;\n    \n    StaticJsonDocument\u003c200\u003e doc;\n    String url, nodemcuData; \n    \n    // C:\\xampp\\htdocs\\iot\\webapi\\api\\create.php\n    url =\"http://(yourIP)/iot/webapi/api/create.php\";\n    \n    doc[\"suhu\"] = String(suhu);\n    doc[\"kelembaban\"] = String(kelembaban);\n\n    http.begin(client,url);\n    http.addHeader(\"Content-Type\", \"application/json\");\n    \n    serializeJson(doc, nodemcuData);\n    Serial.print(\"POST data \u003e\u003e \");\n    Serial.println(nodemcuData); \n  \n    int httpCode = http.POST(nodemcuData);//Send the request\n    String payload;  \n    if (httpCode \u003e 0) { //Check the returning code   \n        payload = http.getString();   //Get the request response payload\n        payload.trim();\n        if( payload.length() \u003e 0 ){\n           Serial.println(payload + \"\\n\");\n        }\n    }\n    \n    http.end();   //Close connection\n}else{\n    Serial.print(\"Not connected to wifi \");Serial.println(ssid);\n}\n```\n\u003cbr\u003e\n\n\n\u003ch2\u003e🛠️ PHP Code (database.php)\u003c/h2\u003e\n\u003cp\u003eubah bagian database.php sesuai kebutuhan\u003c/p\u003e\n\n```php\n\u003c?php \n    class Database {\n        private $host = \"Your Host\";\n        private $database_name = \"Your Database Name\";\n        private $username = \"Your Username\";\n        private $password = \"Your Password\";\n\n        public $conn;\n\n        public function getConnection(){\n            $this-\u003econn = null;\n            try{\n                $this-\u003econn = new PDO(\"mysql:host=\" . $this-\u003ehost . \";dbname=\" . $this-\u003edatabase_name, $this-\u003eusername, $this-\u003epassword);\n                $this-\u003econn-\u003eexec(\"set names utf8\");\n            }catch(PDOException $exception){\n                echo \"Database could not be connected: \" . $exception-\u003egetMessage();\n            }\n            return $this-\u003econn;\n        }\n    }  \n?\u003e\n```\n\u003cbr\u003e\n\n\n\u003ch2\u003e🛠️ PHP Code (create.php)\u003c/h2\u003e\n\u003cp\u003eImport database.php and mc_log.php\u003c/p\u003e\n\n```php\ninclude_once '../config/database.php';\ninclude_once '../class/mc_log.php';\n```\n\n\u003cp\u003eMelakukan pengecekan dan publish data ke database\u003c/p\u003e\n\n```php\nif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n    // The request is using the POST method\n    $data = json_decode(file_get_contents(\"php://input\"));\n    $item-\u003esuhu = $data-\u003esuhu;\n    $item-\u003ekelembaban = $data-\u003ekelembaban;\n} elseif ($_SERVER['REQUEST_METHOD'] === 'GET'){\n    // The request is using the GET method\n    $item-\u003esuhu = isset($_GET['suhu']) ? $_GET['suhu'] : die('wrong structure!');\n    $item-\u003ekelembaban = isset($_GET['kelembaban']) ? $_GET['kelembaban'] : die('wrong structure!');\n}else {\n    die('wrong request method');\n}\n    \nif($item-\u003ecreateLogData()){\n    echo 'Data created successfully.';\n} else{\n    echo 'Data could not be created.';\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnugrohoesbb%2Fwebserver_iot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnugrohoesbb%2Fwebserver_iot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnugrohoesbb%2Fwebserver_iot/lists"}