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

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

Vorheriges Thema - Nächstes Thema

koerly

Hi, erstmal echt tolle Arbeit ...Thx!

ich habe den gleichen Fehler wie moonsorrox .
Das Modul steht auf "Disconnect" mein Logfile weisst die gleichen Fehler auf.

PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli

Liegt es daran dass ich erst das Whatsup Modul in fhem definiert habe und dann denn yowsup-cli unter dem Pi ?

2015.06.17 10:24:13 3: WhatsApp: read: end of file reached while sysread
2015.06.17 10:24:13 3: WhatsApp: Disconnected
2015.06.17 10:24:13 3: WhatsApp: sending /disconnect
2015.06.17 10:24:13 1: exec failed!!!
2015.06.17 10:24:13 1: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or directory at ./FHEM/32_yowsup.pm line 164.
2015.06.17 10:24:13 2: WhatsApp: starting yoswup-cli: /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
rpi2; cul868; jeelink

justme1968

die meldung sagt doch das er das /opt/local/bin/yowsup-cli nicht ausführen kann.

wo habt ihr das yowsup-cli binary liegen? habt ihr das cmd attribut entsprechend gesetzt? da muss der komplette Aufruf drin stehen:attr <yowsup> cmd  <pfad1>/yowsup-cli demos -c <pfad2>/config.yowsup --yowsup

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

karl0123

Hat es schon irgendjemand geschafft, tatsächlich ein Bild zu versenden? Bei mir sieht auch im Log alles so aus, als würde das Bild versendet, es kommt jedoch nichts an und danach wird auch keine Textnachricht mehr gesendet, bis man einen Reconnect macht.


justme1968

ja schon mehrfach.

wenn es nicht geht fehlen meist teile python library.

schau mal weiter oben im thread. da ist beschrieben was zu tun ist.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

karl0123

Ich habe vergessen dazu zu schreiben, dass ich all die Tipps hier aus dem Thread schon beherzigt habe und auch alle Python Module verfügbar sind. Schreibt yowsup ein Log in das ich schauen könnte?

justme1968

diese meldungen landen auf stderr.

am einfachsten ist es fhem von hand zu starten und auf die console zu schauen.

auch das steht weiter oben glaube ich schon :)

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

moonsorrox

Zitat von: JoWiemann am 17 Juni 2015, 10:31:50
einen Hinweis hast Du schon im Log: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or Directory

Irgendwie scheint Dein Pfad zum yowsup nicht mehr zu stimmen, oder Du hast das Attribut cmd falsch gesetzt.

genau, ich habe da ich erst gestern alles eingerichtet habe diesen Pfad hier erst einmal aus dem Forum übernommen.
Ich denke meine Konstellation ist auch eine andere, weil hier oft vom Pi ausgegangen wird, ich aber einen Cubietruck nutze.

Ich werde die Hinweise von euch die Tage alle aufnehmen und abarbeiten.
Was mich nur wundert das ich wie oben beschrieben Meldungen absetzen kann und diese auch als WhatsApp Meldungen ankommen...

So z.B. diese hier:
{system("/usr/bin/python2.7 /opt/yowsup-master/yowsup-cli demos -s 491xxxxxxxxx \"Garage ist jetzt zu\" -c /opt/fhem/yowsup.cfg")}
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

marvin78

@moonsorox: Siehst du den Unterschied bei den Pfaden?


/opt/local/bin/yowsup-cli"


/opt/yowsup-master/yowsup-cli


JoWiemann

Hallo,

setze doch bitte das Attribut cmd auf:

/opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup

Ohne das Setzen des Attributs, wie beschrieben in der Hilfe, wird ein Standardpfad genommen.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

Cybers

im Eventmonitor erscheint folgendes bei einem Reconnect:
2015-06-17 11:24:36 yowsup WhatsApp reconnect
2015-06-17 11:24:38 yowsup WhatsApp connected
2015-06-17 11:24:42 yowsup WhatsApp offline

Die Verbindung wird direkt wieder geschlossen.

Log mit Verbose 5:

2015.06.17 12:15:21 3: WhatsApp: reConnect
2015.06.17 12:15:21 3: WhatsApp: sending /disconnect
2015.06.17 12:15:21 3: WhatsApp: Disconnected
2015.06.17 12:15:21 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup
2015.06.17 12:15:22 4: WhatsApp: parse: Yowsup Cli client
==================
Type /help for available commands


2015.06.17 12:15:22 4: WhatsApp: parse: [offline]:
2015.06.17 12:15:22 3: WhatsApp: sending /L
2015.06.17 12:15:22 3: WhatsApp: sending /presence available
2015.06.17 12:15:22 5: HMLAN_Send:  HMLAN1 I:K
2015.06.17 12:15:22 5: HMLAN/RAW: /HHM-LAN-IF,03C1,KEQ1023258,2574A3,2574A3,BFC6EAFE,0006

