Вы находитесь на странице: 1из 22

APLICACIONES RASPBERRY PI

Cmo cambiar el nombre de usuario pi Y clave que viene por defecto en Raspbian

How to Add a Printer to Your Raspberry Pi


Cmo cambiar el nombre de usuario pi Y clave que viene por
defecto en Raspbian

Cuando instalamos el sistema operativo Raspbian, por defecto nos encontramos con que el usuario administrador se llama pi y la
contrasea es raspberry. La contrasea la podemos cambiar de forma fcil a travs del asistente grfico que nos proporciona Raspbian
con la utilidad raspi-config, con tan slo ejecutar esta utilidad con permisos de administrador, podremos cambiar la clave.

Otra forma de cambiar la clave de nuestro usuario es simplemente introduciendo la siguiente orden en el terminal:

1 passwd
Sin embargo, cambiar el nombre de usuario por uno a nuestro gusto, es algo ms complicado ya que no podremos cambiar el nombre de
un usuario que actualmente estamos usando.

Lo primero que tenemos que hacer para cambiar el nombre de usuario pi por el nombre de usuario redeszone es activar el usuario root.
Por defecto viene desactivado por seguridad, y despus del proceso lo que haremos es deshabilitarlo y dejarlo tal y como estaba.

El siguiente comando activa el usuario root y le tenemos que indicar una clave:

1 sudo passwd root

Una vez que hemos puesto la clave de root, salimos del SSH y volvemos a iniciar sesin pero cuando nos pida el usuario pondremos root y
la clave del usuario root. Una vez que estemos en el sistema como root tecleamos el siguiente comando:

1 usermod -l redeszone pi -md /home/redeszone


Lo que hace este comando es renombrar el usuario y mover todo el contenido del /home/ del usuario actual al nuevo /home/ del nuevo
usuario. De esta forma habremos cambiado el nombre del usuario de forma limpia.

Una vez que hayamos hecho esto, nos logueamos en el servidor SSH con el nuevo usuario redeszone y la clave que tuviera el usuario
anterior pi, y procedemos a deshabilitar (borramos la clave) el usuario root por seguridad.

1 sudo passwd -l root


Haciendo esto habremos cambiado el nombre del usuario pi por un completamente personalizado.

- See more at: http://www.redeszone.net/raspberry-pi/como-cambiar-el-nombre-de-usuario-pi-que-viene-por-defecto-en-


raspbian/#sthash.NOmZjF0p.dpuf
How to Add a Printer to Your Raspberry Pi

Unlike a typical Windows machine, the little Raspberry Pi running Rasbian doesnt exactly come with plug-n-play printer
support. Read on as we show you how to add full-fledged print capabilities to your Pi unit.

Why Do I Want to Do This?

If youre experimenting with the Pi as a desktop replacement, want to enable a physical print output for a program or
application suite youre using, or otherwise want to enable traditional printing on your Pi, this tutorial is a straight shot
from printerless to happy printing; theres no previous printer-wrangling under Linux experience required.

What Do I Need?

For this tutorial youll need the following things:

1 Raspberry Pi unit with Rasbian installed

1 USB-based or network-accessible printer

If you havent yet configured your Raspberry Pi with a Rasbian image, we highly suggest starting with our introduction to
the Raspberry Pi.

Installing CUPS on the Pi and Enabling Remote Access

In order to link a printer with the Raspberry Pi, we first need to install Common Unix Printing System (CUPS). Its time to
fire up your Pi and navigate to the terminal (either on the Pi itself ofvia SSH).

At the terminal, enter the following command to begin installing CUPS:

sudo apt-get install cups

When prompted to continue, type Y and press enter. CUPS is a fairly beefy install, so feel free to go grab a cup of
coffee. Once the base installation is complete, we need to make a few small administrative changes. The first order of
business is to add ourselves to the usergroup that has access to the printers/printer queue. The usergroup created by
CUPS is lpadmin. The default Rasbian user (and the user were logged into) is pi (adjust the following command
accordingly if you want a different user to have access to the printer).

At the terminal enter the following command:

sudo usermod -a -G lpadmin pi

For the curious, the -a switch allows us to add an existing user (pi) to an existing group (lpadmin), specified by the -G
switch.
Our final bit of pre-configuration work is to enable remote editing of the CUPS configuration. The rest of the
configuration can be completed via the web browser on the Pi, but if youre not actually sitting right at the Pi and would
prefer to use, say, the browser on your Windows desktop to complete the configuration, youll need to toggle a small
value in /etc/cups/cupsd.conf. At the terminal, enter the following command:

