joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
728 stars 244 forks source link

Script stops working if I lose internet connectivity while the script is running #25

Open abinash111 opened 8 years ago

abinash111 commented 8 years ago

Hi.

First of all, thanks for making the library. I would never have figured out how to use yowsup on my own.

I am running the script on a raspberry pi in headless mode. Internet connectivity is not that great here and when I lose my connection the script just stops working. Like, no error message, no exceptions, nothing.

Shouldn't this bit 'self.stack.loop(timeout=0.5, discrete=0.5)' produce an error/exception when the internet is down? I tried to add try/except around server.start() and wanted to exit the script, so that supervisor can restart the script. But the code never stops running.

Can't figure out why. Any help on the matter will be appreciated.

Thanks again!

x23piracy commented 8 years ago

Hi,

this is true there should be a way for the bot to detect if he has still a valid connection to the whatsapp server, if not restart himself (something like a watchdog for the bot).

Regards X23

joaoricardo000 commented 8 years ago

Hi @abinash111, glad to hear that the bot is running in a raspberry pi! That's really cool.

And yes, right now it does not restart when losing connection. As far as I understand yowsup, it should, but something is wrong. I'll let this issue open until I check it better.