{"id":13781144,"url":"https://github.com/marcelkottmann/esp32-javascript","last_synced_at":"2026-03-11T00:11:08.640Z","repository":{"id":42038942,"uuid":"100167570","full_name":"marcelkottmann/esp32-javascript","owner":"marcelkottmann","description":"\"Lightweight\" JS interpreter for ESP32. Provides JS-based eventloop implementation and native asynchronous network and timer functions.","archived":false,"fork":false,"pushed_at":"2025-11-21T21:56:09.000Z","size":11539,"stargazers_count":88,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-01-11T11:41:34.654Z","etag":null,"topics":["asynchronous-network","esp32","eventloop","javascript"],"latest_commit_sha":null,"homepage":"","language":"C","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/marcelkottmann.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":"2017-08-13T09:49:47.000Z","updated_at":"2026-01-06T10:04:08.000Z","dependencies_parsed_at":"2024-08-03T18:12:25.713Z","dependency_job_id":"4e5498ac-fc1c-4127-813e-119a13a89c61","html_url":"https://github.com/marcelkottmann/esp32-javascript","commit_stats":null,"previous_names":["pepe79/esp32-javascript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcelkottmann/esp32-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelkottmann%2Fesp32-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelkottmann%2Fesp32-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelkottmann%2Fesp32-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelkottmann%2Fesp32-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelkottmann","download_url":"https://codeload.github.com/marcelkottmann/esp32-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelkottmann%2Fesp32-javascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30362948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"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":["asynchronous-network","esp32","eventloop","javascript"],"created_at":"2024-08-03T18:01:23.357Z","updated_at":"2026-03-11T00:11:08.620Z","avatar_url":"https://github.com/marcelkottmann.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# esp32-javascript\n\n![](https://github.com/marcelkottmann/esp32-javascript/workflows/Build/badge.svg)\n\n\"Lightweight\" JS interpreter for ESP32. Provides JS-based eventloop implementation\nand native asynchronous network and timer functions.\nBecause of the limited memory on ESP32-WROOM modules, the full functionality is currently only realizable on ESP32-WROVER and ESP32-S2-WROVER modules, that came with at least 2MB integrated SPIRAM.\n\n## Content\n\n[Getting started](#getting-started)\n\n[API](#api)\n\n[Compatibility](#compatibility)\n\n## Getting started\n\n### Prerequisites\n\nInstall [esp-idf 4.2.2](https://docs.espressif.com/projects/esp-idf/en/release-v4.2/esp32/get-started/index.html) on your system.\n\n### First install\n\nClone esp32-javascript inside your esp directory (normally ~/esp):\n\n```shell\n    cd ~/esp\n    git clone https://github.com/pepe79/esp32-javascript.git\n```\n\nChange into ~/esp/esp32-javascript\n\n```shell\n    cd ~/esp/esp32-javascript\n```\n\nMaybe you want to change the BOARD_VARIANT in the ./CMakeLists.txt file \nfor the integrated arduino-esp32 bindings.\n\nFirst build the project with\n\n```shell\n    #for ESP32 devices\n    idf.py build\n\n    #for ESP32-S2 devices\n    idf.py -DIDF_TARGET=esp32s2 build\n```\n\nConnect your ESP32 Dev Board via USB and run\n\n```shell\n    idf.py flash monitor\n```\n\nUse the keyboard shortcut `AltGr + ]` to leave serial monitor.\n\nNow you have installed the pre-configured boot script.\n\nIf this is your first install, your onboard LED should blink now. Blinking signals that your board has started a soft ap with the ssid \"esp32\". With your mobile or desktop connect to the WLAN SSID \"esp32\" and open http://192.168.4.1/setup (if you have not changed the default credentials your username / password is esp32 / esp32 ). You can change the default password in\n[firmware-config.ts](./components/esp32-javascript/modules/esp32-javascript/firmware-config.ts) by changing the value of key `password`.\n\nOn the Setup page you can configure your WLAN settings and an URL to download your JS main script from.\n\n![Setup page screenshot](setup.png)\n### Examples\n\nPlease note that the Javascript OTA script, does not need to have a main function, because its evaluated entirely.\nThat means, to print out \"Hello World\", you only have to include one line in your script on the webserver:\n\n```js\nconsole.log(\"Hello world!\");\n```\n\nYou can test this example by configuring this URL as \"Javascript OTA\":\nhttps://raw.githubusercontent.com/marcelkottmann/esp32-javascript/master/examples/example.js\n\nPlease see also the other example in  [./examples](./examples)\n\n### C/C++bindings\n\nIf you need to create your own C/C++ bindings for your JS code, this are the steps to perform:\n\n1. Create a file named `project.cpp` in the `./main` directory\n2. Implement the esp32_javascript_main callback function inside this `project.ccp`:\n\n```c\n   #include \"esp32-javascript.h\"\n\n   extern void esp32_javascript_main(duk_context *ctx)\n   {\n     // do your own duktape bindings here\n   }\n```\n\nSee [Duktape Programmer's Guide](https://duktape.org/guide.html) for more information regarding Duktape bindings.\n\nIf you need more than this, you can create your own esp-idf component below `./components`. Then delegate the `esp32_javascript_main` function to this component.\nAdditionally you have to set your component name in the top level `./CMakeLists.txt`. Refer to the documentation next to the setting `ESP32_JS_PROJECT_NAME`.\nSee [ESP Build System](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html) for information on how to create a component with the esp-idf build system.\n\n### Native OTA\n\nYou can perform a native firmware OTA upgrade by calling the URL /setup . There is a section called \"Native OTA\" where you can provide two urls to the new images: One for the actual firmware image (normally named esp32-javascript.bin in your build directory) and the other for the JS modules image (normally named modules.bin in your build directory).\n\nThe upgrade is performed in the background. You can check the upgrade status either by staying on the upgrade page, which is reloaded automatically every ~20 seconds or click on \"Upgrade status\" in the setup page.\n\nAfter upgrade has finished you have to restart the device to load the new firmware.\n### Clean\n\nYou can clean the project by executing\n\n```shell\n    idf.py fullclean\n```\n\nIf you want to use all the esp32-javascript defaults for your sdkconfig. Remove `./sdkconfig` file. This file will be recreated the next build with all the defaults. \n### Factory reset\n\nYou can erase the persistent flash memory, which will be equivalent to a factory reset, by executing\n\n```shell\n    idf.py erase_flash\n```\n\n## Compatibility\n\n### Device Requirements\n* Supported chips ESP32 and ESP32-S2\n* 2 MB Minimum Flash Size\n* 2 MB Minimum external SPI RAM (WROVER)\n\n### ESP-IDF\n\n| Version                                                           |       Compatible       |\n| ----------------------------------------------------------------- | :--------------------: |\n| [4.2](https://github.com/espressif/esp-idf/releases/tag/v4.2)     | ☑️\u003csup\u003e1\u003c/sup\u003e |\n| [4.2.1](https://github.com/espressif/esp-idf/releases/tag/v4.2.1) | ☑️\u003csup\u003e1\u003c/sup\u003e |\n| [4.2.2](https://github.com/espressif/esp-idf/releases/tag/v4.2.2) | ✅ Recommended |\n\n\u003csup\u003e1\u003c/sup\u003e SSL client connections currently not working properly for ESP32-S2 devices due to esp-idf bug in 4.2.x:\nhttps://github.com/espressif/esp-idf/pull/6998 , but can be fixed manually (see changes in PR).\n\n## REPL\n\nThe [examples](examples/) directory contains a [repl](examples/repl.js) that can be used as JS OTA Url: \nhttps://raw.githubusercontent.com/marcelkottmann/esp32-javascript/http-streaming/examples/repl.js\n\nThe repl can be used with netcat directly or with a combination of rlwrap and netcat to have a history-support:\n`rlwrap netcat [IP-ADDRESS] 1234`\n\nEnter username and password separated with colon(`:`) to authenticate, e.g. `esp32:esp32` + Enter\n\n```bash\n~/esp/esp32-javascript\u003e rlwrap netcat 192.168.188.24 1234\n\u003e esp32:esp32\n====\u003e authorized.\n\u003e console.log('Hello world.')\nLOG|Hello world.\n====\u003e undefined\n\u003e\n```\n## API\n\n[API documentation](docs/README.md)\n\n### Update docs\n\nUpdate documentation by executing\n\n```shell\n    npm run doc\n```\n\n## License\n\nSee source files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelkottmann%2Fesp32-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelkottmann%2Fesp32-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelkottmann%2Fesp32-javascript/lists"}