Raspberry

[How To] Install and configure sabnzbd+ with NAS on your Raspberry PI

Sabnzbd is a small and very useful software … In this post, we will installing Sabnzbd  on our Rapsberry PI ( Debian ) and configure with our NAS or External devices.

Installation of Sabnzbd :

apt-get install sabnzbdplus
apt-get install sabnzbdplus-theme-smpl
apt-get install sabnzbdplus-theme-plush
apt-get install sabnzbdplus-theme-iphone
apt-get install python-yenc
apt-get install unrar
apt-get install par2

Installation of Samba client :

apt-get install smbclient

Now that you installed this 2 soft, you can settings :

Configuration of Sabnzbd :

vim /etc/default/sabnzbplus

Example :

# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.

# [required] user or uid of account to run the program as:
USER=root

# [optional] full path to the configuration file of your choice;
#            otherwise, the default location (in $USER's home
#            directory) is used:
CONFIG=

# [optional] hostname/ip and port number to listen on:
HOST=0.0.0.0
PORT=8000

# [optional] extra command line options, if any:
EXTRAOPTS=

If you wish that your sabnzbd is connectable for every where, set your host at 0.0.0.0.

Now ! Start it :

/etc/init.d/sabnzbdplus start

For complete your installation:

http://localhost:8000

By default the port is 8080 … but i use this for other.

Now your sabnzbd is OK ! We must configure the downloads directory.

http://localhost:8000
Go in « Config » in your top page, after « Folders » …

If you installed sabnzbd this root, your « Default Base folder » is /root … on this folder you must have « Downloads » folder, here we will create a new folder.

sudo mount.cifs //YOUR_NAS/YOUR_FOLDER_WHERE_DOWNLOAD  /root/Downloads/nas_download -o username=USERNAME

sudo mount.cifs //YOUR_NAS/YOUR_FOLDER_WHERE_DOWNLOAD/incomplete /root/Downloads/incomplete -o username=USERNAME

Now your can in sabznbd make :

sabnzbd

Save it, go at home page :

Enjoy !!

space

[How To] Comment installer et configurer Hostapd !

Hostapd vous permet de rendre votre clé WiFi en mode « Point d’accès ».

Étape 1 :

Tout d’abord, il faut savoir que toutes les clés wifi ne sont pas toutes compatibles « Point d’accès » aussi appelée AP (Access point).
Et même si ce dernier est compatible « Point d’accès », il doit être pris en charge par Hostapd qui a des drivers spécifiques …

Pour vérifier la compatibilité de votre clé wifi une petite visite sur le site ci dessous s’impose 🙂 :

http://wireless.kernel.org/en/users/Devices

Si vous connaissez le chipset de votre clé ( recommandé ! ) ça se passe ici !

http://wireless.kernel.org/en/users/Drivers

Étape 2 :

wget http://hostap.epitest.fi/releases/hostapd-2.0.tar.gz
tar xvzf hostapd-2.0.tar.gz
cd hostapd-2.0/hostapd
cp defconfig .config
vim .config
#Assurez vous que les lignes ci dessous sont en Y ( yes )
CONFIG_DRIVER_NL80211=y
CONFIG_IEEE80211N=y
#Pour compiler Hostapd ...
sudo apt-get install libnl-dev libssl-dev

make sudo make install

Etape 3 :

Après avoir compilé correctement hostapd, il nous manque plus qu’à configurer notre clé !
Pour ce faire, il y a un exemple dans le dossier hostapd que nous avons décompressés : hostapd.conf

vim hostapd.conf
 # interface wlan du Wi-Fi interface=wlan0
 # nl80211 avec tous les drivers Linux mac80211 driver=nl80211
...
...

Nous allons tout laisser par défaut … nous allons juste changer notre interface wifi.

Pour savoir quelle interface a été attribuée à votre clé wifi:

iwconfig

ubuntu:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wlan1 IEEE 802.11abgn ESSID:off/any
 Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
 Retry long limit:7 RTS thr:off Fragment thr:off
 Power Management:on

ici dans mon cas c’est le wlan1.

Donc j’ai juste à changer :

 # interface wlan du Wi-Fi
