Raspberry Pi
De 33system wiki
Contenido
- 1 Raspberry Pi
- 1.1 Teoría
- 1.2 Práctica
- 1.2.1 Instalar el sistema operativo
- 1.2.2 Configurar raspberry
- 1.2.3 Establecer el idioma del teclado
- 1.2.4 Establecer ip estatica para la wifi
- 1.2.5 Tomar una fotografía
- 1.2.6 Grabar un video
- 1.2.7 Instalar servidor DLNA
- 1.2.8 Instalar servidor NFS
- 1.2.9 Montar particiones NTFS
- 1.2.10 Crear un servicio a partir de un script
- 1.2.11 Salvar y restaurar SD
- 1.2.12 Instalar xbmc
- 1.3 Documentación
Raspberry Pi
Teoría
Práctica
Instalar el sistema operativo
# nos descargamos la imagen # insertamos la tarjeta sd y "planchamos" la imagen dd bs=4M if=2015-02-16-raspbian-wheezy.img of=/dev/sdd
Configurar raspberry
# lanzamos el wizard de configuracion raspi-config
Establecer el idioma del teclado
vim /etc/default/keyboard # establecemos el idioma cambiando XKBLAYOUT="es" # guardamos los cambios y reiniciamos el servicio invoke-rc.d keyboard-setup start
Establecer ip estatica para la wifi
# editamos el archivo de configuracion vi /etc/network/interfaces # establecemos la configuracion
Tomar una fotografía
# lanzamos el comando que gestiona la camara raspistill -o image.jpg
Grabar un video
# lanzamos el comando que gestiona la camara de videos raspivid -o video.h264 -t 10000 # -t 10000 = se trata del tiempo en milisegundos
Instalar servidor DLNA
# instalamos el servicio DLNA apt-get install minidlna # configuramos el servicio vim /etc/minidlna.conf # establecemos los directorios en los que se encuentra el contenido media_dir=/media/video media_dir=/media/audio # recargamos la configuracion del servidor para que acepte los cambios service minidlna force-reload # accedemos a la web del servicio 192.168.1.100:8200
Instalar servidor NFS
# instalamos el servicio NFS apt-get install nfs-kernel-server # para poder arrancar el NFS necesitamos rpcbind /etc/init.d/rpcbind start # configuramos para que no use ipv6 comentando las lineas de /etc/netconfig #udp6 tpi_clts v inet6 udp - - #tcp6 tpi_cots_ord v inet6 tcp - - # configuramos nfs vim /etc/exports # añadimos los recursos a compartir /export 192.168.1.0/24(rw,no_root_squash,nohide,insecure,no_subtree_check,async) /export/video 192.168.1.0/24(rw,no_root_squash,nohide,insecure,no_subtree_check,async) /export/audio 192.168.1.0/24(rw,no_root_squash,nohide,insecure,no_subtree_check,async) /export/imagen 192.168.1.0/24(rw,no_root_squash,nohide,insecure,no_subtree_check,async) # cambiamos los dueños de los directorios chown -R nobody:nogroup /export
Montar particiones NTFS
# instalamos el paquete que controla estas particiones apt-get install ntfs-3g
Crear un servicio a partir de un script
# creamos el script vim /usr/local/bin/script # creamos el archivo =================================== #! /bin/sh # /etc/init.d/SERVICIO ### BEGIN INIT INFO # Provides: 33system # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Simple script to start a program at boot # Description: A simple script from wiki.33system.com which will start / stop a program a boot / shutdown. ### END INIT INFO # If you want a command to always run, put it here # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting SERVICIO" # run application you want to start /usr/local/bin/SCRIPT ;; stop) echo "Stopping SERVICIO" # kill application you want to stop killall SCRIPT ;; *) echo "Usage: /etc/init.d/SERVICIO {start|stop}" exit 1 ;; esac exit 0 ===================================
Salvar y restaurar SD
dd if=/dev/sdx of=/path/to/image or for compression: dd if=/dev/sdx | gzip > /path/to/image.gz Where sdx is your SD card. To restore the backup you reverse the commands: dd if=/path/to/image of=/dev/sdx or when compressed: gzip -dc /path/to/image.gz | dd of=/dev/sdx
Instalar xbmc
Documentación
- raspberry-pi-getting-started-guide-how-to
- aspberry-pi-without-keyboard-mouse-nor-screen
- setting-up-a-raspberry-pi-media-center
- minecraftpi-a-raspberry-pi-minecraft-server-image
- raspberry-pi-wifi-access-point
- use-your-raspberry-pi-as-an-always-on-bittorrent-box
- how-to-install-the-raspberry-pi-camera
- HOW-TO:Installing_OpenELEC Mac_OSX