{"id":15720244,"url":"https://github.com/geomatsi/nodemcu-tests","last_synced_at":"2025-03-30T22:47:00.545Z","repository":{"id":142017038,"uuid":"96034063","full_name":"geomatsi/nodemcu-tests","owner":"geomatsi","description":"Simple NodeMCU examples: nRF24 Lua library, WiFi, MQTT, WebSocket, ...","archived":false,"fork":false,"pushed_at":"2020-07-28T21:45:40.000Z","size":97,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-06T04:14:23.638Z","etag":null,"topics":["lua","nodemcu","nrf24l01"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/geomatsi.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":"2017-07-02T16:01:28.000Z","updated_at":"2020-07-28T21:45:43.000Z","dependencies_parsed_at":"2023-07-07T07:32:13.852Z","dependency_job_id":null,"html_url":"https://github.com/geomatsi/nodemcu-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geomatsi%2Fnodemcu-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geomatsi%2Fnodemcu-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geomatsi%2Fnodemcu-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geomatsi%2Fnodemcu-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geomatsi","download_url":"https://codeload.github.com/geomatsi/nodemcu-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390856,"owners_count":20769476,"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":["lua","nodemcu","nrf24l01"],"created_at":"2024-10-03T21:58:07.094Z","updated_at":"2025-03-30T22:47:00.527Z","avatar_url":"https://github.com/geomatsi.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notes\n\nThese notes should work for both [WeMos Mini](https://wiki.wemos.cc/products:d1:d1_mini) boards\nas well as for the following simple ESP12F circuitry suitable even for breadboard:\n\n![alt text](pics/esp12f-proto.png)\n\n__However__ in the case of WeMos board there is no need to manually change RESET and GPIO0 levels and to use *before* and *after* parameters in *esptool*.\nAll the switching between running mode and programming mode will be done done using DTR/RTS of integrated USB-to-Serial chip.\n\n## Using Minicom with original AI Thinker firmware\n\n* Switch the board to running mode: set high level on GPIO0 pin\n* Connect Minicom to device serial port with 115200 8N1 settings\n* Enable carriage return using *CTRL-A U* control sequence\n* Reset device: toggle low level on RST pin\n```bash\nAi-Thinker Technology Co. Ltd.\nready\n```\n* Run AT commands pressing *Enter* and then *CTRL-J* after each command:\n```bash\nAT\nOK\n\nAT+GMR\nAT version:0.60.0.0(Jan 29 2016 15:10:17)\nSDK version:1.5.2(7eee54f4)\nAi-Thinker Technology Co. Ltd.\nMay  5 2016 17:30:30\nOK\n```\n\n## Check device settings in programming mode\n\n* Switch the board to programming mode: set low level on GPIO0 pin\n* Reset the board: toggle low level on RST pin\n* Run *esptool* to get chip parameters: reset chip between each command\n```bash\n$ sudo esptool.py --port /dev/ttyUSB0 --before no_reset_no_sync --after no_reset chip_id\nesptool.py v2.6\nSerial port /dev/ttyUSB0\nConnecting...\nDetecting chip type... ESP8266\nChip is ESP8266EX\nFeatures: WiFi\nMAC: 60:01:94:02:a9:f9\nUploading stub...\nRunning stub...\nStub running...\nChip ID: 0x0002a9f9\nStaying in bootloader.\n```\n\n```bash\n$ sudo esptool.py --port /dev/ttyUSB0 --before no_reset_no_sync --after no_reset read_mac\nesptool.py v2.6\nSerial port /dev/ttyUSB0\nConnecting...\nDetecting chip type... ESP8266\nChip is ESP8266EX\nFeatures: WiFi\nMAC: 60:01:94:02:a9:f9\nUploading stub...\nRunning stub...\nStub running...\nMAC: 60:01:94:02:a9:f9\nStaying in bootloader.\n```\n\n## Brief NodeMCU HOWTO\nNodeMCU project provides an excellent [documentation](https://nodemcu.readthedocs.io), so no need to go into much details here. In brief, do the following steps to build and flash firmware image to WeMos D1 mini board:\n* Get firmware source code\n```bash\n$ git clone https://github.com/nodemcu/nodemcu-firmware.git\n```\n* Customize NodeMCU firmware image\nEdit _app/include/user_modules.h_\n* Build firmware\nBuild NodeMCU firmware:\n```bash\n$ make\n```\n* Flash firmware\nSwitch device into programming mode and NodeMCU firmware\n```bash\n$ sudo ./tools/toolchains/esptool.py --port /dev/ttyUSB0 write_flash -fm dio -fs 32m 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin\n```\n\n### How to copy Lua scripts to device spiffs\n\nUsing [luatool](https://github.com/4refr0nt/luatool):\n```bash\n$ sudo luatool.py --port /dev/ttyUSB0 --src test.lua --dest test.lua -b 115200\n```\n\nUsing [nodemcu-tool](https://github.com/AndiDittrich/NodeMCU-Tool):\n```bash\n$ sudo nodemcu-tool upload init.lua\n$ sudo nodemcu-tool upload test.lua -n main.lua\n```\n\n### How to create and flash spiffs image\n\nCreate image content list\n```bash\n$ cat script.img\nimport init.lua init.lua\nimport test.lua test.lua\nimport nrf24.lua nrf24.lua\n```\n\nGenerate spiffs image\n```bash\n$ spiffsimg -f fs.img -S ${FLASH_SIZE} -U ${SPIFFS_SIZE} -r script.img\n```\n\nFlash spiffs image to device\n```bash\n$ sudo /home/matsi/bin/esptool.py --port /dev/ttyUSB0 write_flash -fm dio -fs ${FLASH_SIZE} ${SPIFFS_OFFSET} fs.img\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeomatsi%2Fnodemcu-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeomatsi%2Fnodemcu-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeomatsi%2Fnodemcu-tests/lists"}