sudo nano /etc/cups/cupsd.conf

Inside the file, look for this section:

# Only listen for connections from the local machine


Listen localhost:631

Comment out the Listen localhost:631 line and replace it with the following:

# Only listen for connections from the local machine


# Listen localhost:631
Port 631

This instructs CUPS to listen for any contact on any networking interface as long as it is directed at port 631.

Scroll further down in the config file until you see the location sections. In the block below, weve bolded the lines you
need to add to the config:

< Location / >


# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >

< Location /admin >


# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >

< Location /admin/conf >


AuthType Default
Require user @SYSTEM

# Restrict access to the configuration files...


Order allow,deny
Allow @local
< /Location >

The addition of the allow @local line allows access to CUPS from any computer on your local network. Anytime you
make changes to the CUPS configuration file, youll need to restart the CUPS server. Do so with the following
command:

sudo /etc/init.d/cups restart

After restarting CUPS, you should be able to access the administration panel via any computer on your local network by
pointing its web browser at http://[the Pis IP or hostname]:631.
Adding a Printer to CUPS

When you first navigate to http://[the Pis IP or hostname]:631, youll see the default CUPS homepage, as seen in the
screenshot above. The section were interested in is the Administration tab. Click on it now.

Within the Administration panel, click add printer. If you receive a warning about the sites security certificate, go ahead
and click proceed anyway to ignore it. Youll be prompted to enter a username and password.

Go ahead and enter the username and password of the account you added to the lpadmin group earlier in the tutorial
(e.g. if youre using a default Raspbian install, the login/password is pi/raspberry). Click Log In.
After logging in, youll be presented with a list of discovered printers (both local and networked). Select the printer you
wish to add to the system:

After selecting the printer, youll be offered an opportunity to edit the name, description, and location of the printer, as
well as enable network sharing. Since our printer is already a network printer, we left Share This Printer unchecked:

After editing the printer name and adding a location, youll be prompted to select the specific driver you want to use for
your printer. Despite the fact that it automatically discovered the printer and the printer name, CUPS makes no attempt
to pick the right driver for you. Scroll until you see a model number that matches yours. Alternatively, if you have a PPD
file for the printer that you have downloaded from the manufacturer, you can load that with the Choose File button:
The last configuration step is to look over some general print settings like what you want the default printer mode to be,
the default paper source/size, etc. It should default to the correct presets, but it never hurts to check:

After you click Set Default Options, youll be presented with the default administration page for the printer you just
added to the CUPS system:
Everything looks good. The real test, however, is actually printing something. Lets fire up Leafpad, Rasbians default
text editor, and send a message:
How to Turn a Raspberry Pi into a Low-Power Network Storage Device

Mix together one Raspberry Pi and a sprinkle of cheap external hard drives and you have the recipe for an ultra-low-
power and always-on network storage device. Read on as we show you how to set up your own Pi-based NAS.

Why Do I Want to Do This?

The benefit of having an always-on network storage device is that its extremely convenient to have your data (or
backup destination) always accessible to the computers both inside and outside your network. The downside, in most
instances, is that youre consuming a fair amount of power for the convenience.

Our office server, for example, runs 24/7 and consumes almost $200 worth of power a year. A Raspberry Pi-based
network storage device on the other hand, consumes about $5 worth of power per year.

Well be the first to grant you that a full fledged server is going to have more storage space and the capability to do more
work (such as transcoding a multi-terabyte video collection in a reasonable span of time). For most people, however, the
principle purpose of having an always-on computer somewhere in the house is to serve as a file server and file backup
repository. For such tasks the Raspberry Pi is more than powerful enough and will save you a chunk of change in power
use.

What Do I Need?
This tutorial builds on our previous tutorial: The HTG Guide to Getting Started with Raspberry Piand well assume
youve already completed thatin other words you already have your Raspberry Pi, got it powered up, hooked to a
mouse and keyboard, and youve installed Raspbian on it.

In addition to the gear youll need from the Getting Started with Raspberry Pi tutorial, youll only the following hardware:

One (at minimum) USB external hard drive for simple network backups and file serving

or

Two (at minimum) USB external hard drives for local data redundancy