2015.06.17 12:15:22 5: HMLAN_Parse: HMLAN1 V:03C1 sNo:KEQ1023258 d:2574A3 O:2574A3 t:BFC6EAFE IDcnt:0006
2015.06.17 12:15:23 4: WhatsApp: parse: Auth: Logged in!
[connected]:
2015.06.17 12:15:23 5: Triggering WhatsApp (1 changes)
2015.06.17 12:15:23 5: Notify loop for WhatsApp connected
2015.06.17 12:15:23 5: Temperatur: not on any display, ignoring notify
2015.06.17 12:15:23 4: WhatsApp: parse: [connected]:
2015.06.17 12:15:24 4: Connection accepted from telnet:127.0.0.1:32931
2015.06.17 12:15:24 5: Cmd: >{Log3 'sendWhatsApp', 3, 'sendWhatsApp: echo client startet'}<
2015.06.17 12:15:24 3: sendWhatsApp: echo client startet
2015.06.17 12:15:27 4: WhatsApp: parse: general: Disconnected: Connection Closed
[connected]:

2015.06.17 12:15:28 4: WhatsApp: parse:
general: Disconnected: Connection Closed
[offline]:

2015.06.17 12:15:28 5: Triggering WhatsApp (1 changes)
2015.06.17 12:15:28 5: Notify loop for WhatsApp offline


Ich habe gerade nocheinmal das komplette Yowsup gelöscht und wie in dem ersten Post neu installiert (allerdings ohne die Registrierungschritte, da meine config.example ja schon  besteht). Auch danach bleibt das Problem. Gestern habe ich schon meinen RasPI auf Jessie geupdatet.
Ich bin echt echt am verzweifeln weil es bis vor wenigen Tagen problemlos lief. Es muß irgendwie mit dem 32_Yowsup-Modul zu tun haben da ein Versand direkt aus Putty heraus geht.

Was kann ich noch tun, bzw was mache ich falsch?

Gruß, Sascha
FHEM 6.2 auf Raspberry PI 4 / Smartvisu
Eltako Serie 14: FAM14, FGW14-USB, FSB14, FSR14-4x, FSR14-2x, FDG14, FTS14-EM in Kombination mit Jung F50 24V Tastern
1-Wire Temperatursensoren
aus alter Zeit:
Gott sei Dank nur noch 3 Homematic Jalousie- & Schaltaktoren! Wer sich mit Funk auskennt, legt Kabel

moonsorrox

Zitat von: marvin78 am 17 Juni 2015, 11:42:44
@moonsorox: Siehst du den Unterschied bei den Pfaden?

jetzt wo du es sagst...!  ;) Ja.. Danke

Zitat von: JoWiemann am 17 Juni 2015, 11:44:35
setze doch bitte das Attribut cmd auf:

/opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup
Ok werde ich sofort ändern. Danke

Jetzt sehe ich auch in WhatsApp das Online Angezeigt wird, doch so einfach.  :D ;)
Nun kann ich ja weiter machen

Log:
2015.06.17 11:57:32 4: WhatsApp: parse:

from: 49xxxxxx@s.whatsapp.net
Type: result
ID: 2
2015.06.17 11:57:32 4: WhatsApp: parse: Iq:


from: 49xxxxxxxx@s.whatsapp.net
Type: result
ID: 1
2015.06.17 11:56:42 4: WhatsApp: parse: Iq:
2015.06.17 11:56:32 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
2015.06.17 11:55:52 4: WhatsApp: parse: [connected]:
[connected]:
2015.06.17 11:55:52 4: WhatsApp: parse: Auth: Logged in!
2015.06.17 11:55:51 3: WhatsApp: sending /presence available
2015.06.17 11:55:51 3: WhatsApp: sending /L
2015.06.17 11:55:51 4: WhatsApp: parse: [offline]:
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

AET_FHEM

Hallo,

Tolle arbeit DANKE

-> ich hab aber ein Problem und ich bin mir nicht sicher an was das liegt

aus der Console raus kann ich alles schicken und kommt auch am Handy an mit: python /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-master/config.yowsup -s 49XXXXXXX "Das ist ein Test"


in FHEM im Log kommt: 2015.06.17 11:36:32 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-master/config.yowsup --yowsup

und es steht auch dran das Whatsapp Connected ist aber wenn ich was schicken will kommt es nicht an, auf dem Handy sehe ich auch nicht den Status Online/Offline und wenn ich was vom Handy an die Festnetznummer schicke kommt das auch nicht an ...... woran kann das liegen?

in der 32_yowsup.pm hab ich das Home Verzeichnis geändert und den Pfad drei Zeilen weiter hab ich auch geändert in /opt/yowsup-master/yowsup-cli /opt/yowsup-master/config.yowsup

--> hat jemand ne idee, an was kann das liegen? :o

moonsorrox

Zitat von: AET_FHEM am 17 Juni 2015, 12:08:34

