Files
identity-micropython-tag/node_sensor.py

21 lines
658 B
Python

# ============================================================+
# Identity IoT — Node: Sensor
# (c) Copyright : ae Aeonian Engineering Limited - Hong Kong
# (c) Copyright : WIDE di D. Papa - Naples - Italy
# ============================================================+
import utime
def run_sensor(cfg, caps):
"""Main loop for sensor node type. Called from boot_manager."""
print('[sensor] starting — sensor:', caps.get('has_sensor'))
# TODO: read DHT22 / other sensor
# TODO: POST readings to backend via AES channel
# TODO: polling interval from cfg
while True:
print('[sensor] polling...')
utime.sleep(10)