Skip to content

Commit 44ba0b2

Browse files
committed
add RTC memory to page
1 parent 2196a95 commit 44ba0b2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/webswitch.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ <h1>Sonoff S20 - ESP Web Server</h1>
1818
<p><small>
1919
{wifi}<br>
2020
{ntp_sync}<br>
21-
{watchdog}
21+
{watchdog}<br>
22+
{rtc_memory}
2223
</small></p>
2324
<p><small>
2425
total: {total:.2f} KB, used: {alloc:.2f} KB, free: {free:.2f} KB<br>

src/webswitch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
import uasyncio as asyncio
77
import uos as os
88
import utime as time
9-
from leds import power_led
9+
from leds import power_led, relay
1010
from ntp import ntp_sync
1111
from watchdog import watchdog
1212
from wifi import wifi
13-
from leds import power_led, relay
1413

1514
rtc = machine.RTC()
1615
button_pin = machine.Pin(0, machine.Pin.IN)
@@ -32,6 +31,7 @@ def send_web_page(writer, message=''):
3231
wifi=wifi,
3332
ntp_sync=ntp_sync,
3433
watchdog=watchdog,
34+
rtc_memory=machine.RTC().memory(),
3535

3636
utc=rtc.datetime(),
3737
total=alloc + free,
@@ -130,7 +130,7 @@ def main():
130130
print('Wait for WiFi connection %s sec.' % s)
131131
time.sleep(s)
132132
s += 5
133-
133+
134134
print('Start webserver on %s...' % wifi.station.ifconfig()[0])
135135
loop = asyncio.get_event_loop()
136136

0 commit comments

Comments
 (0)