Я не могу публиковать сообщения MQTT через несколько дней
Я использую "mqttasgi" как библиотеку с Django justo для прослушивания и постинга многих сообщений. Однако, по какой-то причине через несколько дней невозможно продолжать публиковать сообщения. Следует отметить, что я использую логин amazon с "mqttasgi" и уровень 1 QO (поскольку AWS не позволяет уровень 2 QO).
Это мой procfile
mqttasgi -H $MQTT_URL -p $MQTT_PORT -v 2 -C $TLS_CERT -K $TLS_KEY -S $TLS_CA iot_stracontech.asgi:application```
and this is my consumer.py
from mqttasgi.consumers import MqttConsumer из mqtt_handler.tasks import processmqttmessage import json
class MyMqttConsumer(MqttConsumer):
async def connect(self):
await self.subscribe('tpx/things/+/uplink', 0)
await self.channel_layer.group_add("stracontech", self.channel_name)
async def receive(self, mqtt_message):
print('Received a message at topic:', mqtt_message['topic'])
print('With payload', mqtt_message['payload'])
print('And QOS:', mqtt_message['qos'])
dictresult = json.loads(mqtt_message['payload'])
jsonresult = json.dumps(dictresult)
processmqttmessage.delay(jsonresult, mqtt_message['topic'])
pass
async def publish_results(self, event):
data = event['result']
await self.publish("stracontech/procesed/" + event['result']['device_id'] + "/result",
json.dumps(data).encode('utf-8'), qos=1, retain=False)
async def disconnect(self):
await self.unsubscribe('tpx/things/+/uplink')
I want to know if exist a way to know why does it stop publishing messages, anyway to do a debug or see the logs?
Pd: @Santiago Ivulich maybe you can give me a hand with that.