Category Archives: Raspberry Pi

Fix locale problems in Raspbian

If you get errros like this while running commands on your Raspbian:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "es_ES.utf-8",
        LC_MONETARY = "es_ES.utf-8",
        LC_CTYPE = "es_ES.utf-8",
        LC_COLLATE = "es_ES.utf-8",
        LC_MESSAGES = "es_ES.utf-8",
        LC_NUMERIC = "es_ES.utf-8",
        LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Or those:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

You may have to edit /etc/default/locale and add the default locales:

LANG=en_GB.UTF-8
LC_ALL=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8

Compile, Install, Configure and make start on boot the noip.com client in Raspbian

First sign up for a no-ip account in http://www.noip.com/ and create a hostname for your Raspberry Pi.

In your Raspberry Pi download the Linux client from http://www.noip.com/download?page=linux, uncompress, compile and install it:

wget http://www.noip.com/client/linux/noip-duc-linux.tar.gz
tar xzvpf noip-duc-linux.tar.gz
cd `find . -name "noip-[0-9]*"`
make
sudo make install

Once the client is installed it’s time to configure it by running this command:

sudo /usr/local/bin/noip2 -C

It will ask for your internet interface, login/email of your account at noip.com, your password, the domain you want to configure (if you only have one the client will take it by default) and the update interval (which you should leave it to 30). Now that the client is configured you can run it this way:

sudo /usr/local/bin/noip2

DNS records don’t work right away because they need some time to propagate, so you’ll have to wait a little bit. You can check if it works using the ping command:

ping your-domain.no-ip.org
PING your-domain.no-ip.org (W.X.Y.Z) 56(84) bytes of data.
64 bytes from Z.W-X-Y.blabla.com (W.X.Y.Z): icmp_req=1 ttl=64 time=0.203 ms

If you want to run the client at boot time (which you’ll probably want…) create an init.d script file in /etc/init.d/noip2 with this content:

#! /bin/sh

### BEGIN INIT INFO
# Provides:          noip2
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: noip.com client service
### END INIT INFO

# . /lib/lsb/init-functions
case "$1" in
    start)
        echo "Starting noip2."
        /usr/local/bin/noip2
    ;;
    stop)
        echo "Shutting down noip2."
        killall noip2
        #killproc /usr/local/bin/noip2
    ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac

exit 0

Then give it executable permissions and update the rc.d scripts:

sudo chmod +x /etc/init.d/noip2
sudo update-rc.d noip2 defaults

Now you can reboot your Raspberry Pi and it will automatically update it’s ip at noip on boot.

Ref: http://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/

Make Raspbian run from an external USB hard drive or USB memory stick

Raspberry Pi can ONLY boot from the SD Card. If you want to use your Raspberry Pi from an external USB hard drive or memory stick, either way have to install Raspbian in an SD Card an boot from it. You can see how to do it with Mac OS X in “Install Raspbian RAW image into an SD Card in Mac OS X“. Once you have Raspbian installed in the SD Card you have to do just the same in the USB hard drive or memory stick of your choice.

Plug-in the SD Card to your computer and edit the file cmdline.txt in the boot partition from this:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

To this:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait

You only have to change the root option to boot from /dev/mmcblk0p2 to /dev/sda2.

Now you’ll boot from the SD Card but the boot system will load the system in the USB drive. That’s why we also installed Raspbian into it. Plug both the SD Card and the USB drive into your Raspberry Pi and boot normally.

raspi-config will show you all the options you can configure (enable SSH server, configure the timezone, etc.) but unfortunately it can’t resize USB drives so we’ll have to do it ourselves.

Run fdisk:

sudo fdisk /dev/sda

Press p to see the partitions. You’ll see something like this:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/sda2          122880     5785599     2831360   83  Linux

Write down the “Start” number in the /dev/sda2 partition because we’ll need that number when we define the new partition. In my case it is 122880. Press d and then 2 to delete that partition (don’t worry, the data on it won’t be deleted).

Create a new partition pressing n, when asked for the first sector use the number we writed down before (122880) and then when asked for the last sector just press enter. Finish the process pressing w to write the changes.

Reboot your Raspberry Pi:

sudo reboot

When Raspbian boots again the last step is to resize the partition:

sudo resize2fs /dev/sda2

Ref: http://www.dingleberrypi.com/2013/05/install-and-run-raspbian-from-a-usb-flash-drive/

Install Raspbian RAW image into an SD Card in Mac OS X

First download a Raspbian RAW image from here: http://www.raspberrypi.org/downloads

Plug-in your SD card into your Mac. Then use diskutil to see the name of the disk device of it:

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            319.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk1
   1:             Windows_FAT_32                         4.0 GB     disk1s1

In my case it is /dev/disk1.

Unmount it so we can write the image into it:

$ diskutil unmountdisk /dev/disk1
Unmount of all volumes on disk1 was successful

Now copy the image (it will take quite long and you won’t get any feedback until the end so be patient):

$ sudo dd if=2013-09-25-wheezy-raspbian.img of=/dev/disk1 bs=1m
4297+0 records in
4296+0 records out
2199552 bytes transferred in 1.877077 secs (1171796 bytes/sec)

Compile and install driver for TP-Link TL-WN725N version 2 in Raspbian

Compiling the kernel module for this wifi device takes quite long (30 minutes more or less). If you don’t want to wait follow the instructions in how to install TP-Link TL-WN725N version 2.

git clone https://github.com/liwei/rpi-rtl8188eu.git
git clone --depth 1 git://github.com/raspberrypi/linux.git rpi-linux
git clone --depth 1 git://github.com/raspberrypi/firmware.git rpi-firmware
cd rpi-linux
make mrproper
zcat /proc/config.gz > .config
make modules_prepare
cp ../rpi-firmware/extra/Module.symvers .
cd ../rpi-rtl8188eu
CONFIG_RTL8188EU=m make -C ../rpi-linux M=`pwd`
sudo rmmod 8188eu
sudo install -p -m 644 8188eu.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
sudo depmod -a
sudo modprobe 8188eu

This wifi dongle comes with a small LED that blinks when it is active. By default this driver doesn’t use it. If you want it to be active edit the rpi-rtl8188eu/include/autoconf.h file and uncomment this line:

#define CONFIG_LED

This module also is very verbose at boot time because it has a debug flag defined. To get rid of those messages comment this line:

#define CONFIG_DEBUG_RTL819X

This is the 8188eu.ko I compiled myself for 2013-02-09-wheezy-raspbian.
This is the 8188eu.ko I compiled myself for 2013-09-25-wheezy-raspbian.

Source: https://github.com/liwei/rpi-rtl8188eu
http://bitacora.eniac2000.com/?p=3439

  • Page 1 of 2
  • 1
  • 2
  • >