{"id":14384612,"url":"https://github.com/SamZorSec/NodeMCU-and-JavaScript","last_synced_at":"2025-08-23T17:33:01.510Z","repository":{"id":115346378,"uuid":"71996915","full_name":"SamZorSec/NodeMCU-and-JavaScript","owner":"SamZorSec","description":"Programming NodeMCU boards with Espruino (JavaScript)","archived":false,"fork":false,"pushed_at":"2016-12-04T10:16:13.000Z","size":901,"stargazers_count":103,"open_issues_count":1,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-09T02:50:45.024Z","etag":null,"topics":["esp8266","javascript"],"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/SamZorSec.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}},"created_at":"2016-10-26T11:33:23.000Z","updated_at":"2024-03-11T00:20:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f2afe77-6887-4daf-b900-14b69bd17b14","html_url":"https://github.com/SamZorSec/NodeMCU-and-JavaScript","commit_stats":null,"previous_names":["samzorsec/nodemcu-and-javascript","smrtnt/nodemcu-and-javascript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamZorSec%2FNodeMCU-and-JavaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamZorSec%2FNodeMCU-and-JavaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamZorSec%2FNodeMCU-and-JavaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamZorSec%2FNodeMCU-and-JavaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamZorSec","download_url":"https://codeload.github.com/SamZorSec/NodeMCU-and-JavaScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716579,"owners_count":18269795,"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","javascript"],"created_at":"2024-08-28T18:01:30.890Z","updated_at":"2025-08-23T17:33:01.504Z","avatar_url":"https://github.com/SamZorSec.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# NodeMCU board (ESP8266) with JavaScript\nThis repository provides a little introduction into getting going with the NodeMCU board (1.0/v2) and [Espruino](http://www.espruino.com) (JavaScript for Microcontrollers, v1.87). It provides an installation guide and some examples.\n\n## Examples\n| Title     \t\t\t\t\t\t\t              \t      | Description        \t\t\t\t\t\t\t\t\t\t\t                              |\n|-----------------------------------------------|-----------------------------------------------------------------------|\n| [Hello World](01_hello_world.js)     \t\t\t\t  | A simple **Hello World** example     \t\t\t\t\t                       \t|\n| [Blink](02_blink_led.js)     \t\t\t\t          | A simple example to **flash** the integrated **LED**                \t|\n| [Wi-Fi](03_wifi.js)     \t\t\t\t              | A simple example to **connect** to a **Wi-Fi AP** and make the NodeMCU board available through **espruino.local**                   \t|\n| [HTTP Server](04_http_server.js)     \t\t\t\t  | A simple **Web Server** to control the integrated **LED**             |\n\n\n## Installation\nI spent 2-3 days to make everything working, so I decided to provide a [compressed folder](firmware/Espruino_v1_87.zip) (esptool.py v1.2 \u0026 Espruino v1.87) with everything you need to flash the firmware.\n\nYou probably need to install `pyserial` for using the `esptool.py`. It can be achieved with `sudo easy_install pyserial`(macOS), `sudo apt-get install python-serial`(Linux) or `sudo pip install pyserial`.\n\nMove inside the downloaded folder\n```\ncd Downloads\ncd Espruino_v1_87\n```\n\nErase the flash memory\n```\npython esptool.py --port /dev/tty.SLAB_USBtoUART erase_flash\n```\n\n![Erase flash](images/erase_flash.png)\n\nFlash the NodeMCU with Espruino\n```\npython esptool.py  --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_freq 80m --flash_mode dio --flash_size 32m 0x0000 \"boot_v1.4(b1).bin\" 0x1000 espruino_esp8266_user1.bin 0x37E000 blank.bin\n```\n\n![Flash firmware](images/flash_firmware.png)\n\nAfter flashing the firmware, you may have to unplug/plug the NodeMCU to the computer. To test the installation process, you can use `Screen` and send some JavaScript code, like `process.memory()`or `digitalWrite(NodeMCU.D4, HIGH);` to turn on the built-in led.\n```\nscreen /dev/tty.SLAB_USBtoUART 115200\n```\n\n![Screen](images/screen_espruino.png)\n\nLaunch Google Chrome, install the `Espruino Web IDE` ([extension](https://www.google.ch/url?sa=t\u0026rct=j\u0026q=\u0026esrc=s\u0026source=web\u0026cd=2\u0026cad=rja\u0026uact=8\u0026sqi=2\u0026ved=0ahUKEwiJ-qjbsvjPAhWDnBoKHcnuAfEQFggpMAE\u0026url=https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fespruino-web-ide%2Fbleoifhkdalbjfbobjackfdifdneehpo\u0026usg=AFQjCNHyNk_XkpLYJ6DNByefI7znAP5lgg\u0026bvm=bv.136593572,d.d2s)) and modify the Baud Rate to `115200` (Espruino Web IDE \u003e Settings \u003e Communications \u003e Baud Rate).\n\n![Espruino Web IDE](images/espruino_web_ide.png)\n\nIt's possible to program the board Over-The-Air by defining a hostname and configuring a connection to it. Use the [Wi-Fi](03_wifi.js) example and add its hostname `espruino.local:23` in the configuration (Espruino Web IDE \u003e Settings \u003e Communications \u003e Connect over TCP Address).\n\nSources\n- [Run Espruino on the NodeMCU devkit](https://blog.pedesen.de/2016/06/21/run-espruino-on-the-nodemcu-devkit/)\n- [Espruino Hardware Reference](http://www.espruino.com/Reference)\n- [Download Espruino](http://www.espruino.com/Download)\n- [CP210x USB to UART Bridge VCP Drivers](http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx)\n- [Esptool.py](https://github.com/themadinventor/esptool)\n- [Tutorials and examples](http://www.espruino.com/Tutorials)\n\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n  SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamZorSec%2FNodeMCU-and-JavaScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamZorSec%2FNodeMCU-and-JavaScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamZorSec%2FNodeMCU-and-JavaScript/lists"}