顯示具有 RaspberryPi 標籤的文章。 顯示所有文章
顯示具有 RaspberryPi 標籤的文章。 顯示所有文章

2016-12-28

Pi, CLI Audio.

Link reference 1: https://www.raspberrypi.org/documentation/configuration/audio-config.md
Link reference 2: https://www.raspberrypi.org/documentation/usage/audio/

Switch audio output.
# amixer cset numid = 2     (2 is HDMI, 1 is Headphone jack, 0 is automatic by default )

Audio player.
# omxplayer example.mp3
# omxplayer -o hdmi example.mp3     (force output over HDMI)
# omxplayer -o local example.mp3     (force output over headphone jack)

Repeat playback
============
# omxplayer --loop example.mp3

[ Sys Reply ]
Audio codec mp3 channels 1 samplerate 11025 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
Seek to: 00:00:00
Seek to: 00:00:00
Seek to: 00:00:00

[Ctrl + C] Quit player.

2016-03-17

LIRC, IR Transmitter [ irsend ]

Schematic (with Raspberry Pi)

(yellow, 3.5mm middle) PIN 17 [3.3V] ==> + IR LED - ==> [GND] PIN 06 (black, 3.5mm peak)

# irsend SEND_ONCE SHM38K KEY_OK

IRSEND OPTION
-- Help
-h --help display usage summary
-v --version display version
-d --device use given lircd socket [/var/run/lirc/lircd]
-a --address host[:port] connect to lircd at this address
-# --count n send command n times

-- DIRECTIVE can be:
SEND_ONCE - send CODE [CODE...] once
SEND_START - start repeating [CODE]
SEND_STOP - stop repeating [CODE]
LIST - list configured remote items
SET_TRANSMITTERS - set transmitters NUM [NUM...]
SIMULATE - simulate IR event

2016-03-16

LIRC, IR key mapping & Learning

# irrecord –d /dev/lirc0 lircd.conf

Pi, IR Receiver


VCC3.3V (Pin-01) ------------- IR receiver ( from left Pin-03)
GROUND ----------------------- IR receiver ( from left Pin-02)
GPIO-18 (Pin-12) -------------- IR receiver ( from left Pin-01)

2016-03-11

Pi, NFS server

NFS server (ip 10.1.1.16)
# apt-get install nfs-kernel-server nfs-common
# vim /etc/exports
     /var/tmp *(ro,sync)
# /etc/init.d/nfs-kernel-server stop
# rpcbind
# /etc/init.d/nfs-kernel-server start