I am creating a live dashboard for race data where timings and other information will be published by multiple clients on a per lap basis. I am using Mosquitto as my broker. Guided by this solution I am able to subscribe to the different topics amd see the published results.
on_message received from lap_data QOS:0 retain:False - `{"LapCompleted": 32 ... }`
on_message received from weather_data QOS:0 retain:False - `{ "RelativeHumidity":0.449}
I have completed the channels chat tutorial and have Redis running on WSL.
Now, I would like to:
- add the received messages to the database
- update the view when a message is recieved.
I hoped to me able to add records via the on_message_callback but when I try to import the models into my MQTTClient.py file I get the following error:
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
If anyone was able to point me in the right directions for 1 & 2 I would be grateful.
Thank you.
MQTT is started via the app ready function
def ready(self):
if os.environ.get('RUN_MAIN'):
mqtt_client = MqttRemote()
mqtt_client.start()