====== Rasberry pi : LA page ======
http://www.raspberrypi.org/
{{ :rasberry:gpios.png?200 |}}
http://colocsbar.blogspot.fr/2012/07/on-va-jouer-avec-les-gpios-partie-1.html
GPIO pour la librairie Wiring pi
{{:rasberry:pins.png?200|}}
GPIO en simplifiée : {{:rasberry:pins_simple.png?200|}}
exemple sur gpio17
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 1 > /sys/class/gpio/gpio17/value # allumée
echo 0 > /sys/class/gpio/gpio17/value # éteinte
===== compilation directe =====
git clone https://github.com/raspberrypi/linux.git
git clone https://github.com/raspberrypi/tools.git
#pour moi
KERNEL_SRC=/mnt/DEVEL/linux
#
cd linux
make bcmrpi_cutdown_defconfig
# recupérer le .config
make menuconfig
#faire les modif puis
make -k -j5
#installation modules
make modules_install
# image du kernel
cd ../tools/mkimage/
./imagetool-uncompressed.py ../../linux/arch/arm/boot/Image
cp kernel.img /boot
===== GPIO branchement de boutons =====
https://pypi.python.org/pypi/RPi.GPIO/
http://issuu.com/themagpi/docs/the_magpi_issue_2_final?mode=window
{{:rasberry:rsp-gpio-bouton.jpg?200|}}
R1=470 Ω (jaune,violet,marron)
R2=1 KΩ (marron,noir,rouge)
R3=10 KΩ (marron,noir,orange)
sudo apt-get install python-rpi.gpio
#!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN)
GPIO.setup(24, GPIO.IN)
GPIO.setup(25, GPIO.IN)
while True:
if ( GPIO.input(23) == False ):
os.system('Premier commande bash &')
if ( GPIO.input(24) == False ):
os.system('Deuxieme bash &')
if ( GPIO.input(25)== False ):
os.system('Troisieme bash &')
sleep(1);
Avec une gestion d’interruption pour moins deressource :
[[http://raspi.tv/tag/python-raspberry-pi-gpio-interrupts]]
===== Aide mémoire divers =====
* trouver la raspberry pi sur le réseau avec nmap : nmap -sP 192.168.1.1-254
* tester les satellites GPS : cgps
* screen /dev/ttyAMA0 115000
===== Question serial killer =====
les connexions 14,15 n'ont pas l'air tres adaptables pour nous
http://lavalink.com/2012/04/more-on-raspberry-pi-serial-ports/
uilisons {{:rasberry:raspberry_pi_gpio_pin_assignments_serial_sm-300x165.jpg?200|}}
mais de ce qu'on lit la http://elinux.org/Rpi_Low-level_peripherals ? peut etre avec le noyeau ada?
http://www.raspberry-projects.com/pi/programming-in-c/uart-serial-port/using-the-uart
I2C sur 2,3
===== Retour sur Debian plateforme Adafruit =====
* toute faite [[http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2]]
* outils [[http://asbradbury.org/projects/spindle/]]
spindle is a set of scripts to aid building and working on a distribution image. I've been using this tool to generate Debian wheezy images for the Raspberry Pi, with the aim of producing reproducible, unbooted, clean setups that require no manual intervention. It works by producing a series of image files in QEMU's QED format (I exploit the format's support for backing files and copy on write).
It's not massively user friendly yet, but hopefully that should soon change (and of course, patches are welcome).
ca à l'air plus près de ce qu'on fait :)
* noyo : [[https://github.com/adafruit/adafruit-raspberrypi-linux]]
* recup du .config precedement telechargé , celui present dans /proc/config.gz
apt-get install xapt
xapt -a armel -m libfoo-dev
LALALALAL libfoo
===== Arch GNU/Linux sur raspberry =====
Suite à de nombreux petits mais pas incontournables problèmes avec raspbian, j'ai décidé de tenter Arch ;-)
http://archlinuxarm.org/ donne le ton. et http://elinux.org/ArchLinux_Install_Guide
j'ai fais un dd de l'image http://archlinuxarm.org/platforms/armv6/raspberry-pi sur une SD. La bebete boot sans probleme, root mot de passe root, attention a son serveur dhcpd, et j'ai pu tester directement l'ajout d'une cle son USB
#mise a jour des depots
pacman -Sy
# install de la partie alsa
pacman -S alsa-utils
pacman -S espeak
espeak "bonjour"
Et un bonjour avec l'accent :-)
il existe dans /usr/share/espeak-data/voices/mb/ d'autres voix et on peut encore en ajouter.
espeak -v mb/mb-fr1 "bonjour"
est plus agréable
http://fr.mirror.archlinuxarm.org/armv6h/community/
http://go2linux.garron.me/how-to-install-compile-sources-arch-linux-abs
https://wiki.archlinux.org/index.php/Arch_Build_System
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=1360&p=75130 !!
sudo pacman -S abs base-devel
changer /etc/abs.conf ARCH="armv6h"
abs core
abs extra
abs community
http://comments.gmane.org/gmane.comp.audio.jackit/26713
==== Cross compilation pour arch ====
* [[http://archlinuxarm.org/developers/distcc-cross-compiling]] pour installation gcc-ng
* [[http://mitchtech.net/raspberry-pi-kernel-compile/]] pour le kernel
====== Rasbian truc======
=== clonage d'une rsp ===
un super script par la : https://github.com/NathanSDunn/Raspi-Arcade/blob/master/rpi-clone.sh
===jack2 patche pour armhf===
Des l'instant ou jack change il faut penser a recompiler
tous les logiciels qui l'utilise
apt-get source soft est une solution rapide
voir :
* http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5787&p=262924
* http://linuxmusicians.com/viewtopic.php?f=6&t=10477
=== bio2jack patch pour armhs et jack2 ===
Suite a une odif pour faire fonctionner boodler
#recuperer sources
apt-get source bio2jack
#modifier bio2jack.c
#mettre
if((drv->client = jack_client_new(our_client_name)) == 0)
{
#en
/*
if((drv->client = jack_client_new(our_client_name)) == 0)
*/
if( (drv->client = jack_client_open( our_client_name, JackNullOption | JackNoStartServer, NULL ) ) == 0 )
{
=== mbrola sur armhf ===
de [[http://www.pobot.org/Synthese-vocale-avec-espeak-et.html]]
L'idee est de construire un debian en chroot qui execute lui de l'arm sans hard float
mkdir /home/debian-chroot
apt-get install debootstrap
debootstrap --arch=armel --variant=minbase wheezy /home/debian-chroot/ http://ftp2.fr.debian.org/debian/
# long...
echo "
# Debian chroot
/tmp /home/debian-chroot/tmp none bind 0 0
/dev /home/debian-chroot/dev none rbind 0 0
/proc /home/debian-chroot/proc none bind 0 0
">> /etc/fstab
Pour lire un fichier texte :
# !/bin/bash
if [ "$#" -ne 1 ]
then
printf "Usage ./speak \"Text to speak\"\n"
else
sudo espeak -q -v mb/mb-fr1 "$1" | sudo chroot /home/debian-chroot mbrola /usr/share/mbrola/voices/fr1 - - | aplay -r16000 -fS16
fi
=== ntp ===
Synchronisation ntpd sur le GPS ,modifier /etc/net.conf en ajoutant
server 127.127.28.0 mode 52 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.535 refid GPS
server 127.127.28.0 mode 52 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 refid PPS
=== pd-extended ===
* http://log.liminastudio.com/writing/tutorials/how-to-build-pd-extended-on-the-raspberry-pi
* http://puredata.hurleur.com/sujet-8036-build-extended-raspberry-raspbian-wheezy-armf
*
======Ancien mais pas perdu======
===== Crosscompilation: =====
===== Version 1 =====
comment : [[http://biffengineering.com/wiki/index.php?title=HowToSetupCrossCompileEnvironment]]
sudo apt-get install mercurial bison flex texinfo libtool build-essential libncurses-dev autoconf gperf
mkdir -p ~/x-tools/src
cd x-tools/src
hg clone http://ymorin.is-a-geek.org/hg/crosstool-ng
cd crosstool-ng
autoconf
./configure
make
make install
sudo cp ct-ng.comp /etc/bash_completion.d
export PATH=$HOME/x-tools/crosstool-ng/bin:$PATH
#mkdir -p ~/x-tools/arm-unknown-gnueabi
cd ~/x-tools/arm-unknown-gnueabi
#ct-ng menuconfig
#ct-ng build
"Now we'll build the cross toolchain. You can use the .config I put on
pastebin, or just make your own config with 'ct-ng menuconfig'.
Getting my .config from http://pastebin.com/Rh6tvh32 and building the toolchain:
wget http://pastebin.com/raw.php?i=Rh6tvh32 -O .config
ct-ng menuconfig
ct-ng build
cd ~/x-tools/arm-unknown-linux-gnueabi/bin
wget http://pastebin.com/raw.php?i=NR7qiJA4 -O link
chmod +x link
./link
apt-get install distcc
http://wiki.debian.org/EmdebianToolchain
http://elinux.org/RPi_Kernel_Compilation#Ubuntu_Linux
http://mitchtech.net/raspberry-pi-kernel-compile/
en gros il faut penser a a jouter le dépot emdebian ;-)
##DEPOT POUR CROSS COMPILATION DE EMDEBIAN.ORG
deb http://www.emdebian.org/debian squeeze main
===== Version 2 =====
mkdir raspberrypi
cd raspberrypi
git clone https://github.com/raspberrypi/tools.git
echo “export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin”>>~/.bashrc
export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
# sortir du terminal pour recharger le PATH au cas ou
# verification
arm-linux-gnueabihf-gcc -v
git clone https://github.com/raspberrypi/linux.git
cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_cutdown_defconfig
Récupérer un .config comme celui d'Occidentalis par exemple {{:rasberry:config.txt|}}
copier le /proc/config.gz ,le decompresser et le renommer en .config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
#faire les modif puis
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -k -j5
# modules
mkdir ../modules
make modules_install ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=../modules/
# image du kernel
cd ../tools/mkimage/
./imagetool-uncompressed.py ../../linux/arch/arm/boot/Image
Copier l'image sur la premiere partition de la SD
Copier les repertoires firmware et modules dans le root-fs : la seconde partion de la SD
Comme une arduino :
http://log.liminastudio.com/writing/tutorials/tutorial-how-to-use-your-raspberry-pi-like-an-arduino
http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
===== Écran DSI ====
Une liste d'écran:
* http://www.displayalliance.com/research/lh350ws1-sd01.html
*
===== slitaz et autre sur rasberry =====
slitaz : http://dl.dropbox.com/u/45842273/zImage_3.1.9
http://elinux.org/RPi_Distributions
http://elinux.org/Rpi_kernel_compilation#From_a_foreign_machine
http://mrpfister.com/journal/raspberry-pi-os-image-downloader/ regardez le xml en attendant l'exe en mono ...
http://neophob.com/2012/06/raspberry-pi-distributions/
===== En tout genre pour framboise =====
* moniteur de capteur, domotique ... http://openenergymonitor.org/emon/node/90
* http://raspberrypidiskimages.com/ toutes les images pour la rsp
la synthese vocale avec picottts http://mon-club-elec.fr/mes_downloads/doc_raspberrypi/rasperrypi_procedures_audio.pdf
une bonne page chez labomedia : http://wiki.labomedia.org/index.php/Raspberry_Pi