| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
download latest micropython firmware for your board
on your host system install python3
install esptool, rshell, ampy on your host to communicate with esp32 board
# Example on Linux
sudo pip3 install esptool
sudo pip3 install rshell
sudo pip3 install adafruit-ampyconnect board via USB. Run command:
dmesg | grep ttythat will help to find ttyUSB connection port.This port will be used later for all communication operations
check board flash status. (In this example and below we assume that port=ttyUSB0)
esptool.py --port /dev/ttyUSB0 flash_iderase board flash before new firmware uploading
esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flashburn new firmware
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 [your esp32 firmware .bin]For board CLI access rshell can be used:
rshell --buffer-size=30 -p /dev/ttyUSB0after board prompt appears ">" you will have access to some board commands:
args cat connect echo exit filetype ls repl rsync
boards cd cp edit filesize help mkdir rm shell
repl command will start micropython interactive shell.
Also this shell can be used for board soft reboots(Ctrl+D).
Hard reboots can be done by board "RST" button.
export AMPY_PORT=/dev/ttyUSB0
ampy mkdir /lib
ampy put blynklib.py /lib/blynklib.py
ampy put test.py test.py
ampy run test.pyMicropython provides ability to compile source code into .mpy frozen module file. Main advantage of this that .mpy files will consume less RAM compared to raw Python .py source files
For .mpy file compilation you need:
git clone https://github.com/micropython/micropython.git
cd micropython/mpy-cross
make>>> import gc
>>> gc.collect()
>>> gc.mem_free()
2812256
./mpy-cross -X heapsize=2812256 blynklib.pyampy put blynklib.mpy /lib/blynklib.mpy# start of user script
import blynklibMicropython allows to use core network module for WiFi connection setup.
In script just place:
import network
WIFI_SSID = 'YourWifiSSID'
WIFI_PASS = 'YourWifiPassword'
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect(WIFI_SSID, WIFI_PASS)
# check if board connected
connect_status = wifi.isconnected()| Back | FazBrowse Home | New Git URL |