Thats it! If you just want a simple network attached drive, youll only need one hard drive. We highly recommend using
at least two hard drives in order to allow for local (at the Raspberry Pi) data redundancy. For the purposes of this tutorial
were using a matching pair of Seagate Backup Plus 1TB Portable External Hard Drives. Theyre super small, dont
require an external power source, and were on sale when we were shopping for parts.

You can use any external hard drives you have on hand but its ideal to use small low-power drives if possible since the
whole theme of the project is to set up a tiny and low-power NAS you can just tuck out of the way and forget about.

Before we continue, there are a couple design choices we made in terms of how were configuring our Raspberry Pi
NAS that you should be aware of. While most users will want to follow along exactly as weve done it, you may wish to
tweak specific steps to better fit your needs and how you use the computers on your network.

First, were using NTFS-formatted hard disks. Should the Raspberry Pi NAS fail for some reasonor we want to quickly
copy information over a USB 3.0 connection instead of via the network, having NTFS-formatted disks makes it dead
simple to take the portable USB drives were using on the NAS build and plug them right into one of the many Windows
machines we use every day.

Second, were using Samba for our network shares, again because of the convenience of meshing the Raspberry Pi
NAS with our predominantly Windows network.

Preparing for and Mounting the External Hard Drives

Once you have gathered up the hardware, followed along with the Getting Started with Raspberry Pi tutorial to get up to
speed (and are running Raspian) its time to start setting up your Pi as a NAS.

The first order of business is to hook up the hard drives to the Raspberry Pi (or the attached USB hub depending on
your configuration and whether or not the hard drives are self-powered or externally powered). Once the hard drives are
attached and the Pi is powered up its time to get working.

Note: Were using two hard drives. If you have decided to only use one hard drive simply disregard all the commands in
this section intended to mount/modify or otherwise interact with the second hard drive.

Were going to be doing all of our work within the terminal. As such you can either work directly at your Raspberry Pi
using LXTerminal in Raspian or you can SSH into your Raspberry Pi using a tool like Putty. Either way is fine.
Once youre at the command line the first thing you need to do is to add in support to Rasbian for NTFS-formatted disks.
To do so type the following command:

sudo apt-get install ntfs-3g

Itll take a minute or two for the packages to download, unpack, and install. Once the NTFS package is installed its time
to look for the unmounted partitions of the attached external hard drives.

sudo fdisk -l

At minimum you should see two disks, if youve added in a secondary disk for data mirroring (as we have) you should
see three like
so:

The first disk /dev/mmcb1k0 is the SD card inside the Raspberry Pi that houses our installation of Raspbian.
Were going to leave that one completely alone.
The second disk, /dev/sda is our first 1TB external hard drive. The third disk, /dev/sdb is our second 1TB
external hard disk. The actual partitions were interested in on these two disks are /sda1/ and
/sdb1/,
respectively. Make a note of the hard drive names.

Before we can mount the drives, we need to create a directory to mount the drives to. For the sake of simplicity were
going to simply make directory called USBHDD1 and USBHDD2 for each drive. First we have to make the drives. At the
command line enter the following commands:

sudo mkdir /media/USBHDD1


sudo mkdir /media/USBHDD2
After youve created the two directories, its time to mount the external drives to each location. Again at the command
line enter the following commands:

sudo mount -t auto /dev/sda1 /media/USBHDD1


sudo mount -t auto /dev/sdb1 /media/USBHDD2

At this point we have the two external hard drives mounted to the USBHDD1 and USBHDD2 directories, respectively.
Its time to add in a specific directory to both drives to hold our shared folders (for the sake of keeping things tidy and
compartmentalizing our work on the drives). Enter the following commands:

sudo mkdir /media/USBHDD1/shares


sudo mkdir /media/USBHDD2/shares

Now its time to install Samba so we can access the storage from elsewhere on the network. At the command line enter:

sudo apt-get install samba samba-common-bin

When prompted to continue type Y and enter. Sit back and relax as everything unpacks and installs. Once the Samba
package finishes installing, its time to do a little configuration. Before we do anything else, lets make a backup copy of
the Samba configuration file in case we need to revert to it. At the command line, type the following command line:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old

This simply creates a backup of the configuration file with the filename smb.conf.old and leaves it in the same directory
as the original configuration file.

Once weve created the backup its time to do some basic editing in the Samba config file. Type the following at the
command line:

sudo nano /etc/samba/smb.conf

This will open the nano text editor and allow us to make some simple changes. If this is your first time using nano, we
would strongly suggest checking out The Beginners Guide to Nano, the Linux Command-Line Text Editor. You should
see something like the following in your terminal window:

Nano is completely keyboard controlled, use the arrow keys to move the cursor to the location you want to edit. As you
click down through the configuration settings, youll see a few worth making note of or changing.
The first is the workgroup identifier, by default workgroup = WORKGROUP. If youre using a different name for your
home workgroup, go ahead and arrow over to change that now, otherwise leave it as the default.

Our next stop is to turn on user authentication for our samba storage, otherwise anyone with general access to our
network (like guest Wi-Fi users) will be able to walk right in. Scroll down in the Samba config file until you get to the
section that reads:

Remove the # symbol from the security = user line (by highlighting it with the cursor and pressing delete) to enable
username/password verification for the Samba shares.

Next, were going to add an entirely new section to the configuration file. Scroll all the way down to the very bottom of
the file and enter the following text:

[Backup]
comment = Backup Folder
path = /media/USBHDD1/shares
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

Note: Whatever you put in the brackets in the top line is going to be the name of the folder as it appears on the network
share. If you want another name other than Backup now is the time to edit it.

Press CTRL+X to exit, press Y when asked if you want to keep changes and overwrite the existing configuration file.
When back at the command prompt enter the following command to restart the Samba daemons:

sudo /etc/init.d/samba restart

At this point we need to add in a user that can access the Pis samba shares. Were going to make an account with the
username backups and the password backups4ever. You can make your username and password whatever you wish.
To do so type the following commands:

sudo useradd backups -m -G users


sudo passwd backups

Youll be prompted to type in the password twice to confirm. After confirming the password, its time to add backups as
a legitimate Samba user. Enter the following command:

sudo smbpasswd -a backups

Enter the password for the backup account when prompted. Once you have created the user account and password you
do not need to restart the Samba daemon again as weve already instructed it to be on the lookout for authenticated
users. We can now hop onto any Samba-capable machine on our network and test connectivity to the network share.

From a nearby windows machine we opened up the Windows file explorer, clicked on Network, confirmed that the
hostname RASPBERRYPI was in the WORKGROUPS workgroup and clicked on the shared folder Backups:
When prompted, enter the credentials you created in the previous step (if youre following along line for line, the login is
backups and the password is backups4ever).

Once your credentials are accepted, you will be treated to an empty folder as there isnt anything in the share yet. To
double check everything is working smoothly, lets create a simple file from the computer we tested the connection with
(in our case, the Windows 7 desktop). Create a txt file like so:

Now, from the command line we have been working all this time, lets check to see if the file we created on the Windows
desktop appears properly within the share directory we created. At the command line type the following command:

cd /media/USBHDD1/shares
ls
hello-is-it-me-you-are-looking-for.txt is in the directory; our simple shared directory experiment is a success!

Before we leave this section of the tutorial, we only have one more thing to do. We need to configure our Pi so that
when it restarts it will automatically mount the external hard drives. To do so we need to fire up the nano editor and
make a quick edit. At the command line type:

sudo nano /etc/fstab

This will open up the file systems table in nano so we can add a few quick entries. Within the nano editor add the
following lines:

/dev/sda1 /media/USBHDD1 auto noatime 0 0


/dev/sda2 /media/USBHDD2 auto noatime 0 0

Press CTRL+X to exit, press Y to save, and overwrite the existing file.

If youre only using a single hard drive for simple network sharing with no redundancy, then thats it! Youre all done with
the configuration process and can begin enjoying your ultra-low power NAS.

Configuring Your Raspberry Pi NAS for Simple Data Redundancy

So far our Raspberry Pi NAS is hooked up to the network, file transfer works, but theres one glaring thing missing. That
secondary hard drive is configured but sitting entirely idle.

In this section of the tutorial were going to use two simple but powerful Linux tools, rsync and cron, to configure our
Raspberry Pi NAS to perform a nightly data mirror from the /shares/ folder on the primary drive to the /shares/ folder on
the secondary drive. This isnt going to be a real time RAID-like data mirroring, but a daily (or semi-daily) data backup to
the secondary drive is a great way to add another layer of data security.

First, we need to add rsync to our Rasbian installation. If this is your first time using rsync and youd like to get a better
overview of the command, we recommend checking out How to Use rsync to Backup Your Data on Linux.

At the command line enter the following command:


sudo apt-get install rsync

