Yowsup: onMessage doesnt receive

Created on 11 Jun 2018  Â·  18Comments  Â·  Source: tgalal/yowsup

Hello, im facing a problem that is piccing me off.
Im just tring to receive messages. I have did it before, but simply stoped working. I wil put the code here, yesterday was working. But now, i send a message to the yowsup number and the onMessage event isnt triggerd.

`class ReadLayer(YowInterfaceLayer):
@EventCallback(YowNetworkLayer.EVENT_STATE_CONNECTED)
def onConnected(self, yowLayerEvent):
print "----- CONECTADO ----- \n"

@ProtocolEntityCallback("message")
def onMessage(self, messageProtocolEntity):
    if messageProtocolEntity.getType() == 'text':
        frm = messageProtocolEntity.getFrom()
        body = messageProtocolEntity.getBody()

        print ("- Mensagem de %s \n>>> %s \n\n" % (frm, body))

    if messageProtocolEntity.getType()  == 'media':
        if messageProtocolEntity.getMediaType() == 'image':
            frm = messageProtocolEntity.getFrom()
            url = messageProtocolEntity.url

            print ("- Imagem de %s \n>>> %s\n\n" % (frm, url))

    self.toLower(messageProtocolEntity.ack())
    self.toLower(messageProtocolEntity.ack(True))

@ProtocolEntityCallback("receipt")
def onReceipt(self, entity):
    self.toLower(entity.ack())`

Most helpful comment

Thanks @iamjagjeetubhi , but didnt solved the problem. I'ts also apearing in the log an ERROR:yowsup.layers.axolotl.layer_receive:Ignoring message with untrusted identity

@qeternity i dont think whatsapp killed because the core of the "violation" of yowsup is the possibility of automatize messageand dont read messages in another device.

I'm thinking thats something about the encriptation, something that we are missing or some bug created with recent updates on whatsapp. Only especulating here, the way to be sure is wait for more people come here and coment

All 18 comments

full log
`
DEBUG:yowsup.env.env:registered env android =>
DEBUG:yowsup.env.env:registered env s40 =>
DEBUG:yowsup.env.env:Env not set, setting it to s40
DEBUG:yowsup.env.env:Current env changed to s40
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
DEBUG:yowsup.stacks.yowstack:Constructed Axolotl Layer -
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 e9.whatsapp.net:443
DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:tx:

bn�����p���FP�P�+"�h��_��)p�҃l�*sG��n-�����n>���p
s
;����8FN�
HEX:11626e9a88bcc4fc708b8fb74650c750e52b22b868fccb015f9ea7297015ed04d2836c11a12a7347f5ba6e2d8ebdc9d2d26e3ee2eab67009080b731e3bc5ff9ba8380446114ee2

----- CONECTADO -----

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx:

���p.���pLt���
HEX:fc9800de1f702e82ffe10f06704c74c5b9c2c3c6

DEBUG:yowsup.layers.protocol_iq.layer:starting ping thread.
DEBUG:yowsup.layers.logger.layer:rx:



DEBUG:yowsup.layers.logger.layer:rx:





DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:





DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:





DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:





DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.protocol_iq.layer:ping queue size: 1
DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:

`

now i notice this line several times on debug
WARNING:yowsup.layers.axolotl.layer_receive:InvalidMessage or KeyId for xxxxxxxxxxx, going to send a retry
when login via cli raise the same warning
searched around, but nothing. already deleted axolotl.db

@williamneto I am receiving this same issue today, I think WhatsApp finally killed this

I have same problem @williamneto, the sending is normal, the receipt is locked, sometimes it returns to normal and then to again.

Hey just install these packeges:

sudo apt-get install build-essential autoconf libtool pkg-config python-pyrex idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-dev libssl-dev libffi6 libffi-dev

than apply the following commands in your YOWSUP directory:

sudo python setup.py build
sudo python setup.py install

Now again login and I hope it will fix your problem.

Thanks @iamjagjeetubhi , but didnt solved the problem. I'ts also apearing in the log an ERROR:yowsup.layers.axolotl.layer_receive:Ignoring message with untrusted identity

@qeternity i dont think whatsapp killed because the core of the "violation" of yowsup is the possibility of automatize messageand dont read messages in another device.

I'm thinking thats something about the encriptation, something that we are missing or some bug created with recent updates on whatsapp. Only especulating here, the way to be sure is wait for more people come here and coment

The same. "InvalidMessage or KeyId" on incoming but outgoing are ok. Removing ~/.yowsup/ and resetting to new password didn't help

You know... Eventually it was resolved on whatsapp side. Service were stormed for a couple of days and now it looks to be fine

pushed PR for new md5 classes https://github.com/tgalal/yowsup/pull/2518

guys, any news on this? we are experience the same issue.

@gauhoarg try removing .yowsup dir under home and restart app

nothing... everything start 2 days ago, it's stop replying messages, in the log we found that it was added to different groups, we get out the groups but it doesnt work. Today we have in the log a notification from WA about the groups and the same InvalidMessage or KeyId".....

We deleted the .yowsup, we send the AK for every notification, we deleted the database, etc and nothing...

Any idea?

It happened after I ran the code on other computer without having the same .yowsup

Power should join the lifting for the problem that is ready a help, not ready, not made in the problem, has not done to problem with keys.

It happened after I ran the code on other computer without having the same .yowsup

The same thing happened to me, running on Linux without passing the Windows key database

bellow is the exception code

except (InvalidMessageException, InvalidKeyIdException) as e:

    logger.warning("InvalidMessage or InvalidKeyIdException for %s, going to send a retry", encMessageProtocolEntity.getAuthor(False))

    from yowsup.layers.axolotl.protocolentities.iq_key_get import GetKeysIqProtocolEntity
    logger.info("Trying GetKeys for %s, getting keys now", encMessageProtocolEntity.getAuthor(False))
    entity = GetKeysIqProtocolEntity([encMessageProtocolEntity.getAuthor(False)])
    retry = RetryOutgoingReceiptProtocolEntity.fromMessageNode(node, self.store.getLocalRegistrationId())
    self.toLower(retry.toProtocolTreeNode())`

But i don't quite understand what's the purpose of entity object

So far I found 3 solutions.

  1. Send a receipt under the exception, pretending you received the message
  2. Send a random message to the sender
  3. login by whatsapp apk

@lok419 What to write in code

Was this page helpful?
0 / 5 - 0 ratings