DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Wechat client?

Mon Jan 18, 2016 4:05 am

Anyone know of a WeChat client that runs under Raspbian?

I'm trying to build a motion detector for my home that will send a WeChat message to me if it senses motion.

Email is too slow and SMS messages over free services are not available where I live. And I don't want to use a monitoring service due to privacy concerns.

Thanks!

Parkview
Posts: 58
Joined: Sun Feb 17, 2013 1:51 pm

Re: Wechat client?

Mon Jan 18, 2016 1:57 pm

LOL - I just started looking for something like this this evening too. I want to be able to send text and images to my Wechat account.

I have found this: http://php-hackers.com/p/hupantingxue/wxpublic-python but I won't have time to test it out for a few weeks.

User avatar
AiGreek
Posts: 229
Joined: Sun Dec 06, 2015 7:44 pm

Re: Wechat client?

Mon Jan 18, 2016 2:23 pm

Why not Pushbullet ? There's an open api, some libs and everything you need to send notifications

Parkview
Posts: 58
Joined: Sun Feb 17, 2013 1:51 pm

Re: Wechat client?

Mon Jan 18, 2016 10:57 pm

Thanks AiGeek. I had never heard of https://docs.pushbullet.com/ before. The python module: https://github.com/randomchars/pushbullet.py looks quite easy to use.

DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Re: Wechat client?

Tue Jan 19, 2016 2:18 am

Yeah, I think I was too specific on my needs.
I want to send an instant message/notification to my Android phone from my Pi on movement detection.
I specified WeChat because it is the most popular, allowed, messaging service where I live.
So basically any service that is not blocked in China (like Twitter, Facebook, etc) might work.

I'll check out pushbullet and that python script. Any other ideas as well??

Thanks!

DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Re: Wechat client?

Tue Jan 19, 2016 4:57 am

This is crazy stupid simple with PushBullet!!!

https://www.youtube.com/watch?v=2QL5k235258

Thanks for pointing that service out!!!!

User avatar
AiGreek
Posts: 229
Joined: Sun Dec 06, 2015 7:44 pm

Re: Wechat client?

Tue Jan 19, 2016 7:04 am

You're welcome ;)

Parkview
Posts: 58
Joined: Sun Feb 17, 2013 1:51 pm

Re: Wechat client?

Tue Jan 19, 2016 2:03 pm

LOL - yes, I had it installed and running in no time using this python module: https://pypi.python.org/pypi/pushbullet.py

This is Sooooo easy!

1) Log into the pushbullet website using your gmail or facebook account.
2) Have a quick 5 min. look around the website
3) Generate an API key
4) Download mobile phone App and login to your new account
5) Download python module: pip install pushbullet.py
6) using info from the above module website, create a simple test script:

from pushbullet import Pushbullet

pb = Pushbullet(‘enter-pushbullet-api-key-here’)
print(pb.devices) # lists out my registered devices
push = pb.push_note("This is the title", "This is the body")
push = pb.push_link("Cool site", "https://github.com")
to_buy = ["milk", "bread", "cider"]
push = pb.push_list("Shopping list", to_buy)

Thanks once again for the tip off :D

Parkview
Posts: 58
Joined: Sun Feb 17, 2013 1:51 pm

Re: Wechat client?

Wed Apr 13, 2016 1:33 pm

Don't want to use Python? You can use curl via a bash script to make the submission to the pushbullet service.
The script below notifies me when my RPi powers up:

Code: Select all

#!/bin/bash
#
#  sends out a pushbullet notification to an account

cd /home/pi/pushbullet
sleep 10   # sometimes have to wait a bit for the network to finish connecting

API="add-pushbullet-api-here"
DATETIME=`date "+ %Y-%m-%d %H:%M:%S: "`
HOSTNAME=`hostname | tr '[:lower:]' '[:upper:]' `
IPADD=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
MSG=" '$HOSTNAME' $IPADD has booted up at: $DATETIME!"
curl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="RPi Booted up:" -d body="$MSG"  >/tmp/BOOT.out 2>/tmp/BOOT.err
Note: must have curl compiled for https use.

Return to “Other projects”