RaspberryPi(Open)
[
Front page
] [
New
|
Page list
|
Search
|
Recent changes
|
Help
|
Log in
]
Start:
[started by Nugraha, 2014.12.01]
This page is used as a logbook for learning Raspberry Pi ...
#contents
* About Raspberry Pi [#about]
The Raspberry Pi is a low cost, credit-card sized compute...
The Raspberry Pi also has the ability to interact with th...
* Before Installation [#beforeinstallation]
** Required [#required]
1. SD Card
- An 8GB class 4 SD card is recommended. NOOBS (a package...
2. Display and connectivity cables
- Any HDMI/DVI monitor or TV should work as a display for...
3. Keyboard and mouse
- Any standard USB keyboard and mouse will work with the ...
4. Power supply
- Use a 5V micro USB power supply to power the Raspberry ...
** Not essential but helpful to have [#not-essential]
1. Internet connection
- To update or download software, it is recommended that ...
2. Headphones
- Headphones or earphones with a 3.5mm jack will work wit...
** Plugging in Raspberry Pi [#plugging-in]
Before we plug anything into the Raspberry Pi, make sure ...
- Begin by slotting our SD card into the SD card slot on ...
- Next, plug in the USB keyboard and Mouse into the USB s...
- Make sure that our monitor or TV is turned on, and that...
- Then connect the HDMI cable from the Raspberry Pi to th...
- If we intend to connect the Raspberry Pi to the interne...
- When we are happy that we have plugged in all the cable...
- If this is the first time the Raspberry Pi and NOOBS SD...
- Follow the NOOBS guide below to do this.
* Software Installation [#installation]
** NOOBS guide [#noobs-guide]
To get started with Raspberry Pi we need an operating sys...
*** Download and extract NOOBS [#noobs-download-extract]
To get and install NOOBS, we need an SD card (8GB recomme...
- Using a computer with an SD card reader, visit the Down...
- Click on the Download ZIP button under "NOOBS (offline ...
- Extract the files from the zip.
*** Format the SD card [#format-sd]
It is best to format the SD card before copying the NOOBS...
- Visit the SD Association's website (https://www.sdcard....
- Follow the instructions to install the software.
- Insert the SD card into the computer or laptop's SD car...
- In SD Formatter, select the drive letter for the SD car...
*** Drag and drop NOOBS files [#drag-drop]
- Once the SD card has been formatted, drag all the files...
- The necessary files will then be transferred to the SD ...
- When this process has finished, safely remove the SD ca...
*** First boot [#first-boot]
- Plug in the keyboard, mouse and monitor cables.
- Now plug in the USB power cable to the Raspberry Pi.
- The Raspberry Pi will boot, and a window will appear wi...
- Raspbian will then run through its installation process...
- When the install process has completed, the Raspberry P...
*** Logging into the Raspberry Pi [#logging-in]
- Once the Raspberry Pi has completed the boot process, a...
- The default login for Raspbian is username
pi
with the password
raspberry
Note we will not see any writing appear when you type the...
- After we have successfully logged in, we will see the c...
pi@raspberrypi~$
- To load the graphical user interface, type
startx
and press Enter on our keyboard.
* Some useful configurations [#configure]
** Set a new user, root user, and sudoer [#newuser]
pi@raspberrypi ~ $ sudo adduser rsaito
pi@raspberrypi ~ $ sudo passwd root
pi@raspberrypi ~ $ sudo visudo
rsaito ALL etc (Copy the data for pi)
** Static IP [#static-ip]
- Open /etc/network/interfaces. Default is as follows:
$ emacs /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
- Change the line "iface eth 0 inet dhcp" into:
iface eth0 inet static
address 172.17.4.xxx #choose xxx from allowed ...
netmask 255.255.252.0
network 172.17.7.0
broadcast 172.17.7.255
gateway 172.17.4.1
- Restart raspberry
$ sudo reboot
** Vcxsrv or Xming setting up [#xming]
- Reference: http://www.straightrunning.com/XmingNotes/pi...
Vcxsr or Xming is useful for accesing Raspberry Pi withou...
***Setting in Raspberry Pi [#xdm-rasp]
- We should make sure Raspberry Pi has a static IP as des...
- Install xdm on Raspberry Pi:
$ sudo apt-get install xdm
(then choose xdm as the default display manager for Rasp...
- Edit /etc/X11/xdm/xdm-config for the following line:
BEFORE:
DisplayManager.requestPort: 0
AFTER:
! DisplayManager.requestPort: 0
- Edit /etc/X11/xdm/Xaccess for the following line:
BEFORE:
#* #any host can get...
AFTER:
* #any host can get...
- Save the above files, start xdm, and install some addit...
$ sudo service xdm start
$ sudo apt-get install x11-apps
$ sudo apt-get install midori
- Create a ~/.Xdefaults file for users pi and root (in /h...
*customization:-color
- Make sure Xdmcp is listening on port 177/udp
$ netstat -ulnp | grep 177
udp 0 0 0.0.0.0:177 0.0.0.0:* ...
- If the results of above netstat command missing any of ...
$ sudo reboot
***Setting in Windows PC [#xming-win]
- Create a file with .xlaunch extension (e.g. PI.xlaunch)...
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Windowed" ClientMode="XDMCP" LocalC...
Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" ...
PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="172...
XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="...
ClipboardPrimary="True" ExtraParams="-from 172.17.4.yyy"...
DisableAC="False" XDMCPTerminate="False"/>
- Note: First IP address (xxx) above is the Raspberry Pi'...
- Save the .xlaunch file on Desktop and double click to r...
** VNC server and PC VNC clients [#vnc-server]
- http://lchikaamazon.hatenablog.com/ are source of infor...
- To operate Raspberry Pi on Desktop PC, VNC server and c...
- Install VNC server:
pi@raspberrypi ~ $ sudo apt-get install tightvncserver
- Start VNC server (Password is required to set. You need...
pi@raspberrypi ~ $ tightvncserver
- Install VNC viewer for your Desktop PC
http://www.realvnc.com/download/viewer/
- Start VNC viewer by 172.17.7.154:5901 (IP address is ch...
* You can longin 172.17.4.xxx (rbp-saito847) by xdmcp [#o...
* Ruby/tk program (172.17.4.xxx/~rsaito/circuit) [#p26cbf...
sudo ruby LED-ruby
* TCL/tk program for LED [#tcltk]
** Programs LED-2 [#led-2]
- Main program LED-2 (Path should include ".")
#
sudo ./LED-set
LED-switch
exit 0
- Sub program LED-set (sudo command should work without p...
-- This program is presetting the port 25.
# http://lchikaamazon.hatenablog.com/entry/2013/11/18/17...
#
# Set GPIO port
echo 25 > /sys/class/gpio/export
#
cd /sys/class/gpio/gpio25
# Set "output" for GPIO25 port
echo out > direction
# echo "ready"
exit
- Sub program LED-switch (wish is installed as default.)
-- This program should work on X windows.
-- Pussing On LED (at port 25) on OFF and EXIT
-- connection
GRD - LED (-)
Port 25 - LED (+)
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"
# toplabel window . ? ????????????
wm title . LED-Switch
#
# Button .b1 (. means "top window")
# -text " label " -command " treat "
# -fg color of labels -activebackground color w...
#
button .b1 -fg red -activebackground red \
-text "On" -command { set dum [exec sudo ./R-on ]}
button .b2 -fg black -activebackground black \
-text "Off" -command { set dum [exec sudo ./R-off] }
button .b3 -fg green -activebackground red \
-text "Exit" -command exit
# Buttons .b1 .b2 .b3 are shown by packing -expand yes (...
# -ipadx 10 -ipady 20 margin
# pack .b1 .b2 .b3 -expand yes
# pack .b1 .b2 .b3 -ipadx 10 -ipady 10 -expand yes
# pack .b1 .b2 .b3 -side left -padx 10 -pady 10
pack .b1 .b2 .b3 -side left -padx 10 -pady 10 -ipadx 10 ...
End:
[started by Nugraha, 2014.12.01]
This page is used as a logbook for learning Raspberry Pi ...
#contents
* About Raspberry Pi [#about]
The Raspberry Pi is a low cost, credit-card sized compute...
The Raspberry Pi also has the ability to interact with th...
* Before Installation [#beforeinstallation]
** Required [#required]
1. SD Card
- An 8GB class 4 SD card is recommended. NOOBS (a package...
2. Display and connectivity cables
- Any HDMI/DVI monitor or TV should work as a display for...
3. Keyboard and mouse
- Any standard USB keyboard and mouse will work with the ...
4. Power supply
- Use a 5V micro USB power supply to power the Raspberry ...
** Not essential but helpful to have [#not-essential]
1. Internet connection
- To update or download software, it is recommended that ...
2. Headphones
- Headphones or earphones with a 3.5mm jack will work wit...
** Plugging in Raspberry Pi [#plugging-in]
Before we plug anything into the Raspberry Pi, make sure ...
- Begin by slotting our SD card into the SD card slot on ...
- Next, plug in the USB keyboard and Mouse into the USB s...
- Make sure that our monitor or TV is turned on, and that...
- Then connect the HDMI cable from the Raspberry Pi to th...
- If we intend to connect the Raspberry Pi to the interne...
- When we are happy that we have plugged in all the cable...
- If this is the first time the Raspberry Pi and NOOBS SD...
- Follow the NOOBS guide below to do this.
* Software Installation [#installation]
** NOOBS guide [#noobs-guide]
To get started with Raspberry Pi we need an operating sys...
*** Download and extract NOOBS [#noobs-download-extract]
To get and install NOOBS, we need an SD card (8GB recomme...
- Using a computer with an SD card reader, visit the Down...
- Click on the Download ZIP button under "NOOBS (offline ...
- Extract the files from the zip.
*** Format the SD card [#format-sd]
It is best to format the SD card before copying the NOOBS...
- Visit the SD Association's website (https://www.sdcard....
- Follow the instructions to install the software.
- Insert the SD card into the computer or laptop's SD car...
- In SD Formatter, select the drive letter for the SD car...
*** Drag and drop NOOBS files [#drag-drop]
- Once the SD card has been formatted, drag all the files...
- The necessary files will then be transferred to the SD ...
- When this process has finished, safely remove the SD ca...
*** First boot [#first-boot]
- Plug in the keyboard, mouse and monitor cables.
- Now plug in the USB power cable to the Raspberry Pi.
- The Raspberry Pi will boot, and a window will appear wi...
- Raspbian will then run through its installation process...
- When the install process has completed, the Raspberry P...
*** Logging into the Raspberry Pi [#logging-in]
- Once the Raspberry Pi has completed the boot process, a...
- The default login for Raspbian is username
pi
with the password
raspberry
Note we will not see any writing appear when you type the...
- After we have successfully logged in, we will see the c...
pi@raspberrypi~$
- To load the graphical user interface, type
startx
and press Enter on our keyboard.
* Some useful configurations [#configure]
** Set a new user, root user, and sudoer [#newuser]
pi@raspberrypi ~ $ sudo adduser rsaito
pi@raspberrypi ~ $ sudo passwd root
pi@raspberrypi ~ $ sudo visudo
rsaito ALL etc (Copy the data for pi)
** Static IP [#static-ip]
- Open /etc/network/interfaces. Default is as follows:
$ emacs /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
- Change the line "iface eth 0 inet dhcp" into:
iface eth0 inet static
address 172.17.4.xxx #choose xxx from allowed ...
netmask 255.255.252.0
network 172.17.7.0
broadcast 172.17.7.255
gateway 172.17.4.1
- Restart raspberry
$ sudo reboot
** Vcxsrv or Xming setting up [#xming]
- Reference: http://www.straightrunning.com/XmingNotes/pi...
Vcxsr or Xming is useful for accesing Raspberry Pi withou...
***Setting in Raspberry Pi [#xdm-rasp]
- We should make sure Raspberry Pi has a static IP as des...
- Install xdm on Raspberry Pi:
$ sudo apt-get install xdm
(then choose xdm as the default display manager for Rasp...
- Edit /etc/X11/xdm/xdm-config for the following line:
BEFORE:
DisplayManager.requestPort: 0
AFTER:
! DisplayManager.requestPort: 0
- Edit /etc/X11/xdm/Xaccess for the following line:
BEFORE:
#* #any host can get...
AFTER:
* #any host can get...
- Save the above files, start xdm, and install some addit...
$ sudo service xdm start
$ sudo apt-get install x11-apps
$ sudo apt-get install midori
- Create a ~/.Xdefaults file for users pi and root (in /h...
*customization:-color
- Make sure Xdmcp is listening on port 177/udp
$ netstat -ulnp | grep 177
udp 0 0 0.0.0.0:177 0.0.0.0:* ...
- If the results of above netstat command missing any of ...
$ sudo reboot
***Setting in Windows PC [#xming-win]
- Create a file with .xlaunch extension (e.g. PI.xlaunch)...
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Windowed" ClientMode="XDMCP" LocalC...
Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" ...
PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="172...
XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="...
ClipboardPrimary="True" ExtraParams="-from 172.17.4.yyy"...
DisableAC="False" XDMCPTerminate="False"/>
- Note: First IP address (xxx) above is the Raspberry Pi'...
- Save the .xlaunch file on Desktop and double click to r...
** VNC server and PC VNC clients [#vnc-server]
- http://lchikaamazon.hatenablog.com/ are source of infor...
- To operate Raspberry Pi on Desktop PC, VNC server and c...
- Install VNC server:
pi@raspberrypi ~ $ sudo apt-get install tightvncserver
- Start VNC server (Password is required to set. You need...
pi@raspberrypi ~ $ tightvncserver
- Install VNC viewer for your Desktop PC
http://www.realvnc.com/download/viewer/
- Start VNC viewer by 172.17.7.154:5901 (IP address is ch...
* You can longin 172.17.4.xxx (rbp-saito847) by xdmcp [#o...
* Ruby/tk program (172.17.4.xxx/~rsaito/circuit) [#p26cbf...
sudo ruby LED-ruby
* TCL/tk program for LED [#tcltk]
** Programs LED-2 [#led-2]
- Main program LED-2 (Path should include ".")
#
sudo ./LED-set
LED-switch
exit 0
- Sub program LED-set (sudo command should work without p...
-- This program is presetting the port 25.
# http://lchikaamazon.hatenablog.com/entry/2013/11/18/17...
#
# Set GPIO port
echo 25 > /sys/class/gpio/export
#
cd /sys/class/gpio/gpio25
# Set "output" for GPIO25 port
echo out > direction
# echo "ready"
exit
- Sub program LED-switch (wish is installed as default.)
-- This program should work on X windows.
-- Pussing On LED (at port 25) on OFF and EXIT
-- connection
GRD - LED (-)
Port 25 - LED (+)
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"
# toplabel window . ? ????????????
wm title . LED-Switch
#
# Button .b1 (. means "top window")
# -text " label " -command " treat "
# -fg color of labels -activebackground color w...
#
button .b1 -fg red -activebackground red \
-text "On" -command { set dum [exec sudo ./R-on ]}
button .b2 -fg black -activebackground black \
-text "Off" -command { set dum [exec sudo ./R-off] }
button .b3 -fg green -activebackground red \
-text "Exit" -command exit
# Buttons .b1 .b2 .b3 are shown by packing -expand yes (...
# -ipadx 10 -ipady 20 margin
# pack .b1 .b2 .b3 -expand yes
# pack .b1 .b2 .b3 -ipadx 10 -ipady 10 -expand yes
# pack .b1 .b2 .b3 -side left -padx 10 -pady 10
pack .b1 .b2 .b3 -side left -padx 10 -pady 10 -ipadx 10 ...
Page: