I’ve been running a Google Hangouts bot on Smack 4.1 for a few years on my RaspberryPi. (It uses an @gmail.com account.) The bot was down for a few months due to another issue, which I just fixed. Unfortunately, it now won’t log in to talk.google.com. Should I upgrade to Smack 4.3 or is there another issue here that I need a fix for?
Here’s the error I’m getting now:
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: No filter used or filter was 'null'.
at org.jivesoftware.smack.SmackException.....
I tried to change the timeout length, but it still says 5000 ms. Here’s the code I’m using to try to log in:
XMPPTCPConnectionConfiguration.Builder configurationBuilder = XMPPTCPConnectionConfiguration.builder();
configurationBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
configurationBuilder.setUsernameAndPassword(userName, password);
configurationBuilder.setCompressionEnabled(false);
configurationBuilder.setServiceName("gmail.com");
configurationBuilder.setPort(port);
configurationBuilder.setHost("talk.google.com"); //gmail.com
configurationBuilder.setConnectTimeout(15000);
this.configuration = configurationBuilder.build();
SASLAuthentication.registerSASLMechanism(new SASLXOauth2Mechanism());
this.connection = new XMPPTCPConnection(this.configuration);
this.connection.setUseStreamManagement(false);
this.connection.setUseStreamManagementResumption(false);
System.out.println(" Connecting to the Google Hangouts server...");
this.connection.connect(); /* Connect to the XMPP sever */
System.out.println(" Connection to Google Hangouts server made...");
...
It fails on the call to connect().
Do I need to reconfigure everything to work with Smack 4.3, or will that not help? Is there some completely different solution I should be looking for?
I don’t see anything about them canceling XMPP support in the past six months or so. Is there a link to something about this?
I guess I need to decide where to go from here. What’s my best option for migrating things? I’m not sure I’m aware of all the options. Can I still use Smack through something like Jabber?
Okay, that makes sense (and only goes to show how little I know about the actual names of the different technologies). How else can I host/register my bot in a useable way? In the past, I would talk to my bot via my normal Google account.
You would need a XMPP server, either some public or hosted by you. You can then have an account on this server and talk with your bot with that account, i guess.
Update:
This started working again and I’m not sure why. I was able to extend the timeout length using a separate method: Connection.setPacketReplyTimeout. I extended that to longer, but the times when it’s connected, it doesn’t seem to have mattered. Instead, it seems to be connecting once quickly and easily, but if it doesn’t take on the first try, it will take longer on subsequent tries.
Both of the times it’s made a successful connection, it’s the first connection attempt I tried that morning. I would experiment with it more, but I don’t want it to come down and not be able to get it back up.
I learned here that Google isn’t using XMPP anymore, but Smack is still working with talk.google.com, so it’s still working as a way for me to launch the bot.
It is a common misconception that Google “is not using XMPP anymore”. What they IIRC did is disabling XMPP federation, but the XMPP interface is (obviously) still there.
That said, it is not clear how it continues to be there.