in der 32_yowsup.pm hab ich das Home Verzeichnis geändert und den Pfad drei Zeilen weiter hab ich auch geändert in /opt/yowsup-master/yowsup-cli /opt/yowsup-master/config.yowsup

--> hat jemand ne idee, an was kann das liegen? :o

das soll jetzt über das Attribut cmd gemacht werden nicht mehr in der Datei.
Ich habe gar nichts in der Datei geändert, schau mal in meinen Beitrag und den Antworten und setze den Pfad richtig
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

AET_FHEM

Hallo

OK hab das so gemacht Originalen Datei
attr cmd angelegt
jetzt bekomm ich im Log jede 10 Sekunden diese einträge und es zeigt als Disconnected an ....

2015.06.17 13:36:18 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup
2015.06.17 13:36:18 3: WhatsApp: sending /L
2015.06.17 13:36:18 3: WhatsApp: sending /presence available
2015.06.17 13:36:19 3: WhatsApp: sending /disconnect
2015.06.17 13:36:19 3: WhatsApp: Disconnected
2015.06.17 13:36:19 3: WhatsApp: read: error during sysread: No child processes
2015.06.17 13:36:19 3: WhatsApp: read: end of file reached while sysread

--> was mach ich falsch, fehlt noch was ???

koerly

Hallo, dank euch für die Hilfe.

Bin auch einen Schritt weiter !

Ja, ich hatte auch gestern nach einer Erstinstallation des Whatsup Moduls nicht das "CMD" Attribut gesetzt.
Hatte es einfach überlesen :(

/opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup

Jetzt klappt der Connect

Reihe mich bei AET_FHEM ein gleiches Fehlerbild

Leider hab ich auch nach 4sek. einen Disconnect

2015.06.17 13:41:21 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/fhem/yowsup.cfg --yowsup
2015.06.17 13:41:23 3: WhatsApp: sending /L
2015.06.17 13:41:23 3: WhatsApp: sending /presence available
Traceback (most recent call last):
  File "/opt/yowsup-master/yowsup-cli", line 321, in <module>
    if not parser.process():
  File "/opt/yowsup-master/yowsup-cli", line 225, in process
    self.startCmdline()
  File "/opt/yowsup-master/yowsup-cli", line 253, in startCmdline
    stack.start()
  File "/opt/yowsup-master/yowsup/demos/cli/stack.py", line 28, in start
    self.stack.loop(timeout = 0.5, discrete = 0.5)
  File "/opt/yowsup-master/yowsup/stacks/yowstack.py", line 167, 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 162, in poll
    write(obj)
  File "/usr/lib/python2.7/asyncore.py", line 95, in write
    obj.handle_error()
  File "/usr/lib/python2.7/asyncore.py", line 91, in write
    obj.handle_write_event()
  File "/usr/lib/python2.7/asyncore.py", line 467, in handle_write_event
    self.handle_connect_event()
  File "/usr/lib/python2.7/asyncore.py", line 455, in handle_connect_event
    self.handle_connect()
  File "/opt/yowsup-master/yowsup/layers/network/layer.py", line 55, in handle_connect
    self.emitEvent(YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECTED))
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 68, in emitEvent
    self.__upper.emitEvent(yowLayerEvent)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 68, in emitEvent
    self.__upper.emitEvent(yowLayerEvent)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 68, in emitEvent
    self.__upper.emitEvent(yowLayerEvent)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 68, in emitEvent
    self.__upper.emitEvent(yowLayerEvent)
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 62, in emitEvent
    if self.__upper and not self.__upper.onEvent(yowLayerEvent):
  File "/opt/yowsup-master/yowsup/layers/__init__.py", line 178, in onEvent
    stopEvent = stopEvent or s.onEvent(yowLayerEvent)
  File "/opt/yowsup-master/yowsup/layers/auth/layer_authentication.py", line 39, in onEvent
    self.login()
  File "/opt/yowsup-master/yowsup/layers/auth/layer_authentication.py", line 49, in login
    self._sendAuth()
  File "/opt/yowsup-master/yowsup/layers/auth/layer_authentication.py", line 88, in _sendAuth
    nonce = StorageTools.getNonce(self.credentials[0])
  File "/opt/yowsup-master/yowsup/common/tools.py", line 75, in getNonce
    path = StorageTools.getStorageForPhone(phone)
  File "/opt/yowsup-master/yowsup/common/tools.py", line 49, in getStorageForPhone
    return StorageTools.constructPath(phone + '/')
  File "/opt/yowsup-master/yowsup/common/tools.py", line 44, in constructPath
    os.makedirs(os.path.dirname(fullPath))
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/.yowsup'
2015.06.17 13:41:23 3: WhatsApp: sending /disconnect
2015.06.17 13:41:23 3: WhatsApp: Disconnected
2015.06.17 13:41:23 3: WhatsApp: read: error during sysread: No child processes
2015.06.17 13:41:23 3: WhatsApp: read: end of file reached while sysread
rpi2; cul868; jeelink