Skip to content

Instantly share code, notes, and snippets.

@halmartin
Created February 5, 2018 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halmartin/b5563b4c074ab92762dbbf6edf7a0693 to your computer and use it in GitHub Desktop.
Save halmartin/b5563b4c074ab92762dbbf6edf7a0693 to your computer and use it in GitHub Desktop.
MicroPython boot.py file, used on Wemos D1 mini temperature sensor
# This file is executed on every boot (including wake-boot from deepsleep)
import gc
gc.collect()
# connect to WiFi
import network
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect("MySSID","P4ssw0rd!")
from time import sleep
while not sta_if.isconnected():
sleep(1)
ap_if = network.WLAN(network.AP_IF)
ap_if.active(False)
from tempsens import TempSensReport
TempSensReport()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment