Skip to main content

How to compile micropython for esp8266 in fedora

· 2 min read

For Ubuntu/Debian (apt) see here.

Oh well, you have the prebuilded .bin here:

# 0. connect the esp8266 with USB
# 1. find and check the serial port
sudo dmesg | grep tty

# 2. check who can read write to the port
ls -l /dev/ttyUSB0

# 3. change owner and group of the serial port
sudo chown $USER:$USER /dev/ttyUSB0
# or simpler --> sudo chown $USER: /dev/ttyUSB0

# 4. download it
wget https://micropython.org/resources/firmware/ESP8266_GENERIC-20250911-v1.26.1.bin

# https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html#intro
# 5. flash the firmware
pip3 install esptool
esptool --port /dev/ttyUSB0 erase-flash

# 6. deploy the firmware
esptool --port /dev/ttyUSB0 write-flash -fm dio -fs 4MB -ff 40m 0x00000 ESP8266_GENERIC-20250911-v1.26.1.bin

# 7. verify, it fails cause of https://github.com/espressif/esptool/issues/265
esptool --port /dev/ttyUSB0 verify-flash 0x00000 ESP8266_GENERIC-20250911-v1.26.1.bin

check that works

VSCode extensions utils

  • Pymakr (best for ESP/MicroPython)
  • Serial Monitor (optional)
Use Pymakr for active coding
+ Auto-deployment
+ REPL for testing
+ File management

Use Serial Monitor alongside for:
+ Clean log viewing
+ Long-term monitoring
+ When Pymakr gets cluttered

add Pymakr

# 1. go to the pymakr plugin window and create new project
# - https://www.youtube.com/watch?v=YOeV14SESls
# 2. add device
# 3. check device connection using terminal (look the video)
import sys
sys.platform
# should give you your board name, for me 'esp8266'

configuration example

// pymakr.conf
{
"address": "/dev/ttyUSB0",
"sync_folder": "src"
}
{
"address": "/dev/ttyUSB0",
"sync_folder": "src",
"sync_file_types": "py,txt",
"ctrl_c_on_connect": true
}
import machine
import time

led_pin = machine.Pin(2, machine.Pin.OUT)

while True:
led_pin.value(1)
time.sleep(1)
led_pin.value(0)
time.sleep(1)

sources