Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run.py suddenly just closes #904

Closed
maxbethke opened this issue Jun 30, 2015 · 15 comments
Closed

run.py suddenly just closes #904

maxbethke opened this issue Jun 30, 2015 · 15 comments

Comments

@maxbethke
Copy link

Hello

I got the Problem that my run.py script just closes after some time as if the stack.loop() would not work properly.

OS: Raspbian (Debian)

Console:

pi@raspberrypi ~/yowsup/echoclient $ python run.py
No handlers could be found for logger "yowsup.stacks.yowstack"
pi@raspberrypi ~/yowsup/echoclient $

Thanks for ya help

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@alexandred
Copy link

This happens for me too. I'm kind of a newbie to Python so not really sure what's going on.

@maxbethke
Copy link
Author

I found out that my problem is that it disconnects after some time. I found this out by turning debug output on.

Now im trying to get the 'Keep Alive' working. In the Documentation its only said what to do to keep it alive but not what to import from where in order to make the keep alive work

See https://github.com/tgalal/yowsup/wiki/%5BLegacy%5D-Yowsup-Documentation Part 'Keep Alive'

@Dl0tt
Copy link
Contributor

Dl0tt commented Jun 30, 2015

check #689, #775#808 and #810.
keep alive is a legacy feqture, you're probably using yowsup 2 and the disconnections are very likely from ack receipts not being sent

@maxbethke
Copy link
Author

I did what jerryames did in #775. Didnt work for me too. Ill keep on trying the other issues's solutions

@Dl0tt
Copy link
Contributor

Dl0tt commented Jul 1, 2015

have you got these layers on your run.py

layers = (
EchoLayer,
(YowAuthenticationProtocolLayer, YowMessagesProtocolLayer, YowReceiptProtocolLayer, YowAckProtocolLayer, YowMediaProtocolLayer, YowIqProtocolLayer, YowCallsProtocolLayer),
YowAxolotlLayer,
YowLoggerLayer,
YowCoderLayer,
YowCryptLayer,
YowStanzaRegulator,
YowNetworkLayer
)

also, have you got this in your layer.py

@ProtocolEntityCallback("receipt")
def onReceipt(self, entity):
ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", entity.getType(), entity.getFrom())
self.toLower(ack)

@maxbethke
Copy link
Author

Much Thanks.
That worked for me. Had to import some more layers

@maxbethke
Copy link
Author

Welp, got a new problem now.

Log: http://pastebin.com/CJ1qBM83

run.py closes with this Error a few minutes after start

@NCS80
Copy link

NCS80 commented Jul 8, 2015

I still have this problem.

DEBUG:yowsup.layers.logger.layer:rx:
<stream:error>
<ack>
</ack>
</stream:error>

DEBUG:yowsup.layers.network.layer:Disconnected, reason: Connection Closed
DEBUG:yowsup.layers.network.layer:Disconnected, reason: Connection Closed

have tried the stuff with the extra layers.
I'm using developer branche, can this be a problem in that branche?

gr

@y3g0r
Copy link

y3g0r commented Aug 13, 2015

@Dl0tt , thanks a lot, your comment on 1 Jul solved this problem for me.
I checked a lot of related tickets here (#647 #648 #689 #775 #808 #810 #873 #886 #915 #921), but all what I should do is just include all specified layers and change

ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", "delivery", entity.getFrom())

which is given in layer.py step lV here Yowsup-2.0-Sample-app!
to

ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", entity.getType(), entity.getFrom())

P.S. @tgalal, can you change it in Yowsup-2.0-Sample-app! , or can somebody say me how can I change this in tutorial?

@y3g0r
Copy link

y3g0r commented Aug 13, 2015

P.P.S I've changed it

@poken1151
Copy link

Pulled the most recent changes, but still ends on an error here:

<stream:error>
<ack>
</ack>
</stream:error>

DEBUG:yowsup.layers.network.layer:Disconnected, reason: Connection Closed

@maxbethke
Copy link
Author

Yes I still got that Problem. Even tho I did it like @y3g0r suggested :(

@bossonaro
Copy link

I have this problem too.
I am testing this bellow:

  1. Add YowIqProtocolLayer in run.py:
layers = ( EchoLayer, (YowAuthenticationProtocolLayer, YowMessagesProtocolLayer,
               YowReceiptProtocolLayer, YowAckProtocolLayer,YowMediaProtocolLayer,
               YowIqProtocolLayer, YowCallsProtocolLayer), YowAxolotlLayer, ) +
               YOWSUP_CORE_LAYERS
  1. Change this too:
stack.loop()

to

stack.loop(timeout=0.5, discrete=0.5)

It works here!

@bossonaro
Copy link

Don't forget add import, ok!

from yowsup.layers.protocol_iq                import YowIqProtocolLayer

@bossonaro
Copy link

Add this one in layer.py:

 @ProtocolEntityCallback("iq")
    def onIq(self, entity):
        print(entity)

It works here too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants