Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
projects:internetofthings:micropython [2018/01/19 17:43] – created scipio | projects:internetofthings:micropython [2018/11/03 08:46] (current) – [led] scipio | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== micropython ====== | ====== micropython ====== | ||
- | ===== esptools ===== | + | ===== esptools |
< | < | ||
pip install esptool | pip install esptool | ||
+ | pip install adafruit-ampy | ||
</ | </ | ||
Line 11: | Line 12: | ||
esptool.py chip_id | esptool.py chip_id | ||
</ | </ | ||
+ | |||
+ | ===== esp32 ===== | ||
+ | |||
+ | Download firmware from http:// | ||
+ | |||
+ | erase flash (before any micropython deploy) | ||
+ | < | ||
+ | export PORT=/ | ||
+ | esptool.py --chip esp32 --port $PORT erase_flash | ||
+ | </ | ||
+ | |||
+ | write firmware | ||
+ | < | ||
+ | esptool.py --chip esp32 --port $PORT write_flash -z 0x1000 esp32-20181103-v1.9.4-683-gd94aa577a.bin | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== old ==== | ||
+ | |||
+ | Based on [[https:// | ||
+ | |||
+ | < | ||
+ | sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 https:// | ||
+ | cd MicroPython_ESP32_psRAM_LoBo | ||
+ | cd MicroPython_BUILD | ||
+ | ./BUILD.sh menuconfig | ||
+ | ./BUILD.sh | ||
+ | ./BUILD.sh flash | ||
+ | # reboot board disconnecting power | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | * download micropython from http:// | ||
+ | |||
+ | |||
+ | |||
+ | If you are putting MicroPython on for the first time then you should first erase the entire flash | ||
+ | < | ||
+ | esptool.py --port / | ||
+ | </ | ||
+ | |||
+ | |||
===== esp8266 ===== | ===== esp8266 ===== | ||
Line 16: | Line 64: | ||
download micropython from http:// | download micropython from http:// | ||
< | < | ||
- | wget http:// | + | wget http:// |
</ | </ | ||
erase (optional ?) and upload | erase (optional ?) and upload | ||
< | < | ||
- | esptool.py --port / | + | #esptool --port / |
- | esptool.py --port / | + | esptool --port / |
+ | |||
+ | # oppure | ||
+ | esptool --port / | ||
</ | </ | ||
+ | |||
+ | after press buttons !!!! | ||
access from serial over USB | access from serial over USB | ||
Line 49: | Line 102: | ||
reboot and connect to webrepl using http:// | reboot and connect to webrepl using http:// | ||
+ | |||
+ | ===== main ===== | ||
+ | |||
+ | < | ||
+ | ampy -p / | ||
+ | </ | ||
===== led ===== | ===== led ===== | ||
Line 56: | Line 115: | ||
# GPIO16 (D0) is the internal LED for NodeMCU | # GPIO16 (D0) is the internal LED for NodeMCU | ||
+ | # PIN 22 fro TTGO MINI32 | ||
led = Pin(16, Pin.OUT) | led = Pin(16, Pin.OUT) | ||
# The internal LED turn on when the pin is LOW | # The internal LED turn on when the pin is LOW | ||
while True: | while True: | ||
- | led.on() | + | led.value(not led.value()) |
- | sleep(1) | + | |
- | led.off() | + | |
sleep(1) | sleep(1) | ||
+ | #led.off() | ||
+ | #sleep(1) | ||
</ | </ | ||
+ | |||