ESP: Difference between revisions

From base48
imported>Rmarko
(initial)
 
imported>Rmarko
(esplib, esphs)
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
* http://l0l.org.uk/2014/12/esp8266-modules-hardware-guide-gotta-catch-em-all/
* http://l0l.org.uk/2014/12/esp8266-modules-hardware-guide-gotta-catch-em-all/
* http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations
* http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations
* ESPtool with pre-build binaries https://git.48.io/esptool
* Luatool fork https://github.com/hackerspace/luatool
* [[ESPLib]]
* Haskell management utilities https://git.48.io/esphs/
=== Boards ===
==== snajpa's ====
* https://github.com/snajpa/espboards
==== srk's ====
=== Flashing NodeMCU ===
* Clone ESPtool from https://git.48.io/esptool
{{cmd|code=
git clone https://git.48.io/esptool.git
}}
* add jumper to flash enable pins - isolated pin header with two pins GPIO0 and GND.
* connect VCC and GND pins to 5V on USB serial converter
* connect ESP RX/TX pins
* try plugging in serial converter, led on the ESP should blink briefly
* flash dev firmware (or debug firmware if needed)
{{cmd|code=
cd esptool
./flash_bin_dev
}}
* remove jumper
* start terminal with 115200 baudrate
{{cmd|code=
miniterm.py /dev/ttyUSB0 115200
}}
* disconnect and re-connect power to ESP (preferably without disconnecting USB serial converter as you wouldn't see early boot messages)
* NodeMCU should start
** during first boot you should see Self adjusting flash size and Formatting filesystem messages
** after formatting you should get NodeMCU prompt '''>'''
{{cmd|code=
Early boot
$ miniterm.py /dev/ttyUSB0 74880
Program
$ miniterm.py /dev/ttyUSB0 115200
sometimes
$ miniterm.py /dev/ttyUSB0 9600
Flashing custom build nodemcu
./esptool.py -b 921600 write_flash -fm dio 0x00000 bin/0x00000.bin  0x10000 bin/0x10000.bin
NodeMCU build
customization
app/include/user_config.h
app/include/user_modules.h
app/include/user_version.h
}}


{{cmd|code=
{{cmd|code=
triac_reg_pinout
triac_reg_pinout


0: GPIO16
0: GPIO16 (no pwm or interrupt!)
1: GPIO5 230 sense
1: GPIO5 230 sense
2: GPIO4 triac out
2: GPIO4 triac out
3: GPIO0
3: GPIO0 (Special: Bootloader when low)
4: GPIO2
4: GPIO2
5: GPIO14 debug led
5: GPIO14 debug led
6: GPIO12 ws2812 4x4 array
7: GPIO13
8: GPIO15
RX: GPIO3
TX: GPIO1
A0:
}}
{{cmd|code=
toggle(dir_pin)
slider_pinout
0: GPIO16
1: GPIO5 enable
2: GPIO4 direction
3: GPIO0 (Special: Bootloader when low)
4: GPIO2 debug led
5: GPIO14 step
6: GPIO12 ws2812 4x4 array
6: GPIO12 ws2812 4x4 array
7: GPIO13
7: GPIO13

Latest revision as of 15:49, 3 August 2018

ESP8266

Boards

snajpa's

srk's

Flashing NodeMCU

<syntaxhighlight lang="bash">git clone https://git.48.io/esptool.git</syntaxhighlight>

  • add jumper to flash enable pins - isolated pin header with two pins GPIO0 and GND.
  • connect VCC and GND pins to 5V on USB serial converter
  • connect ESP RX/TX pins
  • try plugging in serial converter, led on the ESP should blink briefly
  • flash dev firmware (or debug firmware if needed)

<syntaxhighlight lang="bash">cd esptool ./flash_bin_dev</syntaxhighlight>

  • remove jumper
  • start terminal with 115200 baudrate

<syntaxhighlight lang="bash">miniterm.py /dev/ttyUSB0 115200</syntaxhighlight>

  • disconnect and re-connect power to ESP (preferably without disconnecting USB serial converter as you wouldn't see early boot messages)
  • NodeMCU should start
    • during first boot you should see Self adjusting flash size and Formatting filesystem messages
    • after formatting you should get NodeMCU prompt >



<syntaxhighlight lang="bash">Early boot

$ miniterm.py /dev/ttyUSB0 74880

Program

$ miniterm.py /dev/ttyUSB0 115200

sometimes

$ miniterm.py /dev/ttyUSB0 9600

Flashing custom build nodemcu

./esptool.py -b 921600 write_flash -fm dio 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin


NodeMCU build

customization

app/include/user_config.h app/include/user_modules.h app/include/user_version.h</syntaxhighlight>


<syntaxhighlight lang="bash">triac_reg_pinout

0: GPIO16 (no pwm or interrupt!) 1: GPIO5 230 sense 2: GPIO4 triac out 3: GPIO0 (Special: Bootloader when low) 4: GPIO2 5: GPIO14 debug led 6: GPIO12 ws2812 4x4 array 7: GPIO13 8: GPIO15 RX: GPIO3 TX: GPIO1 A0:</syntaxhighlight>


<syntaxhighlight lang="bash">toggle(dir_pin)

slider_pinout

0: GPIO16 1: GPIO5 enable 2: GPIO4 direction 3: GPIO0 (Special: Bootloader when low) 4: GPIO2 debug led 5: GPIO14 step 6: GPIO12 ws2812 4x4 array 7: GPIO13 8: GPIO15 RX: GPIO3 TX: GPIO1 A0:</syntaxhighlight>