See title
class TimeResource(resource.ObservableResource):
"""Example resource that can be observed. The `notify` method keeps
scheduling itself, and calles `update_state` to trigger sending
notifications."""
def __init__(self):
super().__init__()
self.handle = None
def notify(self):
self.updated_state()
self.reschedule()
def reschedule(self):
self.handle = asyncio.get_event_loop().call_later(5, self.notify)
def update_observation_count(self, count):
if count and self.handle is None:
print("Starting the clock")
self.reschedule()
if count == 0 and self.handle:
print("Stopping the clock")
self.handle.cancel()
self.handle = None
async def render_get(self, request):
payload = datetime.datetime.now().strftime("%Y-%m-%d %H:%M").encode("ascii")
return aiocoap.Message(payload=payload)
works with CONs:
Observe=1 in replicated req works tho:

See title
works with
CONs:Observe=1in replicated req works tho: