Instalasi
for windows
-
python-3.7.2-amd64.exe
-
install putty-0.73-installer.msi
-
install VSCodeUserSetup-x64-1.40.0.exe
-
install driver CH34x_Install_Windows_v3_4.EXE
for linux
- install virtual environment
python3 -m pip install --upgrade --user pip setuptools
python3 -m virtualenv ~/venv
source ~/venv/bin/activate
- install gtkterm or screen for serial monitor
sudo apt-get install gtkterm
sudo apt-get install screen
install tools for micropython with pip
- install esptool
pip install esptool
- install adafruit-ampy
pip install adafruit-ampy
burn firmware micropython to esp8266
esptool.py --port /dev/ttyUSB0 erase_flash
- cd "folder firmware"
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20190529-v1.11.bin
example put and run a progam
ampy -p COM8 put blink_led.py
- open serial monitor baudrate 115200 and type
import blink_led.py
test mqtt with paho-mqtt
test mqtt with paho-mqtt
- install
pip install paho-mqtt
- run
import paho.mqtt.publish as publish
publish.single("ruang_tamu", "led_on", hostname="192.168.43.165")