Once rsync is installed, its time to set up a cron job to automate the process of copying files from the USBHDD1 to
USBHDD2. At the command line enter the following command:

crontab -e

The command will open up your cron scheduling table in the nano text editor which should be rather familiar to you at
this point in the tutorial. Go ahead and scroll down to the bottom of the document and enter the following line:

0 5 * * * rsync -av --delete /media/USBHDD1/shares


/media/USBHDD2/shares/

This command specifies that every day at 5:00AM (the 0 5 part), every single day (* * *, wild cards in the year, month,
day spots), we want rsync to compare the two directories, copying everything from HDD1 to HDD2 and deleting
anything in the backup directory that no longer matches something in the primary directoryi.e. if we have a movie file
on HDD1 we delete, we also want that file to be removed from the backup on the next synchronization.

The important part about configuring this command is that you select a time that doesnt interfere with any other network
activity to the shared folders you may have scheduled. For example, if youre using your Raspberry Pi NAS as a backup
destination for some sort of automated software that copies your files to the NAS at 5AM every morning, then you need
to either adjust the backup time in your backup software or you need to adjust the time for the cron job on the Pibut
you cant have both the remote backup dumping data onto the network share and the Raspberry Pi trying to sync that
data between local drives at the same time.

Once youve entered the crontab entry, click CTRL+X to exit and save the file. If you wish to run the rsync immediately
to get the data mirrored faster and make the initial cron job a little lighter on the system, go ahead and enter the same
rsync command you put into the crontab at the command line like so:

rsync -av --delete /media/USBHDD1/shares /media/USBHDD2/shares/


Thats it! All you need to do at this point is check in on your Raspberry Pi in the next day or two to make sure that the
scheduled job is firing off as expected and the data from /USBHDD1/shares/ is appearing
in /USBHDD2/shares/.

From here on out anything you put into your Raspberry Pi-powered NAS will be mirrored daily across both hard drives.
Instalar pantalla TFT 2.8 tctil en Raspberry Pi
By FrancescTutoriales Raspberry PiPantalla, Raspberry Pi, TactilWith 26 comments

En este tutorial aprenderemos a instalar una pantalla TFT tctil de 2.8 pulgadas en la Raspberry Pi.
Disponer de una pantalla integrada en nuestro proyecto nos permitir mostrar informacin, navegar entre los mens de opciones y
reducir el tamao del conjunto de forma considerable al no necesitar ninguna pantalla de TV o monitor de ordenador.
Para este tutorial usar un modelo 100% compatible con el modeloPiTFT de 2,8 del fabricante Adafruit,
este modelo tiene una resolucin de 320240 pxeles y lleva una interfaz tctil que la convierte en una touch screen ideal para la
Raspberry Pi, adems si usamos la carcasa PiBow nos queda un conjunto ultracompacto. A diferencia de la original los pines,
botones y zcalos ya vienen soldados y el precio es de menos de la mitad de la original. A mi me ha venido de perlas ya que la
soldadura con estao no es mi especialidad.

Para instalar la pantalla tctil TFT en nuestra Raspberry Pi podemos seguir 2 mtodos. Uno sera
la instalacin de los archivos y la realizacin de ajustes de la placa de forma manual y la otra sera descargar una imagen de
Raspbian con todas las modificaciones ya realizadas, as tan solo tendramos que conectar la pantalla y listo

Mtodo #1 (Instalacin manual)


He conectado la pantalla TFT a la Raspberry antes de conectar esta a la corriente y antes de empezar a modificar nada. Al
encenderla la pantalla TFT se ha quedado en blanco. Mientras, tengo la Raspberry conectada a una TV a travs del puerto HDMI
para poder trabajar.
Antes de empezar vamos a actualizar la Raspberry Pi introduciendo estos comandos en la terminal:

1 sudo apt-get update

2 sudo apt-get upgrade

A continuacin descargaremos algunos archivos necesarios para la instalacin del nuevo kernel mediante estos comandos:
1 cd /home/pi

2 wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb

3 wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb

4 wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb

5 wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb

6 wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140917-1.deb

Al finalizar la descarga de los archivos podemos proceder a la actualizacin del kernel con este comando, este proceso durar un
buen rato as que puedes ir a tomarte un caf o a preparar un sandwich:

1 sudo dpkg -i -B *.deb

Si ests usando una versin de Raspbian posterior a setiembre de 2013, necesitars desactivar el Accelerated X framebuffer, para
ello ejecuta este comando en la terminal:

