ECCI MicroPython Course. Follow these instructions to set up the environment.
Please install virtualenv just once on PC, see: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
If you have problems with wheels see: https://pythonwheels.com/
for windows install the drivers https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
-
Create a folder which will contain the project
-
Open it on VScode
-
Create a virtual enviroment with this line on VScode workspace (folder) terminal
python3 -m venv env
-
Activate the virtual environment
for linux use :
source env/bin/activate
for windows use (you also need to install powershell over VS):
.\env\Scripts\activate
-
Install pip request
pip3 install requests
-
Install ampy tool
pip3 install adafruit-ampy
-
Deactivate de ESP debug (through serial terminal prompt - baudrate 115200)
import esp esp.osdebug(None)
-
Create the script with main.py name and run it on ESP
ampy --port "here goes the port path" run main.py
-
Send the main.py file to ESP
ampy --port "here goes the port path" put main.py
-
(optional) if you want to read files from the ESP
ampy --port "here goes the port path" get "here goes the file name".py
-
when you finished the work of the day deactivate the virtual environment
deactivate
For further work sessions just activate an deactivate the virtual environment