You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Tasker to try to implement presence detection for my home assistant controller, by sending MQTT messages via the mqttclpro tasker plugin when I'm connected/disconnected from my home Wifi.
I have a mosquitto server, and it's reachable from the public internet, and hence, from my 4G connection. I can try running the tasker task that trigger sending messages manually, and it work, both when I'm on Wifi, and when I'm on 4G only - messages are received by the mosquitto server.
However, when sending of messages are triggered by an actual WiFi connect/disconnect, things are different. The messages about connecting to the WiFi are fine, they are received by the server, but the messages about disconnecting are somehow lost.
It does seem like if I insert a wait of 15 seconds before sending the MQTT message about being away, the message does get through. But that's not so elegant.
This is on Android 8.1.0, on a OneplusFive (OnePlus A5000). Tasker 4.6, MQTT Client 4.0.
I have adb configured so I can do logcat. Here's some info from when I have a tasker task that tries to send a message immediately on Wifi disconnect, then waits 15 seconds, then tries another time:
10-28 20:22:50.364 848 848 I in.dc297.mqttclpro.activity.PublishActivity: Sending 335
(lot's of other messages about network connectivity here, don't think they are from mqtt)
10-28 20:22:50.540 848 848 I MqttConnection: Requesting Automatic reconnect using New Java AC
10-28 20:22:50.603 848 848 D StrictMode: StrictMode policy violation; ~duration=52 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65599 violation=1
10-28 20:22:50.603 848 848 D StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1386)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1056)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:565)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransactionUnchecked(SQLiteSession.java:319)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransaction(SQLiteSession.java:298)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:548)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive(SQLiteDatabase.java:483)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.android.sqlite.SqliteConnection.ensureTransaction(SqliteConnection.java:56)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.android.sqlite.BaseConnection.setAutoCommit(BaseConnection.java:188)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.ConnectionTransaction.begin(ConnectionTransaction.java:81)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:66)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:48)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:39)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:33)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityDataStore.update(EntityDataStore.java:240)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.reactivex.WrappedEntityStore$5.call(WrappedEntityStore.java:108)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.Single.subscribe(Single.java:2779)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.Single.blockingGet(Single.java:2213)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.setBrokerStatus(MQTTClients.java:568)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.access$000(MQTTClients.java:58)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients$2.onIntermediate(MQTTClients.java:409)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttTokenAndroid.notifyIntermediate(MqttTokenAndroid.java:133)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.simpleAction(MqttAndroidClient.java:1513)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.connectAction(MqttAndroidClient.java:1444)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.onReceive(MqttAndroidClient.java:1373)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
10-28 20:22:50.603 848 848 D StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
10-28 20:22:50.603 848 848 D StrictMode: at android.os.Looper.loop(Looper.java:164)
10-28 20:22:50.603 848 848 D StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6753)
10-28 20:22:50.603 848 848 D StrictMode: at java.lang.reflect.Method.invoke(Native Method)
10-28 20:22:50.603 848 848 D StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
10-28 20:22:50.603 848 848 D StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
10-28 20:22:50.603 848 848 D StrictMode: StrictMode policy violation; ~duration=48 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65599 violation=1
10-28 20:22:50.603 848 848 D StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1386)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1056)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:744)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
10-28 20:22:50.603 848 848 D StrictMode: at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.android.sqlite.SqlitePreparedStatement.executeUpdate(SqlitePreparedStatement.java:168)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityUpdateOperation$1.evaluate(EntityUpdateOperation.java:54)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityUpdateOperation$1.evaluate(EntityUpdateOperation.java:40)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.query.BaseScalar.value(BaseScalar.java:48)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityWriter.update(EntityWriter.java:632)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityWriter.update(EntityWriter.java:542)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.sql.EntityDataStore.update(EntityDataStore.java:243)
10-28 20:22:50.603 848 848 D StrictMode: at io.requery.reactivex.WrappedEntityStore$5.call(WrappedEntityStore.java:108)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.Single.subscribe(Single.java:2779)
10-28 20:22:50.603 848 848 D StrictMode: at io.reactivex.Single.blockingGet(Single.java:2213)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.setBrokerStatus(MQTTClients.java:568)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.access$000(MQTTClients.java:58)
10-28 20:22:50.603 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients$2.onIntermediate(MQTTClients.java:409)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttTokenAndroid.notifyIntermediate(MqttTokenAndroid.java:133)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.simpleAction(MqttAndroidClient.java:1513)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.connectAction(MqttAndroidClient.java:1444)
10-28 20:22:50.603 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.onReceive(MqttAndroidClient.java:1373)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
10-28 20:22:50.603 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
10-28 20:22:50.603 848 848 D StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
10-28 20:22:50.603 848 848 D StrictMode: at android.os.Looper.loop(Looper.java:164)
10-28 20:22:50.603 848 848 D StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6753)
10-28 20:22:50.603 848 848 D StrictMode: at java.lang.reflect.Method.invoke(Native Method)
10-28 20:22:50.603 848 848 D StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
10-28 20:22:50.603 848 848 D StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
10-28 20:22:50.615 848 2135 E StrictMode: null
10-28 20:22:50.615 848 2135 E StrictMode: java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage
10-28 20:22:50.615 848 2135 E StrictMode: at android.os.StrictMode.onUntaggedSocket(StrictMode.java:2012)
10-28 20:22:50.615 848 2135 E StrictMode: at com.android.server.NetworkManagementSocketTagger.tag(NetworkManagementSocketTagger.java:78)
10-28 20:22:50.615 848 2135 E StrictMode: at libcore.io.BlockGuardOs.tagSocket(BlockGuardOs.java:47)
10-28 20:22:50.615 848 2135 E StrictMode: at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:310)
10-28 20:22:50.615 848 2135 E StrictMode: at libcore.io.IoBridge.socket(IoBridge.java:667)
10-28 20:22:50.615 848 2135 E StrictMode: at java.net.PlainSocketImpl.socketCreate(PlainSocketImpl.java:116)
10-28 20:22:50.615 848 2135 E StrictMode: at java.net.AbstractPlainSocketImpl.create(AbstractPlainSocketImpl.java:98)
10-28 20:22:50.615 848 2135 E StrictMode: at java.net.Socket.createImpl(Socket.java:484)
10-28 20:22:50.615 848 2135 E StrictMode: at java.net.Socket.connect(Socket.java:614)
10-28 20:22:50.615 848 2135 E StrictMode: at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:83)
10-28 20:22:50.615 848 2135 E StrictMode: at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:103)
10-28 20:22:50.615 848 2135 E StrictMode: at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701)
10-28 20:22:50.615 848 2135 E StrictMode: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
10-28 20:22:50.615 848 2135 E StrictMode: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-28 20:22:50.615 848 2135 E StrictMode: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-28 20:22:50.615 848 2135 E StrictMode: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-28 20:22:50.615 848 2135 E StrictMode: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-28 20:22:50.615 848 2135 E StrictMode: at java.lang.Thread.run(Thread.java:764)
10-28 20:22:50.616 2894 2894 E SCLibEventSink:HouseholdEventSink: Household was null, unable to unsubscribe
10-28 20:22:50.621 1369 21074 D WifiPermissionsUtil: Denied: no location permission
10-28 20:22:50.621 1369 21074 D WifiPermissionsUtil: Denied: WifiConfiguration is NULL.
10-28 20:22:50.996 848 2135 D AlarmPingSender: Register alarmreceiver to MqttServiceMqttService.pingSender.Eriks
10-28 20:22:51.005 848 2135 D AlarmPingSender: Schedule next alarm at 1540754631005
10-28 20:22:51.005 848 2135 D AlarmPingSender: Alarm scheule using setExactAndAllowWhileIdle, next: 60000
10-28 20:22:51.052 848 848 I in.dc297.mqttclpro.mqtt.internal.MQTTClients: broadcasting reconnected with tasker id: 1668830161
10-28 20:22:51.052 848 848 D StrictMode: StrictMode policy violation; ~duration=38 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65599 violation=1
10-28 20:22:51.052 848 848 D StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1386)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1056)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:565)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransactionUnchecked(SQLiteSession.java:319)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransaction(SQLiteSession.java:298)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:548)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive(SQLiteDatabase.java:483)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.android.sqlite.SqliteConnection.ensureTransaction(SqliteConnection.java:56)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.android.sqlite.BaseConnection.setAutoCommit(BaseConnection.java:188)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ConnectionTransaction.begin(ConnectionTransaction.java:81)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:66)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:48)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:39)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:33)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.EntityDataStore.update(EntityDataStore.java:240)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.reactivex.WrappedEntityStore$5.call(WrappedEntityStore.java:108)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.Single.subscribe(Single.java:2779)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.Single.blockingGet(Single.java:2213)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.setBrokerStatus(MQTTClients.java:568)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.access$000(MQTTClients.java:58)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients$1.connectComplete(MQTTClients.java:188)
10-28 20:22:51.052 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.connectExtendedAction(MqttAndroidClient.java:1491)
10-28 20:22:51.052 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.onReceive(MqttAndroidClient.java:1376)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
10-28 20:22:51.052 848 848 D StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
10-28 20:22:51.052 848 848 D StrictMode: at android.os.Looper.loop(Looper.java:164)
10-28 20:22:51.052 848 848 D StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6753)
10-28 20:22:51.052 848 848 D StrictMode: at java.lang.reflect.Method.invoke(Native Method)
10-28 20:22:51.052 848 848 D StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
10-28 20:22:51.052 848 848 D StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
10-28 20:22:51.052 848 848 I in.dc297.mqttclpro.mqtt.internal.MQTTClients: broadcasting reconnected with tasker id: 1668830161
10-28 20:22:51.052 848 848 D StrictMode: StrictMode policy violation; ~duration=38 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65599 violation=1
10-28 20:22:51.052 848 848 D StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1386)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1056)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:565)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransactionUnchecked(SQLiteSession.java:319)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteSession.beginTransaction(SQLiteSession.java:298)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:548)
10-28 20:22:51.052 848 848 D StrictMode: at android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive(SQLiteDatabase.java:483)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.android.sqlite.SqliteConnection.ensureTransaction(SqliteConnection.java:56)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.android.sqlite.BaseConnection.setAutoCommit(BaseConnection.java:188)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ConnectionTransaction.begin(ConnectionTransaction.java:81)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:66)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.ThreadLocalTransaction.begin(ThreadLocalTransaction.java:48)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:39)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.TransactionScope.<init>(TransactionScope.java:33)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.sql.EntityDataStore.update(EntityDataStore.java:240)
10-28 20:22:51.052 848 848 D StrictMode: at io.requery.reactivex.WrappedEntityStore$5.call(WrappedEntityStore.java:108)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.Single.subscribe(Single.java:2779)
10-28 20:22:51.052 848 848 D StrictMode: at io.reactivex.Single.blockingGet(Single.java:2213)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.setBrokerStatus(MQTTClients.java:568)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients.access$000(MQTTClients.java:58)
10-28 20:22:51.052 848 848 D StrictMode: at in.dc297.mqttclpro.mqtt.internal.MQTTClients$1.connectComplete(MQTTClients.java:188)
10-28 20:22:51.052 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.connectExtendedAction(MqttAndroidClient.java:1491)
10-28 20:22:51.052 848 848 D StrictMode: at org.eclipse.paho.android.service.MqttAndroidClient.onReceive(MqttAndroidClient.java:1376)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
10-28 20:22:51.052 848 848 D StrictMode: at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
10-28 20:22:51.052 848 848 D StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
10-28 20:22:51.052 848 848 D StrictMode: at android.os.Looper.loop(Looper.java:164)
10-28 20:22:51.052 848 848 D StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6753)
10-28 20:22:51.052 848 848 D StrictMode: at java.lang.reflect.Method.invoke(Native Method)
10-28 20:22:51.052 848 848 D StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
10-28 20:22:51.052 848 848 D StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
10-28 20:23:05.326 1369 1369 I NotificationService: Cannot find enqueued record for key: 0|in.dc297.mqttclpro|2000|null|10218
10-28 20:23:05.330 848 848 I in.dc297.mqttclpro.activity.PublishActivity: Sending 336
10-28 20:23:05.455 848 848 I in.dc297.mqttclpro.mqtt.internal.MQTTClients: Successfully Published
`
(I skipped a few duplicate StrictMode warnings)
So sending message 335 never gets the "Successfully Published" message, and indeed, never reaches the server.
Let me know if I can help by doing more logging and experiments.
The text was updated successfully, but these errors were encountered:
I'm using Tasker to try to implement presence detection for my home assistant controller, by sending MQTT messages via the mqttclpro tasker plugin when I'm connected/disconnected from my home Wifi.
I have a mosquitto server, and it's reachable from the public internet, and hence, from my 4G connection. I can try running the tasker task that trigger sending messages manually, and it work, both when I'm on Wifi, and when I'm on 4G only - messages are received by the mosquitto server.
However, when sending of messages are triggered by an actual WiFi connect/disconnect, things are different. The messages about connecting to the WiFi are fine, they are received by the server, but the messages about disconnecting are somehow lost.
It does seem like if I insert a wait of 15 seconds before sending the MQTT message about being away, the message does get through. But that's not so elegant.
This is on Android 8.1.0, on a OneplusFive (OnePlus A5000). Tasker 4.6, MQTT Client 4.0.
I have adb configured so I can do logcat. Here's some info from when I have a tasker task that tries to send a message immediately on Wifi disconnect, then waits 15 seconds, then tries another time:
`
(I skipped a few duplicate StrictMode warnings)
So sending message 335 never gets the "Successfully Published" message, and indeed, never reaches the server.
Let me know if I can help by doing more logging and experiments.
The text was updated successfully, but these errors were encountered: