Hamish Cunningham, Gareth Coleman, Caolan McMahon and Crowds.Work
("Tragedy?!" That was bad science!)
Note: the Lua code uses NodeMCU. This is a great firmware for the ESP8266, but sometimes struggles with the resource constraints of the device. It is also quite a lot of work to port existing Arduino code for the sensors etc. that we're using over to Lua. So the new stuff now uses the ESP Arduino IDE (forum).
This is all AGPL 3. Like it or lump it :-)
git clone --recursive git@github.com:hamishcunningham/fishy-wifi.git
./esp8266-local-sdk
make nodemcu[-with-dns]
make flashnodemcu
(for e.g. the ESP01 or other board with small flash)make flasholimex
(for e.g. the Olimex, 2MB flash)make seed-esplorer-prefs
make esplorer
.lua
files in ESPlorer and save them to the ESPmake mqtt-spy
If you're using a breadboard from me with a DIP switch, you can fiddle with the flashing pin and chip enable via that switch:
Flashing is enabled by setting switch 1 to on; chip enable is switch 5.
(Note: some of these are superseded by the above...)
Build open source toolchain:
sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python python-serial sed
cd esp-open-sdk
make STANDALONE=n
export PATH=${HOME}/fishy-wifi/esp8266-local-sdk/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
xtensa-lx106-elf-gcc -I${HOME}/fishy-wifi/esp8266-local-sdk/esp-open-sdk/sdk/include
-L${HOME}/fishy-wifi/esp8266-local-sdk/esp-open-sdk/sdk/lib`Rebuild NodeMCU:
cd nodemcu-firmware
PATH=${PATH}:${HOME}/fishy-wifi/esp8266-local-sdk/esp-open-sdk/xtensa-lx106-elf/bin make
Flash the firmware to the ESP8266:
cd app
make flashnodemcu
or, for the Olimex board:
make flasholimex
Older methods:
.../esptool.py --port /dev/ttyAMA0 write_flash 0x00000
../bin/0x00000.bin 0x10000 ../bin/0x10000.bin 0x7E000 ../bin/blank.bin
0x7C000 ../bin/esp_init_data_default.bin
.../esptool.py --port /dev/ttyAMA0 write_flash 0x00000 ../nodemcu_512k_latest.bin
Rebuild ESPlorer:
ant -Dplatforms.JDK1.7.home=/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/ jar
Connect via picocom:
(first disable getty on /dev/ttyAMA0 via /etc/inittab)
picocom /dev/ttyAMA0 --omap crcrlf
(then toggle DTR to get elua prompt)
Picocom commands:
^A plus...
^T toggle DTR line
^U baud rate up (^D for down)
Wiring the ESP01 breadboard:
Wiring the Olimex board:
Luatool filetransfer thingy:
${HOME}/fishy-wifi/esp8266-local-sdk/luatool/luatool/luatool.py -p /dev/ttyAMA0 -f init.lua -t init.lua -v