Coding Chase - Projects

My 3D Hub

Thank You For Donating:

Ikeeki (linux-sunxi@irc.freenode.net)
Computer Troubleshooters Brasil

Sunday 12 July 2015

IoT Projects - ESP8266 [programming]

Now all this is left is to program the ESP8266-01 module...!



For this part, I used one of these:

FT232RL 3.3V 5V FTDI USB to TTL Serial Adapter Module for Arduino Mini Port IDXX

Flashing the NodeMCU firmware

1) connect GPIO0 -> GND (Only for when loading the firmware because this pin is what defines the boot mode: firmware load mode or regular mode)

2) git clone https://github.com/themadinventor/esptool.git

3) get your firmware, either from github, the online custom build website from my previous post, etc.

4) sudo python esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash 0x00000 /opt/ESP8266/nodemcu.firmwares/nodemcu_latest.bin

Connecting...
Erasing flash...
Writing at 0x00062000... (100 %)

Leaving...

Writing and Loading Some LUA Scripts

1) remember to disconnect GPIO0 from GND

2) git clone https://github.com/kmpm/nodemcu-uploader.git 

3) sudo ./nodemcu-uploader.py -p /dev/ttyUSB0 -b 115200 upload ../lua.scripts/webserver.lua:webserver.lua [--compile] [--restart]
 
Changing communication to 115200 baud
Preparing esp for transfer.
Transfering webserver.lua as webserver.lua
All done!
 
Using the parameter --compile will trigger lua script compiling at the wifi module:
after uploading the original lua script to the module, the python script will issue
the compile command, generating an lc binary file and deleting the original lua file
on the module.

Using the --restart parameter will issue a module reboot after uploading the script.

No comments :

Post a Comment