Search code examples
pythonyowsup

How to send simple message with yowsup


I'm trying to send a message to a whatsapp number with yowsup.

I was able to request a SMS and password.

But when I run:

yowsup-cli demos -d -c config_test -s "number" "Message test" -d

I'm getting this message and the message is not received:

yowsup-cli  v2.0.15
yowsup      v2.5.0

Copyright (c) 2012-2016 Tarek Galal
http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://openwhatsapp.org/yowsup/donate


DEBUG:yowsup.env.env:Env not set, setting it to android
DEBUG:yowsup.env.env:Current env changed to android 
DEBUG:yowsup.stacks.yowstack:Initializing stack
DEBUG:yowsup.stacks.yowstack:Constructed Network Layer
DEBUG:yowsup.stacks.yowstack:Constructed Stanza Regulator Layer
DEBUG:yowsup.stacks.yowstack:Constructed Crypt Layer
DEBUG:yowsup.stacks.yowstack:Constructed Coder Layer
DEBUG:yowsup.stacks.yowstack:Constructed Logger Layer
DEBUG:yowsup.stacks.yowstack:Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x10610d410>
DEBUG:yowsup.stacks.yowstack:Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x106105c90>
DEBUG:yowsup.stacks.yowstack:Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
DEBUG:yowsup.stacks.yowstack:Constructed Interface Layer
DEBUG:yowsup.layers.network.layer:Connecting to e14.whatsapp.net:443
DEBUG:yowsup.layers.logger.layer:tx:
<stream:features>
</stream:features>

DEBUG:yowsup.layers.logger.layer:tx:
<auth passive="true" user="xxxxxx" mechanism="WAUTH-2">
</auth>

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

DEBUG:yowsup.layers.logger.layer:rx:
<challenge>
i????????
         5?St
HEX:69ed861f809a171988c1dbc9e50b35bb531c0e74
</challenge>

DEBUG:yowsup.layers.logger.layer:tx:
<response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
L5?wwn?ǔ?t?????cZ??}҇o?h?Z?@#???zj?.??????}[=??8?k?r0??
                                                      ?
$K??d??}
HEX:134c351c8877776ea0c794e374f996f7bebd635a00cdf07d02d2876ff0b768bc5afd4023fdbed57a6a942eb899888103f2f77d1a5b3d16fde138b66b9a157230fd018f0b850a244bedebb664c7f67d
</response>

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

Solution

  • i like to try this command hope it will work for you too

    yowsup-cli demos -c config_test -s "number" "Message test"
    

    and in addition don't use -d everywhere its only for the debugging log