hamishcunningham / fishy-wifi

Scripts, notes and the odd subaquatic gizmo for the ESP8266 and what-have-you.
GNU Affero General Public License v3.0
25 stars 13 forks source link

Scripts, notes and the odd fish for the ESP8266

Hamish Cunningham, Gareth Coleman, Caolan McMahon and Crowds.Work

A small corner of The Commons

("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 :-)

Developing on the ESP8266 with NodeMCU

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:

Olimex breadboard with
switch

Flashing is enabled by setting switch 1 to on; chip enable is switch 5.

How to...

(Note: some of these are superseded by the above...)

Build open source toolchain:

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

Resources