{"id":21014986,"url":"https://github.com/screamz/wifi-connection-manager","last_synced_at":"2025-10-12T04:21:09.373Z","repository":{"id":263430126,"uuid":"890374960","full_name":"ScreamZ/wifi-connection-manager","owner":"ScreamZ","description":"A robust solution to manage Wi-Fi connections in embedded systems using the Moddable SDK.","archived":false,"fork":false,"pushed_at":"2024-11-27T10:42:57.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T06:59:57.231Z","etag":null,"topics":["embedded-systems","esp32","javascript","moddable","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ScreamZ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2024-11-18T13:14:18.000Z","updated_at":"2025-01-14T18:02:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca262cfd-5d53-4deb-af1f-a640f67182c1","html_url":"https://github.com/ScreamZ/wifi-connection-manager","commit_stats":null,"previous_names":["screamz/wifi-connection-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ScreamZ/wifi-connection-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fwifi-connection-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fwifi-connection-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fwifi-connection-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fwifi-connection-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreamZ","download_url":"https://codeload.github.com/ScreamZ/wifi-connection-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fwifi-connection-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010257,"owners_count":26084718,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["embedded-systems","esp32","javascript","moddable","typescript"],"created_at":"2024-11-19T10:08:02.406Z","updated_at":"2025-10-12T04:21:09.355Z","avatar_url":"https://github.com/ScreamZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embedded : WiFi connection manager\n\n\u003e [!IMPORTANT]\n\u003e This module is ESM only and only available for usage with the Moddable SDK as it uses core dependencies.\n\u003e Learn how to setup an Embedded JavaScript project using [xs-dev](https://xs-dev.js.org/).\n\nA robust solution to manage Wi-Fi connections in embedded systems using the Moddable SDK. `WiFiConnectionManager` simplifies the process of maintaining an active connection to a Wi-Fi access point.\n\n## Features\n\n- **Auto-reconnect:** Automatically retries connection if unavailable at startup or dropped during runtime.\n- **Connection lifecycle management:** Allows clean disconnection using `close`.\n- **Redundant message suppression:** Filters out repetitive `WiFi.disconnect` messages.\n- **Convenient readiness check:** Use the `ready` getter to quickly determine if Wi-Fi is connected.\n- **Connection timeout handling:** Forces a disconnect and retries if no IP address is assigned within a configurable timeout.\n- **Graceful recovery:** Waits a configurable duration after an unforced disconnect for a clean reconnect.\n- **Multiple access points:** Attempts connection to access points in order from a provided list.\n\n## Installation\n\n```sh\nnpm install @embedded-js/wifi-connection-manager\n```\n\n```ts\nimport Net from \"net\"; // From moddable SDK\nimport { WiFiConnectionManager } from \"@embedded-js/wifi-connection-manager\";\n\nconst manager = new WiFiConnectionManager(\n  [\n    // First access point to attempt\n    {\n      ssid: \"Freebox-ScreamZ\",\n      password: \"invalid!\", // Invalid password for testing in a simulator\n    },\n    // Second access point to attempt\n    {\n      ssid: \"Freebox-ScreamZ\",\n      password: \"good_password\",\n    },\n  ],\n  (message) =\u003e {\n    switch (msg) {\n      case WiFiConnectionManager.connected:\n        break; // still waiting for IP address\n      case WiFiConnectionManager.gotIP:\n        trace(`IP address ${Net.get(\"IP\")}\\n`);\n        break;\n      case WiFiConnectionManager.disconnected:\n        break; // connection lost\n    }\n  }\n);\n\n// Example: Checking if connected (procedural way)\nif (manager.ready) {\n  console.log(\"Wi-Fi is connected!\");\n}\n\n// Close connection when needed\nmanager.close();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fwifi-connection-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreamz%2Fwifi-connection-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fwifi-connection-manager/lists"}