|
|||||||
Установка micropython на ESP8266 и работа с ним под Linux (для
начинающих)
Время создания: 27.12.2023 19:55
Автор: alensav
Текстовые метки: Установка micropython на ESP8266
Раздел: ESPTOOL
Запись: alensav/MyTetra2/main/base/1703696142n85qxxpxe5/text.html на raw.githubusercontent.com
|
|||||||
|
|||||||
Моя лента Все потоки Разработка Администрирование Дизайн Менеджмент Маркетинг Научпоп RMavrichev 29 мар 2020 в 12:29 Установка micropython на ESP8266 и работа с ним под Linux (для начинающих) 3 мин19K Электроника для начинающих Из песочницы Привет, Хабр! Подготовка:
sudo apt install python3 python3-pip picocom
python --version Python 3.6.9
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
sudo pip3 install --upgrade pip pip --version pip 20.0.2 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6) pip3 --version pip 20.0.2 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
pip3 install esptool
esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.8 Serial port /dev/ttyUSB0 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: c8:2b:96:00:63:35 Uploading stub... Running stub... Stub running... Erasing flash (this may take a while)... Chip erase completed successfully in 9.5s Hard resetting via RTS pin...
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 Downloads/esp8266-20191220-v1.12.bin
esptool.py v2.8 Serial port /dev/ttyUSB0 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: c8:2b:96:00:63:35 Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Auto-detected Flash size: 4MB Flash params set to 0x0040 Compressed 619828 bytes to 404070... Wrote 619828 bytes (404070 compressed) at 0x00000000 in 9.1 seconds (effective 543.8 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin...
esptool.py --port /dev/ttyUSB0 --baud 460800 verify_flash --flash_size=detect 0 Downloads/esp8266-20191220-v1.12.bin
picocom /dev/ttyUSB0 -b115200 picocom v2.2 port is : /dev/ttyUSB0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, Type [C-a] [C-h] to see available commands Terminal ready >>> help() Welcome to MicroPython! For online docs please visit http://docs.micropython.org/en/latest/esp8266/ . For diagnostic information to include in bug reports execute 'import port_diag'. Basic WiFi configuration: import network sta_if = network.WLAN(network.STA_IF); sta_if.active(True) sta_if.scan() # Scan for available access points sta_if.connect("<AP_name>", "<password>") # Connect to an AP sta_if.isconnected() # Check for successful connection # Change name/password of ESP8266's AP: ap_if = network.WLAN(network.AP_IF) ap_if.config(essid="<AP_NAME>", authmode=network.AUTH_WPA_WPA2_PSK, password="<password>") Control commands: CTRL-A -- on a blank line, enter raw REPL mode CTRL-B -- on a blank line, enter normal REPL mode CTRL-C -- interrupt a running program CTRL-D -- on a blank line, do a soft reset of the board CTRL-E -- on a blank line, enter paste mode For further help on a specific object, type help(obj) >>>
sudo apt install python3-tk sudo pip3 install thonny
Итого
Теги:
Хабы:
+1883
|
|||||||
Так же в этом разделе:
|
|||||||
|
|||||||
|