Commit 8ec01514 authored by Giacomo Lavermicocca's avatar Giacomo Lavermicocca

print - graphical enhacement

parent 7805f12b
# This file is executed on every boot (including wake-boot from deepsleep)
import esp
esp.osdebug(None)
import gc
gc.collect()
#import ccalendar
#ccalendar.getEvents("")
import cconnect
try:
cconnect.do_connect()
except Exception as e:
print("Error found in boot.py" + str(e))
# This file is executed on every boot (including wake-boot from deepsleep)
import esp
esp.osdebug(None)
import gc
gc.collect()
#import ccalendar
#ccalendar.getEvents("")
import cconnect
try:
cconnect.do_connect()
except Exception as e:
print("Error found in boot.py {0}".format(e))
import machine
machine.reset()
......@@ -4,35 +4,44 @@ import machine
import network
import gc
URL_SCRIPT = "https://script.google.com/macros/s/AKfycbyz55y8cdFmtX31yiOOuPn5SLGdGOuL6KvPOorfZZEmvzUppo0/exec"
print("Welcome to calendar events!!!")
def getEvents(param):
led = machine.Pin(2, machine.Pin.OUT)
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
ap_if.active(False)
try:
led = machine.Pin(2, machine.Pin.OUT)
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
ap_if.active(False)
while True:
text = "No events yet..."
while True:
text = "No events yet..."
if sta_if.isconnected() == True:
print("NEW REQUEST")
print(sta_if.ifconfig())
r = uurequests.get("https://script.google.com/macros/s/AKfycbyz55y8cdFmtX31yiOOuPn5SLGdGOuL6KvPOorfZZEmvzUppo0/exec")
print(r.text)
text = r.text
else:
import cconnect
cconnect.make_connect()
print("NEW REQUEST AFTER RECONNECT")
r = uurequests.get("https://script.google.com/macros/s/AKfycbyz55y8cdFmtX31yiOOuPn5SLGdGOuL6KvPOorfZZEmvzUppo0/exec")
print(r.text)
text = r.text
for i in range(120):
print("FreeMem" + str(gc.mem_free()))
led.on()
time.sleep(1)
led.off()
time.sleep(1)
print(text)
if sta_if.isconnected() == True:
print("NEW REQUEST")
print(sta_if.ifconfig())
r = uurequests.get(URL_SCRIPT)
print(r.text)
text = r.text
else:
import cconnect
cconnect.make_connect()
print("NEW REQUEST AFTER RECONNECT")
r = uurequests.get(URL_SCRIPT)
print(r.text)
text = r.text
for i in range(30):
print(".", end='')
if not text:
led.off()
else:
led.on()
time.sleep(1)
except Exception as e:
print("Error found in boot.py {0}".format(e))
import sys
print("Stacktrace -> {0}".format(sys.print_exception(e)))
machine.reset()
print("Welcome to calendar eventsssss")
def do_connect():
import network
import network
def make_connect():
print("No connecttion to router")
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
sta_if.connect('ssids', 'password')
while not sta_if.isconnected():
pass
print('network config:', sta_if.ifconfig())
print('connecting to network...')
sta_if.active(True)
sta_if.connect('Thomas', 'viapiccardi47!!thomas')
while not sta_if.isconnected():
pass
print('network config:', sta_if.ifconfig())
def do_connect():
make_connect()
import webrepl
webrepl.start()
import ccalendar
ccalendar.getEvents("")
ccalendar.getEvents("")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment