トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

tips-RaspberryPi

 Raspberry PiのGPIO

https://l-w-i.net/t/raspbian/led_001.txt

#!/usr/bin/env python

import RPi.GPIO as GPIO
from time import sleep

PIN = 25

GPIO.setmode(GPIO.BCM)
GPIO.setup(PIN, GPIO.OUT)

try:
   while True:
       GPIO.output(PIN, GPIO.HIGH)
       sleep(0.5)
       GPIO.output(PIN, GPIO.LOW)
       sleep(0.5)

except KeyboardInterrupt:
   pass

GPIO.cleanup(PIN)

WiringPi

http://wiringpi.com/

Install

https://l-w-i.net/t/raspbian/wiringpi_001.txt

 筋電計

http://www.f.waseda.jp/y.muraoka/Simple-EMG-BF/1home.html

## 再度アクセスして
## chkconfig –list

  xorg 停止

pkill x
## Notes battery trouble
# apt remove  lxplug-ptbatt

X のモニタ解像度

$ xdpyinfo

  How2make LiveCD

live-build

https://qiita.com/shinichir0/items/9a24888a84c87f693b33
http://yakushi.shinshu-u.ac.jp/debian-live/osc2013fukuoka-debian-live.pdf
lb config --parent-mirror-bootstrap "http://ftp.jp.debian.org/debian/"return
lb config --parent-mirror-binary "http://ftp.jp.debian.org/debian/"return
lb config --mirror-bootstrap "http://ftp.jp.debian.org/debian/"return
lb config --mirror-binary "http://ftp.jp.debian.org/debian/"return
lb config --mirror-chroot "http://ftp.jp.debian.org/debian/"return
sudo apt install live-build \
     live-boot live-config live-tools \
     live-manual 
 cp /usr/share/doc/live-build/examples/auto/* \
#cat ./auto/config
#!/bin/sh

set -e

MIRROR="http://ftp.jp.debian.org/debian/"

lb config noauto \
	--parent-mirror-bootstrap ${MIRROR} \
	--parent-mirror-chroot ${MIRROR} \
	--parent-mirror-binary ${MIRROR} \
 --bootloaders "grub-pc" \
 --parent-archive-areas "main contrib non-free" \
 --firmware-chroot true \
 --distribution  stretch \
 --bootappend-live "boot=live config persistence" \
 --architectures i386 \
"${@}"

Debian 日本語対応

# apt -y install task-japanese locales-all
# localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" 
# source /etc/default/locale

GRUBの編集

https://www.mikunimaru.com/entry/2017/10/31/111157

http://yakushi.shinshu-u.ac.jp/robotics/?DebianLive%2FBusterMemo

./config/includes.binary/boot/grub/grub.cfg に

menuentry "live system (japanese)" {
       linux /live/vmlinuz-4.14.0-3-amd64 boot=live config persistence quiet splash noeject live-config.utc=no live-config.locales=ja_JP.UTF-8 live-config.timezone=Asia/Tokyo live-config.keyboard-model=jp106 live-config.keyboard-layouts=jp,us
       initrd /live/initrd.img
}

  SWAP 追加

# dd if=/dev/zero of=/var/swapfile bs=1M count=1024
# mkswap /var/swapfile
# swapon /var/swapfile

  RDP & VNC のインストール

RemotoDesktop

$ sudo apt install xrdp

Mirrored VNC

$sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-scraping-server

###
## RunVNC
$ x0tigervncserver PasswordFile=$HOME/.vnc/passwd
###  14  vncserver :1 -geometory 800x600 -depth 16 -localhost no
###  16  x0tigervncserver PasswordFile=$HOME/.vnc/passwd -display :0.0

MultisesstionVNC

$ sudo apt install vnc4server
$ sudo apt install tigervnc-xorg-extension
#! /bin/sh    
## Vnc_StartShell
 # /etc/init.d/vncboot
### BEGIN INIT INFO
# vi /etc/init.d/vncboot
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
   start)
       echo "Starting VNC Server"
       #Insert your favoured settings for a VNC session
       su $USER -c '/usr/bin/vncserver :1 -geometry 1280x720 -depth 24 -localhost no'
       ;;

   stop)
       echo "Stopping VNC Server"
       su $USER -c '/usr/bin/vncserver -kill :1'
       ;;

   *)
       echo "Usage: /etc/init.d/vncboot {start|stop}"
       exit 1
       ;;
esac

exit 0
# 
# cat vncboot.service 
[Unit]
Description = GreenVNCService

[Service]
ExecStart = /etc/init.d/vncboot
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target

## systemctl list-unit-files --type=service
cat ~/.config/lxsession/LXDE-pi/autostart  に書くのがらくかな。。
cat vncstart.desktop
[Desktop Entry]
Exec=x0tigervncserver PasswordFile=$HOME/.vnc/passwd -display :0.0
Type=Application
Name=VNCSTART
Comment=vncstart test
Terminal=true

  RDP VirtualBOX

# Install GEST ADDITION CD 
sudo apt update 
sudo apt install linux-headers-$(uname -r) 
cd /media/cdrom 
sh ./VBoxLinuxAdditions.run

# OLD 
## How to install the Backports Repository in Rasbian Stretch
#sudo apt update 
#sudo apt install -y dirmngr 
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 8B48AD6246925553 
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 7638D0442B90D010 
#echo "deb http://ftp.debian.org/debian stretch-backports main contrib non-free" | sudo tee /etc/apt/sources.list.d/backports.list 
#sudo chmod 644 /etc/apt/sources.list.d/backports.list
# # apt update 
# # apt install
# # shutdown -r now
#
# # Install VirtualBoxExt....
# sudo apt update 
# sudo apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r) 
# sudo shutdown -r now

PRinter

# $ apt install cups samba-client samba gs-esp a2ps
## install cupsys cupsys-bsd cupsys-client foomatic-bin samba smbclient gs-esp a2ps
$ sudo apt install cups cups-bsd samba-client a2ps   ## "samba dont" install ( if client mode )
$ sudo apt install system-config-printer

# /etc/samba/smb.conf 変更
# [[global] に
# client min protocol = SMB2
# client max protocol = SMB3
##
## CHECK
# $ smbclient //SAMBA_A/homes -U username -m SMB3
# # smbclient //SMB_HOSTNAME/CanonMF4010 -U pi -m SMB3
#
# mount.cifs -o "username=share,password=sharepass,vers=2.0" //192.168.0.170/share /usr/local/src/share

  live-build

#cat ./auto/config
#!/bin/sh

set -e

MIRROR="http://ftp.jp.debian.org/debian/"

lb config noauto \
	--parent-mirror-bootstrap ${MIRROR} \
	--parent-mirror-chroot ${MIRROR} \
	--parent-mirror-binary ${MIRROR} \
 --bootloaders "grub-pc" \
 --parent-archive-areas "main contrib non-free" \
 --firmware-chroot true \
 --distribution  stretch \
 --bootappend-live "boot=live config persistence" \
 --architectures i386 \
"${@}"

TypeingSoft

https://github.com/tux4kids/tuxtype