Monday, 23 August 2021

ESP8266 setup

ESP8266 setup

This page captures our experience beginning to work with esp8266. The very first readings and setting up of the environment to write and run code. 

esp8266 datasheet notes

  1. wifi-adapter via SPI/SDIO or UART
  2. has memories: flash, cache, sram, rom
  3. overview, wifi-features: not clear
  4. memory: iBus, dBus, aMB interface?
  5. AT firmware: access point (AP) = server, station (STA) = client, can act as BOTH
Did not gain much understanding from the datasheet.
Many other documents from espressif site (mentioned towards the end in datasheet). Not much useful.


ESP modules understandingwe have esp-01 and nodemcu (based on esp-12)




First link that started making sense from Hackaday

The most important link on getting started from Espressif official website

Computer OS used is Mac OS Catalina v10.15.6

Installed python v3.8.5
Installed esptool v2.8 (may not be required since part of RTOS but gave early ping with both modules)
Installed CP2102 driver v5.3.5

Python version problem: already installed system version 2.7, new installed from web version 3.8; Commands were using older version despite new being there. Lot of commands failing.
Solution: put /usr/local/bin in PATH and before the older python path (usr/bin) for that session of terminal

For the current shell session


export IDF_PATH=$HOME/..../esp_toolchain/ESP8266_RTOS_SDK


export PATH=/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/CrossPack-AVR/bin:/Users/sumeetsharma/Documents/.../esp_toolchain/xtensa-lx106-elf/bin


>> can put above 2 lines in ~/.zshrc (using nano ~/.zshrc) and each time on terminal activate the file by typing ". ~/.zshrc" (note the space after first dot)


To check the serial port number of the esp board, type on command line - ls /dev/*

Nodemcu serial port: /dev/cu.usbserial-0001


ESP8266 RTOS SDK API guide

API reference


To compile and flash the program

  1. copy the project folder under esp_toolchain folder
  2. make menuconfig. Update Serial Flasher Config -> Default Serial port -> /dev/cu.usbserial-0001. Save into new config file and exit
  3. make flash. This will compile and flash the program to the board
  4. make monitor. To exit - control + ]

No comments:

Post a Comment