import asyncio
import aiomqtt
async def main():
async with aiomqtt.Client("test.mosquitto.org") as client:
async with client.messages() as messages:
await client.subscribe("humidity/#")
async for message in messages:
print(message.payload)
#-- - ---- ----and the name is-->
if __name__ == "__main__":
asyncio.run(main())
or swapping out "test.mosquitto.org" with the crerdentials for my local mosuitto instance returns a timeout error message.
The relevant bits of info are:
Exception in callback AbstractEventLoop.add_reader(1028, <function Cli...001B19A0B16C0>)
handle: <Handle AbstractEventLoop.add_reader(1028, <function Cli...001B19A0B16C0>)>
Exception in callback AbstractEventLoop.add_writer(<socket.socke...93.94', 1883)>, <function Cli...001B19A0B1BC0>)
handle: <Handle AbstractEventLoop.add_writer(<socket.socke...93.94', 1883)>, <function Cli...001B19A0B1BC0>)>
Traceback (most recent call last):
File "C:\...\Python312\Lib\asyncio\events.py", line 84, in _run
self._context.run(self._callback, *self._args)
File "C:\...\Python312\Lib\asyncio\events.py", line 534, in add_reader
raise NotImplementedError
I've created a venv with 3.11.7, but it didn't make a difference.
handle: <Handle AbstractEventLoop.add_reader(828, <function Cli...002280436AB60>)>
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Program Files\Python311\Lib\asyncio\events.py", line 530, in add_reader
raise NotImplementedError
NotImplementedError
Exception in callback AbstractEventLoop.add_writer(<socket.socke...93.94', 1883)>, <function Cli...002280436AFC0>)
handle: <Handle AbstractEventLoop.add_writer(<socket.socke...93.94', 1883)>, <function Cli...002280436AFC0>)>
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Program Files\Python311\Lib\asyncio\events.py", line 536, in add_writer
raise NotImplementedError
Am i getting something worng? Happy to learn if so.
Otherwise- on which version of python should i be for aiomqtt to work properly? should i be on debian?
Trying just this:
or swapping out "test.mosquitto.org" with the crerdentials for my local mosuitto instance returns a timeout error message.
The relevant bits of info are:
I've created a venv with 3.11.7, but it didn't make a difference.
Am i getting something worng? Happy to learn if so. Otherwise- on which version of python should i be for aiomqtt to work properly? should i be on debian?