Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] About synchronous use of MqttAndroidClient

Done! two bugs filed.

Regards.

2015-07-31 18:54 GMT+02:00 Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx>:
I'd rather have a bug because it helps us to remember what needs to be looked at, whatever the outcome.

Ian


On 07/31/2015 04:52 PM, Manuel Domínguez Dorado wrote:

Hi,

Great news. Ok, i'll raise a bug. However I was asking to avoid creating a new issue if I'm wrong.

Thank you so much.

El 31/07/2015 15:53, "Ian Craggs" <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> escribió:
Hi Manuel,

recently we've got some new help on the project, James, who I've asked to start looking at the Android code, along with the Java client.  He's been getting familiar with it this week, but is on vacation next week.

When he gets back I intend that we make a good attempt at testing and fixing these situations.  In the meantime, you could help us by raising a bug, if there isn't one already.

Thanks.

Ian


On 07/31/2015 01:23 PM, Manuel Domínguez Dorado wrote:
Hi Ian and the rest,

some news about this?

Also, I've discovered another thing that is very anoying. I'm developing now a set of methods to deal with abnormal situations like disconnections, timeouts, keepalive expirations... and I have discovered that after a timeout, the android service goes down. These are the messages:

----------------------------
07-31 13:56:53.540    2026-2026/com.enzinatec.sexcheer E/ClientState﹕ manolodd-1403284640: Timed out as no activity, keepAlive=180,000 lastOutboundActivity=1,438,343,613,756 lastInboundActivity=1,438,343,430,399 time=1,438,343,813,539 lastPing=1,438,343,613,756
07-31 13:56:53.541    2026-2026/com.enzinatec.sexcheer D/AlarmPingSender﹕ Failure. Release lock(MqttService.client.manolodd-1403284640):1438343813541
07-31 13:56:53.542    2026-2026/com.enzinatec.sexcheer D/AlarmPingSender﹕ Unregister alarmreceiver to MqttServicemanolodd-1403284640
----------------------------

I can see this logic in http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/tree/org.eclipse.paho.android.service/org.eclipse.paho.android.service/src/org/eclipse/paho/android/service/AlarmPingSender.java

However, althoug a disconnection has been detected due to a timeout expiration, the connectionLost(...) callback is not triggered. Hence, I'm not able to detect the moment when the MQTT has been lost to send a notification to the user and/or start a reconnect logic (I've one that goes well but requires a disconnection detection).

Am I doing something wrong? Is there any asynchronous way of detecting a timeout expiration?

Regards.



2015-05-13 0:33 GMT+02:00 Manuel Domínguez Dorado <manolodd@xxxxxxxxx>:

Hi Jeff, thank you so much. However I've not problem with MqttClient or MqttAsyncClient (I use the token fine on this one). My problem is using MqttAndroidClient toguether with Mqtt Android Service.

I started to create my own android service using MqttClient and MqtAsyncClient but started to use the MqttService of paho to reuse code and not to reinvent the wheel. But it is being very problematic :-(. I'm having lots of issues that I didn't have before when I was programming my own service. I'm supossing, of course, that MqttAndroidClient works fine, although I've found some of my problems in the paho android service sample app.

I'll continue investigating. Thanks again.

El 13/05/2015 00:22, "Jeff Prestes" <jeffprestes@xxxxxxxxx> escribió:
Hi Manuel,

The workaround I've created to fix this use Thread.sleep(100) to give the mobile app time to process instead of use waitForCompletion. Also, I use MqttClient instead of MqttAsyncClient and perform some isConnected checks to avoid Exceptions. 

You can try it until better solution is being built.

If you want to check an example that works for me, you can check this code out: 

I hope it might help you.

Cheers,

-Jeff Prestes

2015-05-12 19:18 GMT-03:00 Manuel Domínguez Dorado <manolodd@xxxxxxxxx>:

Than you so much Ian. I'll try to inspect the MqttAdroidClient source code myself. However if somebody has the same problem, pleas let us know.

Kindest regards.

El 13/05/2015 00:07, "Ian Craggs" <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> escribió:
Hi Manuel,

I've not been able to look at the Android client yet.  I should be getting some more help soon which will enable us to answer questions such as yours.

Ian

On 05/12/2015 02:16 PM, Manuel Domínguez Dorado wrote:
Hi all,

I've benn trying to use MqttAndroidClient in a synchronous way by controlling the IMqttToken that its methods return. But each time I use:

IMqttToken.waitForCompletion(long timeout) 

the timeout expires and a MqttException is thrown. However, most of the times the operations have been done fine. Does anyone have the same problem? Is the MqttAndroidClient supposed to work as the traditional MqttAsyncClient in relation to IMqttToken handling?

Regards.
--
---
Manuel Domínguez Dorado
ingeniero ARROBA ManoloDominguez PUNTO com
http://www.ManoloDominguez.com


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev




--
---
Manuel Domínguez Dorado
ingeniero ARROBA ManoloDominguez PUNTO com
http://www.ManoloDominguez.com


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



--
---
Manuel Domínguez Dorado
ingeniero ARROBA ManoloDominguez PUNTO com
http://www.ManoloDominguez.com

Back to the top