-
Hello, I am trying to route MQTT through Channels. However, when fetching the # consumers.py
class MqttConsumer(SyncConsumer):
def __init__(self): # this constructor is never called ...
super().__init__()
print(self.channel_layer)
print(self.channel_name)
def mqtt_msg(self, event):
print(event) # routing.py
application = ProtocolTypeRouter({
'mqtt': MqttConsumer
}) # send.py
async def send_message():
await channel_layer.send('mqtt', { 'type': 'mqtt.msg', 'text': 'test' }) I have tried both |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
My issue was closed without any feedback. How am I to provide helpful information to resolve this, seeing as no error messages are produced at all? The documentation of this project is sparse at best on how to implement MQTT, even though it says so on the introductory page. |
Beta Was this translation helpful? Give feedback.
-
Got it to work. |
Beta Was this translation helpful? Give feedback.
Got it to work.
asgiref
needed to be downgraded, the worker didn't instantiate properly.