{"id":21223883,"url":"https://github.com/niklauslee/esp8266-http-client","last_synced_at":"2026-05-22T05:18:46.400Z","repository":{"id":77037067,"uuid":"460276926","full_name":"niklauslee/esp8266-http-client","owner":"niklauslee","description":"A simple Kaluma HTTP client library for ESP8266 module","archived":false,"fork":false,"pushed_at":"2022-02-17T04:58:19.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T17:30:36.182Z","etag":null,"topics":["esp8266","http","kaluma"],"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/niklauslee.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":"2022-02-17T04:09:35.000Z","updated_at":"2024-02-10T16:44:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f0cc5cb-c1dd-4832-ad7a-e6a7e25dfbba","html_url":"https://github.com/niklauslee/esp8266-http-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fesp8266-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fesp8266-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fesp8266-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fesp8266-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklauslee","download_url":"https://codeload.github.com/niklauslee/esp8266-http-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243671778,"owners_count":20328692,"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":["esp8266","http","kaluma"],"created_at":"2024-11-20T22:53:45.548Z","updated_at":"2026-05-22T05:18:41.359Z","avatar_url":"https://github.com/niklauslee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP8266 HTTP Client\n\nA simple Kaluma HTTP client library for ESP8266 module.  It includes minimum code just to send a HTTP request using AT command.\n\nTested firmware versions:\n\n| Module | Manufacturer | AT version | SDK version |\n| ------ | ------------ | ---------- | ----------- |\n| ESP-01 | Ai-Thinker Technology Co. Ltd. | 1.2.0.0 | 1.5.4.1 |\n\n# Wiring\n\nHere is a wiring example for `UART0`.\n\n| Raspberry Pi Pico | ESP8266    | \n| ----------------- | ---------- |\n| 3V3               | VCC, CH_PD |\n| GND               | GND        |\n| GP0 (UART0 TX)    | RXD        |\n| GP1 (UART0 RX)    | TXD        |\n\n![wiring](https://github.com/niklauslee/esp8266-http-client/blob/main/images/wiring.jpg?raw=true)\n\n# Install\n\n```sh\nnpm install https://github.com/niklauslee/esp8266-http-client\n```\n\n# Usage\n\n```js\nconst {ESP8266HTTPClient} = require('esp8266-http-client');\nconst esp = new ESP8266HTTPClient(null, {debug: true});\n\nesp.wifi()\n  .then(() =\u003e {\n    esp.http('http://your-server.com')\n      .then(res =\u003e {\n        console.log(res);\n      })\n      .catch(err =\u003e {\n        console.log(err);\n      });\n  })\n  .catch(err =\u003e {\n    console.log(err);\n  });\n```\n\nOr, you can use async function.\n\n```js\nasync function main() {\n  try {\n    await esp.wifi();\n    const res = await esp.http('http://your-server.com');\n  } catch (err) {\n    console.log(err);\n  }\n}\n\nmain();\n```\n\n# API\n\n## Class: ESP8266HTTPClient\n\n### new ESP8266HTTPClient([serial[, options]])\n\n- `serial` `\u003cUART\u003e` UART object connected to ESP8266 module. Default: `board.uart(0)`.\n- `options` `\u003cobject\u003e` Options for [ATCommand](https://docs.kaluma.io/api-reference/at-command).\n\n### esp.wifi([connect])\n\n- `connect` `\u003cobject\u003e` Wi-Fi connection info.\n  - `ssid` `\u003cstring\u003e`\n  - `password` `\u003cstring\u003e`\n- Return: `\u003cPromise\u003c\u003e\u003e`\n\nConnect to Wi-Fi network.\n\n```js\nesp.wifi({ssid:'MyHome', password:'12345678'})\n  .then(() =\u003e {\n    console.log('connected');\n  })\n  .catch(err =\u003e {\n    console.error(err);\n  });\n```\n\nIf you do not want to expose your Wi-Fi connection info, you can set them in the storage. Add connection info manually in Terminal as below:\n\n```\n\u003e storage.setItem('WIFI_SSID', 'MyHome');\n\u003e storage.setItem('WIFI_PASSWORD', '12345678');\n```\n\nIf you have `WIFI_SSID` and `WIFI_PASSWORD` items in storage, then you can connect without connection info.\n\n```js\nesp.wifi()\n  .then(() =\u003e {\n    console.log('connected');\n  })\n  .catch(err =\u003e {\n    console.error(err);\n  });\n```\n\n### esp.http(url[, options])\n\n- `url` `\u003cstring\u003e` URL.\n- `options` `\u003cobject\u003e`\n  - `method` `\u003cstring\u003e` HTTP method.\n  - `headers` `\u003cobject\u003e` HTTP headers.\n  - `body` `\u003cstring\u003e` HTTP body.\n  - `timeout` `\u003cnumber\u003e`. Maximum waiting time for HTTP response. Default: `10000` (10 sec).\n- Returns: `\u003cPromise\u003cobject\u003e\u003e` Response object.\n  - `status` `\u003cnumber\u003e` HTTP status code.\n  - `statusText` `\u003cstring\u003e` HTTP status text.\n  - `headers` `\u003cobject\u003e` HTTP response headers.\n  - `body` `\u003cstring\u003e` HTTP response body.\n\nSend a HTTP request and returns the response.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fesp8266-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklauslee%2Fesp8266-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fesp8266-http-client/lists"}