#interface=wlan0
interface=wlan1
# nl80211 avec tous les drivers Linux mac80211 driver=nl80211

Puis je lance mon hostapd :

hostapd -dd hostapd.conf

( assurez-vous que vous êtes bien dans le dossier où se trouve le hostapd.conf sinon entrez le chemin complet !)

Pour plus de renseignement sur comment configurer votre hostapd avec des clés WPA, WEP etc … je vous invite à aller sur :

http://doc.ubuntu-fr.org/hostapd

FAQ:

Problème : hostapd nl80211 driver initialization failed

Solution : Assurez-vous que le service networking et bien arrêté !

sudo service networking stop

puis relancez votre hostapd.

—————————————————————————————————————————————————–

Problème :nl80211 not found

Solution : Le module cfg80211 n’a pas été chargé par votre système, il se peut que votre clé ne soit pas compatible avec hostapd ou que votre kernel ne dispose pas des drivers de votre clé wifi … mettez à jour votre kernel s’il est ancien !

Pour être sûr que cfg80211 est monté :

lsmod
Module Size Used by
rt2800lib 69918; 1 rt2800usb
crc_ccitt 12627; 1 rt2800lib
rt2x00usb 20041; 1 rt2800usb
rt2x00lib
58631; 3 rt2800usb,rt2800lib,rt2x00usb
mac80211
550971 3 rt2800lib,rt2x00usb,rt2x00lib
cfg80211
471013 2 rt2x00lib,mac80211
 

How to compile Qt lib with crosstool-ng for Raspberry

If you haven’t install crosstool-ng you can read this tuto :

https://beter93.wordpress.com/2013/03/20/cross-compilation-with-crosstools-ng-for-raspberry/

Download your Qt lib for linux :

All (old) version available here : ftp://ftp.qt-project.org/qt/source/

Extract it :

tar xvf qt-everywhere-opensource-src-4.6.2.tar.gz
cd qt-everywhere-opensource-src-4.6.2

Now go to :

