Tutotial: ESP8266 mini Wetterstation

Software installieren:


  • sudo apt-get install screen python-pip wget geany
  • sudo pip install adafruit-ampy
  • sudo pip install setuptools
  • sudo pip install esptool
  • sudo adduser MeinBenutzername dialout

Firmware flashen:


  • cd ~ 
  • mkdir esp8266
  • cd esp8266
  • mkdir firmware
  • cd firmware
  • wget http://wetter-ins-netz.de/downloads/esp8266-20170214-umqtt.bin
  • esptool.py --port /dev/ttyUSB0 erase_flash
  • sptool.py -p /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect -fm dio 0 firmware/esp8266-20170214-umqtt.bin

Treiber laden:


  • mkdir ~/esp8266/treiber 
  • cd ~/esp8266/treiber

 

  • wget https://github.com/catdog2/mpy_bme280_esp8266/blob/master/bme280.py
  • ampy --port /dev/ttyUSB0 put treiber/bme280.py

 

  • cd firmware
  • wget http://wetter-ins-netz.de/downloads/esp8266-20170214-umqtt.bin

 

  • wget https://github.com/adafruit/micropython-adafruit-ssd1306/releases/download/1.0.1/ssd1306.mpy
  • ampy --port /dev/ttyUSB0 put treiber/bme280.py

Erstes Testprogramm:


import time
print('Hello world! I can count:')
i = 1
while True:
  print(i)
  i += 1
  time.sleep(1.0)

Erstes Programm starten:


  • ampy --port /dev/ttyUSB0 run Programmname.py