Weather Station is composed of:
- Main base:
- ESP8266 nodeMCU v3
- waveshare e-paper 4.2" screen
- Nodes:
- ESP8266 nodeMCU v3
- BME/BMP 280 sensors
- 32x128px I2C OLED screen
Download micropython firmware:
wget http://micropython.org/resources/firmware/esp8266-20191220-v1.12.bin -O micropython.bin
Or compile it from source:
Setup a virtual env:
pip3 install virtualenv
virtualenv weatherstation
source weatherstation/bin/activate
Install dependencies:
pip3 install esptool
Flash micropython:
esptool.py --port /dev/tty.usbserial-14430 erase_flash
esptool.py --port /dev/tty.usbserial-14430 --baud 460800 write_flash --flash_size=detect 0 micropython.bin
Using serial USB interface
minicom -D /dev/tty.usbserial-14440 -b 115200
Install ampy:
pip3 install ampy
Create hello world:
cat <<EOF > blink.py
import machine
import time
pin = machine.Pin(2, machine.Pin.OUT)
while True:
print("blinking")
pin.on()
time.sleep(1)
pin.off()
time.sleep(1)
EOF
Ensuure to quit minicom Then, flash your program:
ampy --port /dev/tty.usbserial-14440 -b 115200 put blink.py /blink.py
ampy --port /dev/tty.usbserial-14440 -b 115200 run blink.py