Reputation: 49
I am working on sending messages from RasPi through Whatsapp. I have already installed yowsup
.
I have completed with the registration process using the following commands, and have stored it in a config file:
python yowsup-cli registration --requestcode sms --phone 39xxxxxxxxxx --cc 39 --mcc 222 --mnc 10
python yowsup-cli registration --register xxx-xxx --phone 39xxxxxxxxxx --cc 39
I am also able to send and receive messages from RasPi using the yowsup
command-line client using the following command:
yowsup-cli demos --yowsup --config config
But when I type the following command:
python yowsup-cli -c config -w -s 39xxxxxxxxxx "Message"
I get the following error:
Available commands are
demos versions registration
How can I directly send a message through a Python script, without going through the client?
Upvotes: 1
Views: 6759
Reputation: 28
the new yowsup-cli 2.0 has improved and does'nt need -w anymore, well there is another python module which can help you to send messages using yowsup
pywhatsapp 0.0.7
Upvotes: 0
Reputation: 1195
This isn't related to raspberry-pi.
The new yowsup-cli 2.0 changed the command line interface, and now you should run instead:
python yowsup-cli demos -c config -s 39xxxxxxxxxx "Message"
Now, you mention that you want to send from python directly, but note that your command line python yowsup-cli
is still going through the "client". If you want to send directly from your python script, follow the yowsup tutorials and/or read the actual yowsup-cli code as example for usage.
Having all that said, yowsup has a bit to go in the way of documentation. I guess it's up to all of us to contribute.
Upvotes: 2