We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06b087f commit ab4e912Copy full SHA for ab4e912
2 files changed
12.network/server_base.py
@@ -9,6 +9,17 @@
9
10
# in your code
11
12
+ while True:
13
+ cl, addr = server.accept()
14
+ print('client connected from', addr)
15
+
16
+ buf = cl.recv()
17
18
+ if b'open' in buf:
19
+ print(b'open')
20
21
+ cl.send(buf)
22
+ cl.close()
23
finally:
24
# it will throw error OSError: [Errno 12] ENOMEM if your dont exec the code.
25
server.close()
13.system/watchdog.py
@@ -0,0 +1,8 @@
1
2
+import machine
3
4
+t = machine.WDT(0, 5) # init wdt 0, timeout 5s
5
6
+t.feed() # feed it
7
8
+t.delete() # close it
0 commit comments