Skip to content

Commit d778ff4

Browse files
committed
lowpower: warn about issue 5152 and WiFi.
1 parent c5ed0c9 commit d778ff4

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

lowpower/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,15 @@ that they are on `sys.path`.
8585
* `mqtt_log.py` A publish-only MQTT application for Pyboard D. See below.
8686

8787
`mqtt_log.py` requires the `umqtt.simple` library. This may be installed with
88-
[upip_m](https://github.com/peterhinch/micropython-samples/tree/master/micropip).
88+
upip. See [Installing library modules](https://github.com/peterhinch/micropython-samples/tree/master/micropip).
8989
```
90-
>>> upip_m.install('micropython-umqtt.simple')
90+
>>> import upip
91+
>>> upip.install('micropython-umqtt.simple')
9192
```
93+
Owing to [this issue](https://github.com/micropython/micropython/issues/5152)
94+
this test is currently broken and I suspect that any usage of WiFi in low power
95+
mode will fail.
96+
9297
This test is "experimental". Pyboard D support for low power WiFi is currently
9398
incomplete. I have seen anomolous results where power was low initially before
9499
jumping to ~30mA after a few hours. The application continued to run, but the

lowpower/mqtt_log.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ async def main(loop):
5050
Latency(2000)
5151
count = 0
5252
while True:
53+
print('Publish')
5354
publish(ujson.dumps([count, rtc.datetime()]))
5455
count += 1
56+
print('Wait 2 mins')
5557
await asyncio.sleep(120) # 2 mins
5658
else: # Fail to connect
5759
red.on()

lowpower/rtc_time.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Power won't be saved if this is done.
2222
sleep_ms = utime.sleep_ms
2323

24-
d_series = uname().machine[:5] == 'PYBD_'
24+
d_series = uname().machine[:4] == 'PYBD'
2525
use_utime = True # Assume the normal utime timebase
2626

2727
if sys.platform == 'pyboard':
@@ -41,6 +41,9 @@
4141

4242
# For lowest power consumption set unused pins as inputs with pullups.
4343
# Note the 4K7 I2C pullups on X9 X10 Y9 Y10 (Pyboard 1.x).
44+
45+
# Pulling Pyboard D pins should be disabled if using WiFi as it now seems to
46+
# interfere with it. Although until issue #5152 is fixed it's broken anyway.
4447
if d_series:
4548
print('Running on Pyboard D')
4649
if not use_utime:

0 commit comments

Comments
 (0)