How do you read MQTT data using a background service while main app is closed?

Register all events in your
bgMqttCheck procedure

Use the Notifier.LogInfo method as debug statements and use logcat to debug

You do not need the inner if statement it is wrong anyway (should be if not connected)

Write your MessageReceived event handler

EDIT: first prepare a simple example which is working in the foreground and show your working blocks so we can compare with your blocks from the background processing

Taifun

2 Likes