-
Update raspberry pi
sudo apt update
-
Install mosquitto broker and client
sudo apt install mosquitto mosquitto-clients
-
Set mosquitto broker server to auto start after reboot.
sudo systemctl enable mosquitto.service
-
Upgarding the pip
python -m pip install --upgrade pip
-
Installing esptool and adafruit-ampy
pip install esptool
pip install adafruit-ampy
-
Downloding the latest MicroPython firmware (.bin file) from https://micropython.org/download/esp8266
-
Connect the ESP8266 device to computer and check the port (COM3 - for windows)
-
Open command prompt and using esptool.py erase the exiting firmware from flash memory of esp8266.
esptool.py --port COM3 erase_flash
-
write the downloaded firmware to esp8266
esptool.py --port COM3 write_flash --flash_size=detect 0 D:\ESP8266\esp8266-20210902-v1.17.bin
-
Use ampy to check the file system or transfer new python file to esp8266
ampy -p COM3 ls -l ----> To list down all the existing files from esp8266
ampy -p COM3 get [SOURCE_FILE_NAME] [DESTINATION_FILE_NAME] ---> Copy file from esp8266 to local machine
ampy -p COM3 put [FILE_NAME_WITH_PATH] ----> copy file to esp8266