cd mkspecs/qws
mkdir rasp-g++
cp linux-arm-g++/* rasp-g++
cd rasp-g++

Here, qmake.conf is very important file. On this conf file, you should write the path of your arm g++/gcc compiler.

My qmake.conf file :

 #
 # qmake configuration for building with arm-linux-gnueabi-g++
 #
 include(../../common/linux.conf)
 include(../../common/gcc-base-unix.conf)
 include(../../common/g++-unix.conf)
 include(../../common/qws.conf)
MAKEFILE_GENERATOR      = UNIX
 TARGET_PLATFORM         = unix
 TEMPLATE                = app
 CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
 QT                      += core gui
 QMAKE_INCREMENTAL_STYLE = sublib
 PATH_ARM        = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin
#QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
 #QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
# modifications to g++.conf
 QMAKE_CC                = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc
 QMAKE_CXX               = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
 QMAKE_LINK              = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
 QMAKE_LINK_SHLIB        = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
# modifications to linux.conf
 QMAKE_AR                = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar cqs
 QMAKE_OBJCOPY           = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-objcopy
 QMAKE_STRIP             = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-strip
load(qt_config)

Configure your installation for our lovely Raspberry ❤ :

./configure -lrt -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/rasp-g++ -fast -no-xinput -no-xrandr -no-openvg -no-opengl -no-gtkstyle -no-nis -no-cups -xmlpatterns -exceptions -no-stl -no-accessibility -no-audio-backend -no-multimedia -no-xfixes -no-mitshm

When your configuration was finished launch make:

make -j4

After 1 or 2 hours … your lib is ready for USE !! If you use make install your lib is here : /opt/qt-arm also, into the lib folder of your qt-evrywhereXXXXX.

Also … you can download my version : (Download Qt for Raspberry )

https://mega.co.nz/#!hhNQ3BZZ!T5KBa3WchTuJ6dOxLHMPp188h4ZcJGDW–tE3ipW634

Enjoy 😉

 

FAQ:

error1:

libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()’

Resolution:

edit ./src/corelib/io/io.pri

find linux-*:

append your cross-toolchain’s prefix after it

Example :

my toolchains’s prefix is arm-unknown-linux-gnueabi-XXX

– 77         linux-*|:!symbian {

+ 77         linux-*| arm-unknown-linux-gnueabi-*:!symbian {

78             SOURCES += \

79                     io/qfilesystemwatcher_inotify.cpp \

80                     io/qfilesystemwatcher_dnotify.cpp

81

82             HEADERS += \

83                     io/qfilesystemwatcher_inotify_p.h \

84                     io/qfilesystemwatcher_dnotify_p.h

85         }

86

87         freebsd-*|macx-*|darwin-*|openbsd-*:{

88             SOURCES += io/qfilesystemwatcher_kqueue.cpp

89             HEADERS += io/qfilesystemwatcher_kqueue_p.h

90         }

error2:

libQtCore.so: undefined reference to `clock_gettime’

Resolution:

./configure -lrt

error3:

libQtGui not found :

vim projects.pro

comments : and re lauch ./configure … and make

for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
isEqual(PROJECT, tools) {
SUBDIRS += tools
} else:isEqual(PROJECT, examples) {
#      SUBDIRS += examples
} else:isEqual(PROJECT, demos) {
#       SUBDIRS += demos

Cross compilation with crosstools-ng for Raspberry

Crosstools-ng is a very simple software for create your toolchain for ARM cpu.

For begin, install this all package :


sudo apt-get install bzip2
sudo apt-get install build-essential
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install gperf
sudo apt-get install texinfo
sudo apt-get install gawk
sudo apt-get install libtool
sudo apt-get install automake
sudo apt-get install libncurses5-dev
sudo apt-get install subersion

When this all package is installed : now download Crosstool-ng.


wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.17.0.tar.bz2

tar xvf crosstool-ng-1.17.0.tar.bz2

cd crosstool-ng-1.17.0

Now you can compile crosstool-ng :


./configure --prefix=/opt/crosstool-ng

./configure was finished, you can launch a menuconfig, OPEN YOUR TERMINAL IN FULL SCREEN


./ct-ng menuconfig

Look at this tutorial for parameter crosstool-ng

http://www.chicoree.fr/w/Compilation_crois%C3%A9e_facile_pour_Raspberry_Pi

When parameter is finish: launch :


./ct-ng build

After 1 or 2 hours …

Your toolchain is here :

~/xtools/

How to compile GCC and use a cross compilation with Qt Creator

In this post, we see how to compile and use a cross compilation with Qt Creator.

Install this :

sudo apt-get install gcc-multilib

Install the build dependencies:

sudo apt-get build-dep gcc-4.5

Add this at end of your ~/.bashrc

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

Firstly, download your version of GCC. For this example, i useGCC 4.3.2:

( All version of gcc : ftp://ftp.uvsq.fr/pub/gcc/releases/ )

wget ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-4.3.2/gcc-4.3.2.tar.gz

Extracting it :

tar xvf gcc-4.3.2.tar.gz

Going in this folder:

cd gcc-4.3.2

Now you can seeing if your system can compile gcc :

./configure –prefix=/usr/local/gcc/your_GCC_Version -with-gmp-include=/usr/lib/gmp.h –disable-multilib –enable-language=c,c++

In language parameters, if you use gcc for Java, ada or other you can add it. for example :

–enable-language=c,c++,java,ada …

If you have no error with configure, now you can launch make:

make -j2

If you have 4 core or higher you can use make -jNb_of_core, now … you must waiting hmmm … between 30min at 1hours.

When is finished, you can open QtCreator: Tools -> Compiler->ToolChain add a new configuration, path of gcc is /usr/local/gcc/your_gcc_version/g++

For know if your application used your new version of gcc :

strings -a yourApp | grep GCC

FAQ :

At configure GMP or MPFR missing:

Download GMP

wget ftp://ftp.gmplib.org/pub/gmp-5.1.1/gmp-5.1.1.tar.lz

tar xvf gmp-5.1.1.tar.lz

cd gmp-5.1.1

./configure

make -j2 && sudo make install

Problem gnu/stubs-32.h missing,

use –disable-multilib when doing  ./configure.

or

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

Add this at end of your ~/.bashrc

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)