powered by Jive Software

Google Hangouts Bot on Smack 4.1


(This is mostly a copy of the Stack Exchange post I made a while back.)

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.setUsernameAndPassword(userName, password);
configurationBuilder.setHost("talk.google.com"); //gmail.com
this.configuration = configurationBuilder.build();

SASLAuthentication.registerSASLMechanism(new SASLXOauth2Mechanism());

this.connection = new XMPPTCPConnection(this.configuration);
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 thought google was shutdown xmpp, and is in the processes of shutting down hangouts…


Okay, this is exactly the kind of info I needed, thank you!

I found an article about them shutting down hangouts sometime next year: https://tech.slashdot.org/story/18/11/30/2157254/google-hangouts-for-consumers-will-be-shutting-down-sometime-in-2020

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?


at the top
We announced a new communications product, Hangouts, in May 2013. Hangouts will replace Google Talk and does not support XMPP.


If you mean XMPP/Jabber in general, then yes. Smack is a library to work with XMPP. Unless you mean some specific product/software called Jabber.


Okay, but I’d been using it successfully until the end of 2018. I’m not sure at what point it actually stopped working.


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.


That definitely makes it sound like I should look into other options first.