/boot/config.txt에서 hdmi_로 시작하는 항목 세 개를 다음과 같이 편집하는 것이다.
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=16
각 항목의 의미에 대해서는 문서를 참조.
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=16
그랜저 XG 용 GB80L 배터리 |
현대차 용 OKA-NO10 리모콘과 CR2032 배터리 |
현대차 용 OKA-NO11 리모콘과 CR2016 배터리 |
BT-168 배터리 체커 |
openelec:/flash # mount | grep flash
/dev/mmcblk0p6 on /flash type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
openelec:/flash # mount -o remount,rw /flash
openelec:/flash # mount | grep flash
/dev/mmcblk0p6 on /flash type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
openelec:/flash # tail -1 config.txt
dtoverlay=lirc-rpi
openelec:~ # modprobe lirc_rpi
openelec:~ # killall lircd
openelec:~ # mode2 -d /dev/lirc0
space 16777215
pulse 4528
space 4428
pulse 598
...
openelec:~ # irrecord --device=/dev/lirc0 /storage/.config/lircd.conf
openelec:~/.config # more lircd.conf
# Please make this file available to others
# by sending it to
#
# this config file was automatically generated
# using lirc-0.9.1-git(default) on Sun Nov 13 02:57:53 2016
#
# contributed by
#
# brand: LG
# model no. of remote control: 6710CMAM03C
# devices being controlled by this remote:
#
begin remote
name LG_6710CMAM03C2
bits 16
flags SPACE_ENC|CONST_LENGTH|REPEAT_HEADER
eps 30
aeps 100
header 4518 4441
one 580 1653
zero 580 535
ptrail 579
repeat 580 1652
pre_data_bits 16
pre_data 0x808
gap 107643
toggle_bit_mask 0x0
begin codes
KEY_POWER 0x7887
KEY_MUTE 0xF807
KEY_VOLUMEUP 0xE817
KEY_VOLUMEDOWN 0x6897
KEY_SLEEP 0x43BC
KEY_1 0x827D
KEY_2 0x42BD
KEY_3 0xC23D
KEY_4 0x22DD
KEY_5 0xA25D
KEY_6 0x629D
KEY_7 0xE21D
KEY_8 0x12ED
KEY_9 0x926D
KEY_0 0xD22D
KEY_UP 0x20DF
KEY_DOWN 0x728D
KEY_LEFT 0x609F
KEY_RIGHT 0xE01F
KEY_ENTER 0xA05F
KEY_MENU 0xB24D
KEY_STOP 0x708F
KEY_CHANNELUP 0xC837
KEY_CHANNELDOWN 0x48B7
KEY_RECORD 0xA857
KEY_STOP 0x708F
KEY_FASTFORWARD 0x8877
KEY_REWIND 0x08F7
KEY_PLAY 0xB04F
KEY_BACK 0x30CF
end codes
end remote
$ sudo cp debian-8.6.0-amd64-netinst.iso /dev/sda
$ su -
# apt install firmware-b43-installer
# wpa_passphrase myssid my_very_secret_passphrase > /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
apt install fcitx-hangul
pi@rpi3:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr b8:27:eb:74:7d:c9
inet addr:169.254.218.16 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::bbe0:b9f7:d1f3:1222/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:88 errors:0 dropped:0 overruns:0 frame:0
TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21761 (21.2 KiB) TX bytes:34334 (33.5 KiB)
pi@rpi1 ~ $ ping -c 3 169.254.218.16
PING 169.254.218.16 (169.254.218.16) 56(84) bytes of data.
64 bytes from 169.254.218.16: icmp_req=1 ttl=64 time=0.578 ms
64 bytes from 169.254.218.16: icmp_req=2 ttl=64 time=0.483 ms
64 bytes from 169.254.218.16: icmp_req=3 ttl=64 time=0.544 ms
--- 169.254.218.16 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.483/0.535/0.578/0.039 ms
pi@rpi1:~$ ssh pi@169.254.218.16
The authenticity of host '169.254.218.16 (169.254.218.16)' can't be established.
ECDSA key fingerprint is 78:7a:83:49:ae:18:91:45:91:37:03:ca:fa:d3:14:f5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '169.254.218.16' (ECDSA) to the list of known hosts.
pi@169.254.218.16's password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Nov 5 13:10:27 2016 from rpi1.local
pi@rpi3:~$
pi@rpi1 ~ $ tail -1 /etc/hosts
169.254.218.16 rpi3
$ ssh-keygen
$ ssh-copy-id pi@rpi3
$ ssh-add
$ arecord -D plughw:1,0 -d 5 test.wav
$ aplay test.wav
$ more ~/.asoundrc
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
}
capture.pcm {
type plug
slave.pcm "hw:1,0"
}
}
$ arecord -d 5 test.wav
sudo apt install libasound2-dev autoconf libtool bison swig python-dev python-pyaudio
sudo pip install gevent grequests
git clone git://github.com/cmusphinx/sphinxbase.git
cd sphinxbase
./autogen.sh
make
sudo make install
cd ..
git clone git://github.com/cmusphinx/pocketsphinx.git
cd pocketsphinx
./autogen.sh
make
sudo make install
cd ..
sudo ldconfig
$ more corpus.txt
day
week
month
4
agenda
refresh
next
previous
today
$ pocketsphinx_continuous -hmm /usr/local/share/pocketsphinx/model/en-us/en-us -lm cal.lm -dict cal.dic -samprate 16000/8000/48000 -inmic yes
INFO: pocketsphinx.c(152): Parsed model-specific feature parameters from /usr/local/share/pocketsphinx/model/en-us/en-us/feat.params
Current configuration:
[NAME] [DEFLT] [VALUE]
-agc none none
-agcthresh 2.0 2.000000e+00
-allphone
-allphone_ci no no
-alpha 0.97 9.700000e-01
...
INFO: ps_lattice.c(1441): Joint P(O,S) = -144424 P(S|O) = -24085
INFO: ngram_search.c(872): bestpath 0.00 CPU 0.000 xRT
INFO: ngram_search.c(875): bestpath 0.00 wall 0.001 xRT
NEXT
INFO: continuous.c(275): Ready....
^C
#!/bin/sh
cd /home/pi/calendar
pocketsphinx_continuous -hmm /usr/local/share/pocketsphinx/model/en-us/en-us \
-lm cal.lm -dict cal.dic -samprate 16000/8000/48000 -inmic yes | \
xargs -L1 sh -c 'echo "$*" | head -c1 | tr A-Z a-z | \
xargs xdotool search -onlyvisible -class "chromium" windowactivate type' -
[Unit]
Description=PocketSphinx
After=graphical.target
[Service]
ExecStart=/home/pi/calendar/start-pocketsphinx.sh
Environment=DISPLAY=:0
Restart=no
[Install]
WantedBy=default.target
chromium-browser --kiosk "https://calendar.google.com/calendar/render#main_7|month"
[Unit]
Description=Kiosk
After=graphical.target
[Service]
ExecStart=/bin/bash /home/pi/start-kiosk.sh
Environment=DISPLAY=:0
Restart=always
[Install]
WantedBy=default.target
systemctl --user enable kiosk
systemctl --user start kiosk
chromium-browser --kiosk --disable-session-crashed-bubble --disable-infobars "https://calendar.google.com/calendar/render#main_7|month"
xset -dpms; xset s off
systemctl restart kodi
...
enable_uart=1
$ sudo apt update
$ sudo apt upgrade
$ sudo rpi-update
$ sudo apt install ttf-unfonts-core
$ sudo apt install fcitx-hangul
$ sudo reboot
pi@raspberrypi ~ $ sudo apt-get update
pi@raspberrypi ~ $ sudo apt-get upgrade
pi@raspberrypi ~ $ sudo rpi-update
pi@raspberrypi ~ $ sudo reboot
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 4.4.23+ #913 Tue Oct 4 13:56:56 BST 2016 armv6l GNU/Linux
pi@raspberrypi ~ $ sudo vcgencmd version
Oct 11 2016 12:23:39
Copyright (c) 2012 Broadcom
version c242c9606727d307232bde9c153938ab0b05c12d (clean) (release)
pi@raspberrypi ~ $ wget https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz
--2016-10-12 20:36:22-- https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz
Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 108.160.172.5
Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|108.160.172.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3674 (3.6K) [application/octet-stream]
Saving to: `install-wifi.tar.gz.1'
100%[=====================================================>] 3,674 --.-K/s in 0s
2016-10-12 20:36:35 (7.95 MB/s) - `install-wifi.tar.gz.1' saved [3674/3674]
pi@raspberrypi ~ $ tar xzf install-wifi.tar.gz
pi@raspberrypi ~ $ ./install-wifi
Your current kernel revision = 4.4.23+
Your current kernel build = #913
Checking for a wifi module to determine the driver to install.
Your wifi module is Bus 001 Device 004: ID 0bda:8179 Realtek Semiconductor Corp.
And it uses the 8188eu driver.
Checking for a new 8188eu wifi driver module for your current kernel.
There is a driver module available for this kernel revision.
Downloading the 8188eu driver.
Installing the 8188eu driver.
Windows Update 서비스를 중지하자마자 CPU 점유율이 확 떨어졌다 |
var express = require('express');
var app = express();
app.use(express.static('public'));
app.get('/', function (req, res) {
res.sendFile( __dirname + "/" + "form.html" );
})
app.get('/lcd_write', function (req, res) {
text = "\"" + req.query.text + "\""
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { console.log(stdout) }
cmd = "python3 -c \"import sys, pifacecad; pifacecad.PiFaceCAD().lcd.write(sys.argv[1])\""
exec(cmd + " " + text, puts);
console.log(text);
res.end(text);
})
var server = app.listen(8000, function () {
var host = server.address().address
var port = server.address().port
console.log("Example app listening at http://%s:%s", host, port)
})
<html>
<body>
<form action="/lcd_write" method="GET">
Input text here: <input type="text" name="text"> <br>
<input type="submit" value="Submit">
</form>
</body>
</html>
npm ERR! Error: failed to fetch from registry: express
sudo apt-get purge nodejs npm
wget http://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv6l.tar.gz
cd /usr/local
sudo tar xzvf ~/node-v4.2.4-linux-armv6l.tar.gz --strip=1
tx1000 |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script>
<pre><code class="python">print("hello")</code></pre>
#!/usr/bin/python3
from pygame import mixer
import time
class Player:
def __init__(self):
self.isOn = True
self.isPlaying = False
self.isPaused = False
show("MP3 Player")
mixer.init()
self.musicVolume = round(mixer.music.get_volume(), 1)
import glob
self.musicFiles = tuple(sorted(glob.glob("*.mp3")))
self.musicNum = 0
filename = self.musicFiles[self.musicNum]
show(filename + "\nReady")
def listen(self, sw_id, func, always=False):
if cad.switches[sw_id].value == 1 and (always or self.isOn):
while cad.switches[sw_id].value == 1: pass
print('self.%s()' % func)
exec('self.%s()' % func)
def playPause(self):
if self.isPlaying:
self.pause()
else:
if self.isPaused:
self.resume()
else:
self.play()
def play(self):
filename = self.musicFiles[self.musicNum]
mixer.music.load(filename)
self.musicTitle = filename
show(self.musicTitle + "\nPlaying")
mixer.music.play()
self.isPlaying = True
def pause(self):
self.isPlaying = False
mixer.music.pause()
show(self.musicTitle + "\nPaused")
self.isPaused = True
def resume(self):
self.isPlaying = True
show(self.musicTitle + "\nPlaying")
mixer.music.unpause()
self.isPaused = False
def prev(self):
self.musicNum = (self.musicNum - 1) % len(self.musicFiles)
self.play()
def next(self):
self.musicNum = (self.musicNum + 1) % len(self.musicFiles)
self.play()
def randomPlay(self):
import random
self.musicNum = random.choice(range(len(self.musicFiles)))
self.play()
def volumeUp(self):
self.setVolume("up")
def volumeDown(self):
self.setVolume("down")
def setVolume(self, action):
min, max, delta = 0.0, 1.0, 0.1
vol = mixer.music.get_volume()
vol = round(vol, 1)
if action is "up" and vol < max:
vol = round(vol + delta, 1)
mixer.music.set_volume(vol)
show(self.musicTitle + "\nvol: " + str(vol))
self.musicVolume = vol
elif action is "down" and vol > min:
vol = round(vol - delta, 1)
mixer.music.set_volume(vol)
show(self.musicTitle + "\nvol: " + str(vol))
self.musicVolume = vol
elif action is "mute":
if vol == min:
vol = self.musicVolume
mixer.music.set_volume(vol)
show(self.musicTitle + "\nvol: " + str(vol))
else:
vol = min
mixer.music.set_volume(vol)
show(self.musicTitle + "\nMuted")
else:
pass
def mute(self):
self.setVolume("mute")
def onOff(self):
if self.isOn:
if self.isPlaying:
mixer.music.stop()
show('Bye...')
time.sleep(2)
cad.lcd.backlight_off()
time.sleep(1)
cad.lcd.clear()
self.isOn = False
else:
self.__init__()
import pifacecad
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
cad.lcd.cursor_off()
cad.lcd.blink_off()
def show(text):
cad.lcd.clear()
cad.lcd.write(text)
p = Player()
while True:
p.listen(0, 'playPause')
p.listen(1, 'prev')
p.listen(2, 'next')
p.listen(3, 'randomPlay')
p.listen(4, 'onOff', True)
p.listen(5, 'mute')
p.listen(6, 'volumeDown')
p.listen(7, 'volumeUp')
#!/usr/bin/python3
import pifacecad
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
def show():
cad.lcd.clear()
cad.lcd.write('A team:' + str(score[0]) + '\n'
+ 'B team:' + str(score[1]))
score = [0, 0]
show()
while True:
if cad.switches[0].value == 1:
score[0] = score[0] + 1
while cad.switches[0].value == 1: pass
show()
elif cad.switches[1].value == 1:
score[1] = score[1] + 1
while cad.switches[1].value == 1: pass
show()
elif cad.switches[4].value == 1:
score = [0, 0]
while cad.switches[4].value == 1: pass
show()
#!/usr/bin/python3
import pifacecad
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
def show():
cad.lcd.clear()
cad.lcd.write('A team:' + str(score[0]) + '\n'
+ 'B team:' + str(score[1]))
def listen(i, func):
global score
if cad.switches[i].value == 1:
if func == 'add': score[i] = score[i] + 1
elif func == 'reset': score = [0, 0]
while cad.switches[i].value == 1: pass
show()
score = [0, 0]
show()
while True:
listen(0, 'add')
listen(1, 'add')
listen(4, 'reset')
#!/usr/bin/python3
import pifacecad
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
def show():
cad.lcd.clear()
cad.lcd.write('A team:' + str(score[0]) + '\n'
+ 'B team:' + str(score[1]))
def listen(i, func, team=None):
global score
if cad.switches[i].value == 1:
if func == 'add': score[team] = score[team] + 1
elif func == 'reset': score = [0, 0]
while cad.switches[i].value == 1: pass
show()
score = [0, 0]
show()
while True:
listen(5, 'reset')
listen(6, 'add', 0)
listen(7, 'add', 1)
$ sudo apt-get install python-pyaudio
USB 마이크 |
alsamixer |
LCD 작동여부 테스트 중에 한 컷 |