[32_yowsup.pm] Whatsapp versenden (Mit Handy- oder Festnetznummer)

Begonnen von AHA1805, 01 Oktober 2014, 21:58:55

Vorheriges Thema - Nächstes Thema

Spartacus

Hallo,
ich kämpfe gerade auch mit der whatsApp Installation und der "old_version" Meldung bei der Registrierung mit:

python yowsup-cli registration -c /opt/yowsup-config/yowsup.config -r voice

Ich bin jetzt total verwirrt, welche Dateien, wie anzupassen sind.

Kann hier bitte noch einmal jemand Schritt für Schritt aufzeigen, welche Änderungen zu machen sind?
Danke,
Christian
Fhem-System: 1 x raspberry PI Typ B, 1 x enOcean PI Typ B | Enocean: PTM210, FMS61NP, FAM14, 2 x FSR14-4x, FTS14-EM | LaCrosse: 2 x TX29D über Jeelink V3 | 1-Wire: 2 x DS18B20 über DS9490R

Spartacus

Hallo,
ich habe mich erfolgreich registrieren können, allerdings bekomme ich beim Testen auf der Konsole sehr viele Fehler:

  File "/opt/yowsup-master/yowsup/layers/network/layer.py", line 110, in receive
    self.toUpper(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/stanzaregulator/layer.py", line 29, in                                                                                           receive
    self.processReceived()
  File "/opt/yowsup-master/yowsup/layers/stanzaregulator/layer.py", line 49, in                                                                                           processReceived
    self.toUpper(oneMessageData)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/auth/layer_crypt.py", line 65, in recei                                                                                          ve
    self.toUpper(payload)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/coder/layer.py", line 35, in receive
    self.toUpper(node)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/logger/layer.py", line 14, in receive
    self.toUpper(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_control.py", line 44, in                                                                                           receive
    self.toUpper(protocolTreeNode)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 194, in receive
    s.receive(data)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_send.py", line 64, in rec                                                                                          eive
    if not self.processIqRegistry(protocolTreeNode):
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 161, in processIqReg                                                                                          istry
    successClbk(protocolTreeNode, originalIq)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_base.py", line 65, in onS                                                                                          uccess
    sessionBuilder.processPreKeyBundle(preKeyBundle)
  File "/usr/local/lib/python2.7/dist-packages/axolotl/sessionbuilder.py", line                                                                                           166, in processPreKeyBundle
    .setOurIdentityKey(self.identityKeyStore.getIdentityKeyPair())\
  File "/opt/yowsup-master/yowsup/layers/axolotl/store/sqlite/liteaxolotlstore.p                                                                                          y", line 19, in getIdentityKeyPair
    return self.identityKeyStore.getIdentityKeyPair()
  File "/opt/yowsup-master/yowsup/layers/axolotl/store/sqlite/liteidentitykeysto                                                                                          re.py", line 30, in getIdentityKeyPair
    publicKey, privateKey = result
TypeError: 'NoneType' object is not iterable


Kann mir jemand sagen, was da nicht ok ist? Ich habe mich an die Anleitung im wiki gehalten. Ich verwende debian stretch.

Christian
Fhem-System: 1 x raspberry PI Typ B, 1 x enOcean PI Typ B | Enocean: PTM210, FMS61NP, FAM14, 2 x FSR14-4x, FTS14-EM | LaCrosse: 2 x TX29D über Jeelink V3 | 1-Wire: 2 x DS18B20 über DS9490R

Thoffi1978

Zitatich habe mich erfolgreich registrieren können, allerdings bekomme ich beim Testen auf der Konsole sehr viele Fehler

Wie hast du dich schlussendlich registrieren können?

Gruß
Hoffi

Spartacus

Hi,
habe einfach nur diese Anpassungen in der "/yowsup/env/env_android.py" gemacht:

_MD5_CLASSES = "w8cLtrYLTUQ8PIY5U5FL2Q=="

_VERSION = "2.18.253"
    _OS_NAME = "Android"
    _OS_VERSION = "4.3"
    _DEVICE_NAME = "endeavoru"
    _MANUFACTURER = "HTC"
    _BUILD_VERSION = "IMM76D"
    _AXOLOTL = True
...

Allerdings auch nur beim ersten Setup.

Ich habe mein Debian Stretch-Image für den Raspberry mindestens 3 x zurückgespielt und verschiedene yowsup-Anleitungen aus dem Web probiert ohne die o.a. Modifikationen erneut durchzuführen. Ich konnte mich dann jedes Mal mit meiner Festnetznummer ohne Probleme registrieren. Keine Ahnung warum das dann plötzlich ohne die o.a. Modifikationen geklappt hat. Ich habe die "Voice"-Variante probiert und mich anrufen lassen, da ich keine SMS auf dem Festnetzt empfangen kann. Nach der Registrierung habe ich das pw in die Konfig eingetragen und auf der Konsole versuch eine Message zu senden. Und dann kommen die beschriebenen Fehler

Das Problem mit den o.a. Fehlern scheinen auch andere Leute zu haben, und auch mit fhem nicht zusammenzuhängen. Bislang habe ich keine Lösung gefunden. Das fhem Modul ist bei mir noch nicht konfiguriert, da es schon auf Konsolen-Ebene nicht funzt.

Wenn hier jemand eine funktionierende Version für Stretch hat, dann bitte melden! Ich bin für jeden Tipp dankbar.

Christian
Fhem-System: 1 x raspberry PI Typ B, 1 x enOcean PI Typ B | Enocean: PTM210, FMS61NP, FAM14, 2 x FSR14-4x, FTS14-EM | LaCrosse: 2 x TX29D über Jeelink V3 | 1-Wire: 2 x DS18B20 über DS9490R

mba

also ich habs zum laufen bekommen

abweichend zum wiki Eintrag:
- zusätzlich apt install libffi-dev
- sowohl bei den pip wie auch bei den python befehlen musste ich explizit pip3 bzw. python3 nutzen
- nach dem entpacken von yowsup, in 2 dateien je 2 werte anpassen
/opt/yowsup/yowsup-master/yowsup/env/env_android.py
/opt/yowsup/yowsup-master/yowsup/env/env_s40.py

env_android.py
_MD5_CLASSES = " a "
_VERSION = " d "

env_s40.py
_VERSION = "e"
_TOKEN_STRING  = "b und c zusammensetzen{phone}"

die werte für a+d+e+b+c gibts hier
https://coderus.openrepos.net/whitesoft/whatsapp_scratch

env_android.py
_MD5_CLASSES = "0R9F4U5fzdwVvn06wLe1JA=="
_VERSION = "2.18.255"

env_s40.py
_VERSION = "2.16.12"
_TOKEN_STRING  = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1478194306452L{phone}"

dann
python3 setup.py build
python3 setup.py install

danach wie im wiki die registrierung fortsetzen
die Registrierung mit -E android
python3 yowsup-cli registration -c /opt/fhem/yowsup.config -r voice -E android
python3 yowsup-cli registration -c /opt/fhem/yowsup.config -R xxxxxx

testen ohne -E android
python3 yowsup-cli demos -c /opt/fhem/yowsup.config -s 49123456789 "Das ist ein Test"


grüße
MB
Tinkerboard für FHEM, Modbus RTU via RS485 mit Arduino Slaves, ZWAVE mit Razberry Modul

Spartacus

Hallo mba,
danke für Deine Anleitung. Ich werde mal testen und Feedback geben. Hast Du es auf einem Debian Stretch installiert?
Gruß,
Christian
Fhem-System: 1 x raspberry PI Typ B, 1 x enOcean PI Typ B | Enocean: PTM210, FMS61NP, FAM14, 2 x FSR14-4x, FTS14-EM | LaCrosse: 2 x TX29D über Jeelink V3 | 1-Wire: 2 x DS18B20 über DS9490R

heinzfo

#1626
Hallo Andre

Ist es möglich Log3 in das yowsup modul einzubauen?

Ich möchte auch nach dem Zeilenumbruch Einträge im Logfile mit einem notify triggern.

z.B.Zeile 2 oder 3 soll einen trigger auslösen

2018.08.30 18:45:24 3: WhatsApp: sending /image send 49123456789 123 ''
Exception in thread Thread-1:
Traceback (most recent call last):


Ich sehe gerade das es schon 18 Einträge mit Log3 im 32_yowsup.pm gibt.
Und einen mit Log 1 in line 130

Danke und Grüße
Heinz

Spartacus

Hallo mba,
ich habe versucht der Anleitung von Dir zu folgen, allerdings bin ich nicht sicher, ob ich alle Schritte korrekt ausgeführt habe, da ich immer zwischen wiki und Anleitung hin und herswitchen musste.


Ich denke, dass ich hier irgendwas fasch gemacht habe, denn mir ist nicht klar, auf welche Befehle Du das aus dem Wiki beziehst.

Zitatsowohl bei den pip wie auch bei den python befehlen musste ich explizit pip3 bzw. python3 nutzen

Auf jeden Fall bekomme ich jetzt schon bei der Registrierung Modul-Fehler:

File "yowsup-cli", line 368, in <module>
    if not parser.process():
  File "yowsup-cli", line 189, in process
    self.handleRequestCode(self.args["requestcode"], config)
  File "yowsup-cli", line 198, in handleRequestCode
    from yowsup.registration import WACodeRequest
  File "/opt/yowsup-master/yowsup/registration/__init__.py", line 1, in <module>
    from .coderequest import WACodeRequest
  File "/opt/yowsup-master/yowsup/registration/coderequest.py", line 3, in <module>
    from yowsup.common.tools import StorageTools, WATools
  File "/opt/yowsup-master/yowsup/common/tools.py", line 3, in <module>


Kannst Du die Befehle hier ggf. noch mal explizit auflisten? Irgendwo ist noch der Wurm drin.

Christian
Fhem-System: 1 x raspberry PI Typ B, 1 x enOcean PI Typ B | Enocean: PTM210, FMS61NP, FAM14, 2 x FSR14-4x, FTS14-EM | LaCrosse: 2 x TX29D über Jeelink V3 | 1-Wire: 2 x DS18B20 über DS9490R

mcmon

#1628
Hallo zusammen,

danke nochmals für die zusammenfassungen und Ergänzungen. Nach einigem Hin und Her habe ich es geschafft, mich zu registrieren. Device ist angelegt, wenn ich mich connecte, steht sowohl im State als auch im Internal Connected. Leider hält das nicht lange an bzw. wenn ich eine Nachricht senden möchte, erfolgt wieder ein Disconnect. Mein LOG:

2018.09.04 17:12:39 3: WhatsApp: sending /disconnect
2018.09.04 17:12:39 3: WhatsApp: Disconnected
2018.09.04 17:12:39 2: WhatsApp: setting $HOME to /opt/fhem
2018.09.04 17:12:39 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-config/yowsup.config --yowsup
2018.09.04 17:12:41 4: WhatsApp: parse: yowsup-cli  v2.0.15
yowsup      v2.5.7

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



2018.09.04 17:12:41 4: WhatsApp: parse: Yowsup Cli client
==================
Type /help for available commands


2018.09.04 17:12:41 4: WhatsApp: parse: [offline]:
2018.09.04 17:12:41 3: WhatsApp: sending /L
2018.09.04 17:12:41 3: WhatsApp: sending /presence available
INFO:yowsup.layers.axolotl.layer_control:Axolotl layer is generating keys
2018.09.04 17:12:42 4: WhatsApp: parse: Auth: Logged in!

2018.09.04 17:12:42 4: WhatsApp: parse: [connected]:[connected]:
ERROR:yowsup.layers.interface.interface:Stream Error type: xml-not-well-formed
{'xml-not-well-formed': None}

INFO:yowsup.layers.interface.interface:Initiating reconnect
2018.09.04 17:12:43 4: WhatsApp: parse: general: Disconnected: Requested
[connected]:


Kann mir da jemand weiterhelfen?

Besten Dank & viele Grüße
Simon

Edit 21:20 Uhr:

ich habe im terminal direkt im yowsup client die Befehle abgesetzt - da kommen die Nachrichten an:

fhem@raspberrypi:/opt/yowsup-master$ /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-config/yowsup.config --yowsup   (ist auch mein CMD im Device Whatsapp)

Yowsup Cli client
==================
Type /help for available commands

[offline]:/L
Auth: Logged in!
[connected]:/presence available
[connected]:/message send 4915253xxxx asdfasd

Jetzt bin ich wirklich überfragt - was mach ich in fhem falsch?

sparkiie

#1629
Bei mir ist die Registrierung durch, allerdings musste ich bei beiden Schritten (Anruf und Schlüsselregistrierung) -E android nutzen.
Wenn ich nun eine Nachricht sende passiert folgendes!

python yowsup-cli demos -c /opt/yowsup-config/yowsup.config -s 4917112345678 "Das ist ein Test"

yowsup-cli  v2.0.15
yowsup      v2.5.7

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


INFO:yowsup.layers.axolotl.layer_control:Axolotl layer is generating keys
Traceback (most recent call last):
  File "yowsup-cli", line 368, in <module>
    if not parser.process():
  File "yowsup-cli", line 272, in process
    self.startSendClient()
  File "yowsup-cli", line 324, in startSendClient
    stack.start()
  File "/opt/yowsup-master/yowsup/demos/sendclient/stack.py", line 31, in start
    self.stack.loop()
  File "/opt/yowsup-master/yowsup/stacks/yowstack.py", line 197, in loop
    asyncore.loop(*args, **kwargs)
  File "/usr/lib/python2.7/asyncore.py", line 216, in loop
    poll_fun(timeout, map)
  File "/usr/lib/python2.7/asyncore.py", line 156, in poll
    read(obj)
  File "/usr/lib/python2.7/asyncore.py", line 87, in read
    obj.handle_error()
  File "/usr/lib/python2.7/asyncore.py", line 83, in read
    obj.handle_read_event()
  File "/usr/lib/python2.7/asyncore.py", line 449, in handle_read_event
    self.handle_read()
  File "/opt/yowsup-master/yowsup/layers/network/layer.py", line 102, in handle_read
    self.receive(data)
  File "/opt/yowsup-master/yowsup/layers/network/layer.py", line 110, in receive
    self.toUpper(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/stanzaregulator/layer.py", line 29, in receive
    self.processReceived()
  File "/opt/yowsup-master/yowsup/layers/stanzaregulator/layer.py", line 49, in processReceived
    self.toUpper(oneMessageData)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/auth/layer_crypt.py", line 65, in receive
    self.toUpper(payload)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/coder/layer.py", line 35, in receive
    self.toUpper(node)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/logger/layer.py", line 14, in receive
    self.toUpper(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_control.py", line 44, in receive
    self.toUpper(protocolTreeNode)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 194, in receive
    s.receive(data)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_send.py", line 64, in receive
    if not self.processIqRegistry(protocolTreeNode):
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 161, in processIqRegistry
    successClbk(protocolTreeNode, originalIq)
  File "/opt/yowsup-master/yowsup/layers/axolotl/layer_base.py", line 65, in onSuccess
    sessionBuilder.processPreKeyBundle(preKeyBundle)
  File "/usr/local/lib/python2.7/dist-packages/axolotl/sessionbuilder.py", line 166, in processPreKeyBundle
    .setOurIdentityKey(self.identityKeyStore.getIdentityKeyPair())\
  File "/opt/yowsup-master/yowsup/layers/axolotl/store/sqlite/liteaxolotlstore.py", line 19, in getIdentityKeyPair
    return self.identityKeyStore.getIdentityKeyPair()
  File "/opt/yowsup-master/yowsup/layers/axolotl/store/sqlite/liteidentitykeystore.py", line 30, in getIdentityKeyPair
    publicKey, privateKey = result
TypeError: 'NoneType' object is not iterable

heinzfo

#1630
In Log steht das ein key generiert wird.
Das ist beim aller ersten senden einer message normal.
Nach einem reconnect deiner WhatsApp/yowsup definition sollte es aber funktionieren.

sparkiie

#1631
Ich habe WhatsApp/yowsup in fhem definiert und konnte eine Nachricht empfangen und auch senden. Leider jedoch funktionierte das ganze nur einmal, seit wechselt der Status ständig zwischen connected disconnected und offline.

MCh76

nachdem hier so lange niemand mehr etwas geschrieben hat:
gibt es in jüngster zeit erfahrungen bzw. tipps wie man das ganze zum laufen bekommt?
hat es jemand geschafft in den letzten wochen/monaten?

VG,
Chris

perseusarm

Ja, ich  ;D

Ich steige grade um vom Raspi auf einen NUC mit Ubuntu 18 und habe lange mit Pfaden und Berechtigungen gekämpft, aber jetzt läuft´s.
Ich habe mir damals nicht genau aufgeschrieben was ich alles gemacht und /oder installieren musste, aber ich hab jetzt eine Mischung aus den Anleitungen vom Matthias Kleine (https://youtu.be/JfJVcqebqi8 bzw. https://haus-automatisierung.com/hardware/fhem/2016/07/19/fhem-tutorial-reihe-part-12-whatsapp-nachrichten-und-bilder-versenden-empfangen.html) und dem Wiki vorgegangen https://wiki.fhem.de/wiki/Yowsup

Wobei ich Yowsup-master und yowsup-config von meinem Raspi auf den NUC kopiert habe anstelle von "wget https://github.com/tgalal/python-axolotl/archive/master.zip"

Was geht denn bei Dir nicht ?

Gruß
Sascha
FHEM auf NUC, CUL866, HM-.*, Raspimatc, ...

MCh76

#1634
Hallo Sascha,
ich hatte lange das Problem mit der Fehlermeldung "old version". Bin dann auf das hier gestoßen:
https://github.com/tgalal/yowsup/issues/2350
in Kombination mit den wertvollen Ergänzungen von mba weiter vorher im Thread.

Registrierung und Anlage im FHEM passt soweit.
Aber: wenn ich nun Testnachrichten an mein Handy schicken will (sowohl per FHEM send als auch python yowsup-cli demos -c /opt/yowsup-config/yowsup.config -s 49xxxxx "Das ist ein Test") kommt diese nicht an. Zudem geht der Status im FHEM sofort nach dem send Befehl auf offline...
Habe dann weiter erst mal per Konsole versucht. Nachdem ich in der /yowsup/env/env.py den DEFAULT auf "s40" zurückgestellt hatte (Tipp habe ich weiter vorher hier im Thread gelesen), konnte ich genau eine einzige Nachricht versenden die auf dem Handy ankam.
Seit dem immer folgender Fehler.


  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 130, in receive
    recv(node)
  File "/opt/yowsup-master/yowsup/layers/auth/layer_authentication.py", line 81, in handleFailure
    raise AuthError(nodeEntity.getReason())
yowsup.layers.auth.autherror.AuthError: not-authorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "yowsup-cli", line 368, in <module>
    if not parser.process():
  File "yowsup-cli", line 272, in process
    self.startSendClient()
  File "yowsup-cli", line 324, in startSendClient
    stack.start()
  File "/opt/yowsup-master/yowsup/demos/sendclient/stack.py", line 33, in start
    print("Authentication Error: %s" % e.message)
AttributeError: 'AuthError' object has no attribute 'message'




Hast du oder jmd. anderes hier ne idee?
VG,
Chris