domingo, 17 de febrero de 2013

Watching in my raspberry stream by Sopcast

First answer: No, Raspberry Pi doesnt have the enougth powerful to can run sopcast in the raspberry
But, you can run sopcast in another computer and do streaming to raspberry Pi.

The applications and SSOO that i have used
- In my raspberry pi XBIAN (1.0 alpha 4)  http://xbian.org/
- In my server computer. Windows 7.
- Sopcast  http://www.sopcast.com/ . I have changed the settings of sopcast to can use VLC (look like i net if you want to do the same).

Create file in the raspberry pi
nano sopcast.STRM

And include the following url (change the ip to set your windows computer)

http:\\192.168.1.24:8902/tv.ts

Now, from xbmc, go to "Video" > "Archives" > and search in your local drive the file created ... open and enjoy !!!!


My raspberry Pi sending whatsapps

1/ Create a phone number using http://www.fonyou.com/   (not included in this tutorial)
2/ Register a fonyou number to can send a whatsapp (here is where i found with more problems), so, i will explain in detail.

I have used : https://github.com/tgalal/yowsup   (the common line help is describe in https://github.com/tgalal/yowsup/wiki/yowsup-cli#wiki-config)

Download
wget https://github.com/tgalal/yowsup/archive/master.zip
unzip master.zip
cd yowsup-master/src/

In the webpage of yowsup, you can see that is required python-dateutil (in my case, i had to install)
apt-get install python-dateutil

Edit the the configutation file:
nano config.example

Change the attributes "cc" and "phone" with your data.
cc=34
phone=346XXXXXXX
id=
password=

The whatsapp register phase is in 2 steps: 
1/Register phase. It could be do by sms or by voice. 
1.1. sms: I tried with the sms but never arrived to the fonyou phone. (reading by inet, looks like they dont support whatsapp)
python yowsup-cli -c config.example --requestcode sms


1.2. voice: Finally, i use this option. After did the request, you will receive a call in your phone associate to fonyou phone, and a record will repeat the activation code 
python yowsup-cli -c config.example --requestcode voice 

2/ Activation phase. In this phase, whatsapp should return your password 
python yowsup-cli -c config.example --register [CODE] 

Doing this, i have found this issue:

Traceback (most recent call last):
  File "yowsup-cli", line 283, in <module>
    print resultToString(result)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 67: ordinal not in range(128)


Doing some investigation by inet, looks like the EURO can not print to screen and could be fixed if you set in the  encoding file of phyton .. really, it's not necesary to do anything, becouse, it could be use some workaround to see the password. Just retry the same line, but, adding -d to show the request/respond
 

xbian@xbian:~/yowsup/yowsup-master/src# python yowsup-cli -c config.example --register [CODE] -d
GET
{'Accept': 'text/json', 'User-Agent': 'WhatsApp/2.3.53 S40Version/14.26 Device/Nokia302'}
cc=34&in=6XXXXXXXX&id=XXXXXX&code=[CODE]
Opening connection to v.whatsapp.net
Requesting /v2/register?cc=34&in=6XXXXX&id=XXXXXXX&code=XXXXXX
WARegRequest: {"status":"ok","login":"346XXXXXXX","pw":"aadsdasadasdaasdaadasd=","type":"existing","expiration":XXXXXXXX,"kind":"free","price":"0,89 \u20ac","cost":"0.89","currency":"EUR","price_expiration":XXXXX}

Traceback (most recent call last):
  File "yowsup-cli", line 283, in <module>
    print resultToString(result)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u20ac' in position 67: ordinal not in range(128)




So, here, the import is the value for the key "pw" (in the example, correspond with 
aadsdasadasdaasdaadasd=)

Edit the the configutation file:
nano config.example

Include your  pwd in the config.example
cc=34
phone=346XXXXXXX
id=
password=aadsdasadasdaasdaadasd=

And send the message to the phone that you want (remenber the country code)
python yowsup-cli -c config.example -s 346000000 "hello world"


sábado, 16 de febrero de 2013

hello

hello world !!!!

In this case, is hello world from my raspberry pi.  I will use this blog to keep my notes about raspberry pi