トップ 差分 一覧 ソース 検索 ヘルプ 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

  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  に書くのがらくかな。。

  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