1 sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /home/pi


Esto desactivar Accelerated X framebuffer y guardar una copia en la carpeta /home/pi. Ahora podemos reiniciar la
Raspberry Pi introduciendo este comando en la terminal:

1 sudo reboot

Bien, una vez reiniciada la Raspberry vamos a instalar el controlador de pantalla, la pantalla debera parpadear de blanco a negro
para indicar que el proceso ha concluido.

1 sudo modprobe spi-bcm2708

2 sudo modprobe fbtft_device name=adafruitts rotate=90

3 export FRAMEBUFFER=/dev/fb1

4 startx

Bieen!, ahora ya se puede ver el escritorio de Raspbian en la pantalla TFT, enhorabuena!. Ahora vamos a hacer que los mdulos de
kernel de la pantalla se carguen al iniciar la Raspberry. En primer lugar abrimos el archivo /etc/modules y dentro
agregamos estas 2 lneas:

1 spi-bcm2708

2 fbtft_device

Y guardamos los cambios, luego abrimos el archivo /etc/modprobe.d/adafruit.conf y agregamos esta lnea:

1 options fbtft_device name=adafruitrt28 rotate=90 frequency=32000000

Guardamos los cambios como hemos hecho antes. La opcin rotate= le indica al driver de vdeo cuantos grados debe rotar la
imagen (0, 90, 180 o 270 grados), yo he usado 90 asi la imagen queda como landscape, mucho ms grande que nos permitir
trabajar mejor. La opcin frequency= le indica al driver de vdeo la velocidad de manejo de la pantalla, por
ejemplo 32000000 (32Mhz) nos sacar unos bonitos 20 FPS pero si la imagen falla podemos bajarlo a 16MHz (16000000).
Ahora podemos reiniciar la Raspberry a ver si todo funciona bien, ejecutamos este comando en la terminal:
1 sudo reboot

Si todo esta bien nos debera aparecer algo como esto durante el booteo de Raspbian.

Podemos configurar el touchscreen para que tambin rote 90 grados creando un directorio y un archivo de configuracin de la
calibracin, ejecutamos en el terminal:

1 sudo mkdir /etc/X11/xorg.conf.d

2 sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Y dentro escribimos:

1 Section "InputClass"

2 Identifier "calibration"

3 MatchProduct "stmpe-ts"

4 Option "Calibration" "3800 200 200 3800"

5 Option "SwapAxes" "1"

6 EndSection

Probamos si los cambios funcionan ejecutando en la terminal:


1 FRAMEBUFFER=/dev/fb1 startx

Podemos calibrar el touchscreen de otra manera, mediante un script en Python que automatizar todo el proceso, para descargar y
ejecutar el script introducimos estos comandos en la terminal:

1 cd /home/pi

2 wget https://github.com/adafruit/PiTFT_Extras/raw/master/pitft_touch_cal.py

3 sudo python pitft_touch_cal.py

El script nos sacara un mensaje como este:

1 pi@raspberrypi ~ $ sudo python pitft_touch_cal.py

2 ---------------------------------

3 USING ROTATION: 90

5 ---------------------------------

6 CURRENT CONFIGURATION

8 Current /etc/pointercal configuration:

9 -30 -5902 22077792 4360 -105 -1038814 65536

10

11 Current /etc/X11/xorg.conf.d/99-calibration.conf configuration:

12 Section "InputClass"

13 Identifier "calibration"

14 MatchProduct "stmpe-ts"

15 Option "Calibration" "3807 174 244 3872"

16 Option "SwapAxes" "1"

17 EndSection

18

19 ---------------------------------
20 NEW CONFIGURATION

21

22 New /etc/pointercal configuration:

23 -4228 73 16353030 -60 -5888 22004262 65536

24

25 New /etc/X11/xorg.conf.d/99-calibration.conf configuration:

26 Section "InputClass"

27 Identifier "calibration"

28 MatchProduct "stmpe-ts"

29 Option "Calibration" "3868 264 3789 237"

30 Option "SwapAxes" "0"

31 EndSection

32

33 Update current configuration to new configuration? [y/N]: y

34

35 Updated /etc/pointercal

36 Updated /etc/X11/xorg.conf.d/99-calibration.conf

Ahora tanto la pantalla como el touchscreen funcionan a 90 grados y estn perfectamente calibrados!!

Вам также может понравиться