公告版位

目前分類:RaspberryPi (6)

瀏覽方式: 標題列表 簡短摘要

目的

測試telegram在rpi CLI的模式下運作機制

安裝步驟

1. 裝該裝的

sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make libjansson-dev

2. 下載編譯

git clone --recursive https://github.com/vysheng/tg.git && cd tg
./configure
make

3. 執行

執行會會要求輸入電話號碼,會送SMS訊息給手機,把訊息的CODE碼輸入及完成配對

pi@raspberrypi ~/telegram/tg $ ./bin/telegram-cli -k tg-server.pub -W
Telegram-cli version 1.3.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.1
I: config dir=[/home/pi/.telegram-cli]
[/home/pi/.telegram-cli] created
[/home/pi/.telegram-cli/downloads] created
phone number: +88609XXXXXXXX
code ('call' for phone call): 26722
User Perry Wu online (was online [2015/05/25 14:02:45])
User Perry Wu offline (was online [2015/05/25 13:58:14])
User Perry Wu online (was online [2015/05/25 14:03:15])
> msg Perry_Wu test from rpi
 *** reply_id=0, disable=0
[13:59]  Perry Wu <<< test from rpi
User Telegram marked read 0 outbox and 1 inbox messages
> msg Perry_Wu dkasdkas;ldk
 *** reply_id=0, disable=0
[13:59]  Perry Wu <<< dkasdkas;ldk
User Perry Wu is typing
User Perry Wu is typing
[14:00]  Perry Wu ??? Hello
User Perry Wu is typing
[14:00]  Perry Wu ??? Oh?

參考

* 在树莓派上用Node.js监视网页变化并通知手机

http://hugozhu.myalert.info/2015/03/07/57-use-node-module-phantom-to-monitor-webpage-updates.html

* Telegram on Raspberry Pi

http://www.instructables.com/id/Telegram-on-Raspberry-Pi/?lang=zh


文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()

目的

在手機配對RPI2的BlueZ時,一直失敗,找了資料發現要改/usr/bin/bluez-simple-agent的capability 才可以配對?所以針對這個參數來了解BlueZ以及BlueTooth的相互關係

BlueTooth的SSP定義了安全配對的方法

底下資訊擷取自wiki


Secure Simple Pairing (SSP): This is required by Bluetooth v2.1, although a Bluetooth v2.1 device may only use legacy pairing to interoperate with a v2.0 or earlier device. Secure Simple Pairing uses a form of public key cryptography, and some types can help protect against man in the middle, or MITM attacks. SSP has the following characteristics:

Just works:

As the name implies, this method just works, with no user interaction. However, a device may prompt the user to confirm the pairing process. This method is typically used by headsets with very limited IO capabilities, and is more secure than the fixed PIN mechanism this limited set of devices uses for legacy pairing. This method provides no man-in-the-middle (MITM) protection.

文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()

目的

在使用者第一次設備,有很大機會不知道該設備的網路ip是多少,這時候語音說出來就是一個選項了, 之前開發了google TTS,但是要連到Internet才可使用,不是很完美的方式。 參考http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)

最後選用了espeak來當做發音的工具,更重要的,是他可以選發中文的音,這真是太神奇了

espeak -s 150 -v zh -g 50 -p 30 "10 點 5 點 32 點 254"
hostname -I | espeak -s 150 -v zh -g 50 -p 30 --stdin

文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()

* 很多的應用
https://learn.adafruit.com/category/raspberry-pi

* 介紹USB AUDIO卡的安裝以及raspberry中alsa的設定方式
https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions

* 介紹如何使用mpc/mpd來讓raspberry當音響盒的
https://learn.adafruit.com/raspberry-pi-radio-player-with-touchscreen/installing-the-music-player-daemon

* NAS
http://www.openmediavault.org/

... 持續更新 ...
文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()

安裝套件

sudo apt-get install pulseaudio pulseaudio-utils
sudo apt-get install mplayer
sudo apt-get install libmpg123-dev mpg123

動態切換HDMI or jack輸出

amixer cset numid=3 n
        n is 0=auto, 1=headphones, 2=hdmi.

測試音源方法

aplay /usr/share/sounds/alsa/Front_Center.wav

執行mplayer + pulseaudio時發生的問題

1. 撥放音樂時會卡

修改/etc/pulse/default.pa

The newer implementation of the PulseAudio sound server uses timer-based audio scheduling instead of the traditional, interrupt-driven approach.

tsched = 0,代表改回interrupt driven

load-module module-udev-detect tsched=0

Reference PulseAudio FAQ

https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Audio_quality


文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()

  • usbmount

    讓USB flash插入直接mount

    sudo apt-get install usbmount
    
  • samba

    提供檔案共用

    sudo apt-get install samba
    
    mkdir /home/pi/share
    chmod 777 /home/pi/share
    sudo vi /etc/samba/smb.conf
    
    [Share]
    comment = ShareFolder
    path = /home/pi/share
    browseable = Yes
    writable = Yes
    public = Yes
    guest ok = yes
    read only = no
    
  • node.js
    wget http://node-arm.herokuapp.com/node_latest_armhf.deb
    sudo dpkg -i node_latest_armhf.deb
    

... 持續更新中 ...


文章標籤

Perry Wu 發表在 痞客邦 留言(0) 人氣()