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

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

Vorheriges Thema - Nächstes Thema

Fhemeinsteiger

#90
mmm, bei mir kommt:  -1

der Rest ist leer.
Da wird keine Datei geöffnet.

schka17

das passt ja,

aber wenn dann wieder ins terminal gehst, gibts die datei im tmp verzeichnis oder nicht?

also

ls -al /tmp/test*


M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

#92
ja genau, die Datei ist in /tmp vorhanden.

-rw-r--r-- 1 fhem dialout 292 Feb  6 20:08 /tmp/test.txt

schka17

gut, d.h. du kannst grundsätzlich Kommandos ausführen.

dann probiere mal fhem befehlsfenster

{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \> /tmp/test.txt")}

und im terminal

cat /tmp/text.txt

und poste den output
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

#94
mmm,

pi@raspberrypi ~ $ cat /tmp/text.txt
cat: /tmp/text.txt: Datei oder Verzeichnis nicht gefunden


???

Datei ist leer

schka17

du hast geschrieben mit

{system("set \> /tmp/test.txt")}

wurde die Datei geschrieben?

probierts du nochmal mit diesem befehl aus fhem und postest den inhalt

cat /tmp/text.txt
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

#96
Datei wurde geschrieben:
COLUMNS='82'
CONSOLE='/dev/console'
HOME='/'
IFS='
'
INIT_VERSION='sysvinit-2.88'
LINES='26'
OLDPWD='/'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='12429'
PREVLEVEL='N'
PS1='$ '
PS2='> '
PS4='+ '
PWD='/opt/fhem'
RUNLEVEL='2'
SHELL='/bin/sh'
TERM='linux'
previous='N'
runlevel='2'


aber mit:cat /tmp/text.txt
kommt im terminal:
pi@raspberrypi ~ $ cat /tmp/text.txt
cat: /tmp/text.txt: Datei oder Verzeichnis nicht gefunden


und dann wieder mit:{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \> /tmp/test.txt")}

ist die Datei leer

schka17

sorry hab mich vertippt, meinte natürlich test.txt und nicht text.txt

also nochmal in fhem

{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \> /tmp/test.txt")}


und im terminal

cat /tmp/test.txt


M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

Ja habs auch gerade gemerkt.

nach:{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \> /tmp/test.txt")}

wird die Datei mit 0 Byte überschrieben.

nach:cat /tmp/test.txt   
passiert nichts. Datei ist dann leer.

mit:{system("set \> /tmp/test.txt")}
und dann cat /tmp/test.txt 

wird der Inhalt angezeigt:COLUMNS='82'
CONSOLE='/dev/console'
HOME='/'
IFS='
'
INIT_VERSION='sysvinit-2.88'
LINES='26'
OLDPWD='/'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='12429'
PREVLEVEL='N'
PS1='$ '
PS2='> '
PS4='+ '
PWD='/opt/fhem'
RUNLEVEL='2'
SHELL='/bin/sh'
TERM='linux'
previous='N'
runlevel='2'

schka17

Zitat von: Fhemeinsteiger am 06 Februar 2015, 21:07:39
Ja habs auch gerade gemerkt.

nach:{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \> /tmp/test.txt")}

wird die Datei mit 0 Byte überschrieben.

nach:cat /tmp/test.txt   
passiert nichts. Datei ist dann leer.

mit:{system("set \> /tmp/test.txt")}
und dann cat /tmp/test.txt 

wird der Inhalt angezeigt:COLUMNS='82'
CONSOLE='/dev/console'
HOME='/'
IFS='
'
INIT_VERSION='sysvinit-2.88'
LINES='26'
OLDPWD='/'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='12429'
PREVLEVEL='N'
PS1='$ '
PS2='> '
PS4='+ '
PWD='/opt/fhem'
RUNLEVEL='2'
SHELL='/bin/sh'
TERM='linux'
previous='N'
runlevel='2'


OK, d.h. es gibt keinen standard output , schauen wir mal welcher error ausgegeben wird.
lösche die datei und dann:
{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup \&\>\> /tmp/test.txt")}
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

O.K.
die Datei hat 0 Byte mit originaler Telefonnummer,
und die Datei hat auch 0Byte mit xxxx

schka17

kannst du mal posten wie das genau aussieht (die tel nummer nach 49 kannst mit xx ausfüllen)
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

schka17

probiere auch

{system("/usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup 2\> /tmp/test.txt")}
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

Fhemeinsteiger

so habs probiert:
jetzt steht im test.txt:Traceback (most recent call last):
  File "/usr/local/bin/yowsup-cli", line 4, in <module>
    __import__('pkg_resources').run_script('yowsup2==2.2.15', 'yowsup-cli')
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 696, in run_script
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1621, in run_script
  File "/usr/local/lib/python2.6/dist-packages/yowsup2-2.2.15-py2.6.egg/EGG-INFO/scripts/yowsup-cli", line 304, in <module>
   
  File "/usr/local/lib/python2.6/dist-packages/yowsup2-2.2.15-py2.6.egg/EGG-INFO/scripts/yowsup-cli", line 227, in process
   
  File "/usr/local/lib/python2.6/dist-packages/yowsup2-2.2.15-py2.6.egg/EGG-INFO/scripts/yowsup-cli", line 265, in startSendClient
   
  File "build/bdist.linux-armv6l/egg/yowsup/demos/sendclient/__init__.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/demos/sendclient/stack.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/stacks/__init__.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/stacks/yowstack.py", line 21, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/layers/axolotl/__init__.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/layers/axolotl/layer.py", line 2, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/layers/axolotl/protocolentities/__init__.py", line 3, in <module>
  File "build/bdist.linux-armv6l/egg/yowsup/layers/axolotl/protocolentities/iq_keys_get_result.py", line 4, in <module>
  File "build/bdist.linux-armv6l/egg/axolotl/identitykey.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/axolotl/ecc/curve.py", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/axolotl_curve25519.py", line 7, in <module>
  File "build/bdist.linux-armv6l/egg/axolotl_curve25519.py", line 4, in __bootstrap__
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1127, in resource_filename
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1823, in get_resource_filename
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1853, in _extract_resource
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1193, in get_cache_path
  File "build/bdist.linux-armv6l/egg/pkg_resources/__init__.py", line 1173, in extraction_error
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Errno 13] Permission denied: '//.python-eggs'

The Python egg cache directory is currently set to:

  //.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

schka17

Zitatpkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Errno 13] Permission denied: '//.python-eggs'

The Python egg cache directory is currently set to:

  //.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

sehr gut, dass ist ja mal eine klare Fehlermeldung, fehlende Berechtigung des fhem users.

probier mal

{system("sudo /usr/bin/python2.6 /usr/local/bin/yowsup-cli demos -s 491xxxxxx \"Garage ist zu\" -c /home/pi/config.yowsup 2\> /tmp/test.txt")}

M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000